/* Auxiliary consumer screens. Loaded by these views only, never by the
   indexed contract editor or the Business workspace. Document metrics stay
   in style.css; this sheet styles only the surrounding interface. */

/* Password recovery and email confirmation share the registration card. */
.auth-utility .register-layout { max-width: 820px; }
.auth-utility .auth-card { align-self: center; padding: 38px 34px; overflow-wrap: anywhere; }
.auth-utility .auth-card h1 { font-size: clamp(24px, 3vw, 29px); }
.auth-utility .auth-sub { line-height: 1.75; }
.auth-utility .auth-sub strong { display: inline-block; margin-top: 8px; color: #29496e; }
.auth-utility .auth-utility-art { min-height: 370px; }
.auth-utility .auth-utility-art svg { max-width: 320px; }
.auth-utility .alert { font-size: 13px; line-height: 1.75; border-radius: 10px; }
.auth-utility .alert a { color: inherit; text-underline-offset: 3px; }
.auth-utility .alert-success { border: 1px solid #cfe5dc; background: #edf8f2; color: #347b61; }

/* My templates — retain the familiar cards, actions and quota. */
.personal-templates { min-height: 55vh; padding: 40px 0 60px; background: linear-gradient(180deg, #f1f6ff, #f8fafd 360px); }
.personal-templates .templates-header h1 { color: #203b5d; letter-spacing: -.025em; }
.personal-templates .templates-sub { color: #60728a; line-height: 1.7; }
.personal-templates .templates-quota { border-color: #dfe7f3; border-radius: 12px; padding: 15px 18px; }
.personal-templates .templates-quota-bar { background: #edf2f9; }
.personal-templates .templates-quota-fill { background: #0b5fff; }
.personal-templates .templates-quota-text { color: #60728a; }
.personal-templates .templates-quota-text strong { color: #203b5d; }
.personal-templates .templates-grid { grid-template-columns: repeat(auto-fill, minmax(min(285px, 100%), 1fr)); }
.personal-templates .template-card { min-width: 0; padding: 22px; border-color: #dfe7f3; border-radius: 16px; box-shadow: 0 5px 18px -14px #274e8030; transition: border-color .16s, box-shadow .16s; }
.personal-templates .template-card:hover { transform: none; border-color: #a6c2f3; box-shadow: 0 10px 24px -15px #274e8050; }
.personal-templates .template-card-icon { background: #edf3ff; border: 1px solid #dce7fa; border-radius: 12px; }
.personal-templates .template-card-title { color: #203b5d; line-height: 1.5; }
.personal-templates .template-card-meta { border-color: #edf1f7; color: #60728a; gap: 8px 14px; }
.personal-templates .template-meta-item { white-space: normal; }
.personal-templates .template-card-delete { opacity: 1; color: #8092a9; width: 36px; height: 36px; }
.personal-templates .template-card-delete:hover { color: #b33748; background: #fff2f4; }
.personal-templates .template-card-footer { flex-wrap: wrap; row-gap: 14px; }
.personal-templates .template-card-use { min-height: 38px; height: auto; padding: 10px 12px; border-radius: 9px; background: #0b5fff; box-shadow: none; transition: background-color .16s; }
.personal-templates .template-card-use:hover { background: #084fda; transform: none; box-shadow: none; }
.personal-templates .btn-tpl-action { border-color: #d7e3f3; border-radius: 10px; color: #426387; background: #fff; min-height: 42px; white-space: normal; }
.personal-templates .btn-tpl-primary { background: #0b5fff; border-color: #0b5fff; color: #fff; }
.personal-templates .templates-empty { border: 1px solid #dfe7f3; border-radius: 20px; background: #fff; box-shadow: 0 12px 34px -24px #274e8040; }
.personal-templates .templates-empty-icon { background: #edf3ff; color: #0b5fff; border-radius: 18px; }
.personal-templates .templates-empty h2 { color: #203b5d; }
.personal-templates .templates-empty-sub { color: #60728a; line-height: 1.7; }
.personal-templates .templates-start-card { min-width: 0; border-color: #dfe7f3; border-radius: 14px; background: #f8faff; transition: border-color .16s, background-color .16s; }
.personal-templates .templates-start-card:hover { transform: none; border-color: #a6c2f3; background: #f1f6ff; box-shadow: none; }
.personal-templates .templates-start-card strong { color: #29496e; }
.personal-templates .templates-start-card span { color: #60728a; line-height: 1.65; }
.personal-templates .templates-start-icon { border-radius: 11px; background: #eaf1ff; color: #0b5fff; }

/* Read-only/archived document: no changes inside the A4 sheet. */
.document-preview { background: linear-gradient(180deg, #f1f6ff, #f8fafd 360px); padding-top: 36px; }
.document-preview .profile-header h1 { color: #203b5d; font-size: clamp(23px, 3vw, 30px); line-height: 1.4; letter-spacing: -.02em; overflow-wrap: anywhere; }
.document-preview .preview-pane { border-color: #dfe7f3; border-radius: 16px; box-shadow: 0 8px 26px -21px #274e8040; }
.document-preview .alert { border-radius: 12px; font-size: 14px; line-height: 1.7; }
.document-preview .btn { min-height: 42px; border-radius: 10px; white-space: normal; }

/* Payment, signing outcomes and error screens. */
.flow-pdf-body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; }
.flow-pdf-body .flow-page { box-sizing: border-box; min-height: 100svh; }
.flow-pdf-body a { color: #0b5fff; text-underline-offset: 3px; }
.flow-page {
    --flow-accent: #0b5fff;
    --flow-soft: #edf3ff;
    --flow-border: #d8e5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 480px;
    background: radial-gradient(ellipse at 12% 0, #eaf2ff, transparent 58%), #f8fafd;
    color: #203b5d;
    text-align: center;
}
.flow-page-standalone { min-height: calc(100svh - 64px); }
.flow-page-success { --flow-accent: #347b61; --flow-soft: #edf8f2; --flow-border: #cfe5dc; }
.flow-page-pending, .flow-page-cancel { --flow-accent: #57769a; --flow-soft: #f0f5fc; --flow-border: #dce6f4; }
.flow-page-rejected { min-height: 100svh; font-family: inherit; }
.flow-page .flow-card {
    box-sizing: border-box;
    width: 100%;
    max-width: 680px;
    margin: 0;
    padding: 40px 42px;
    border: 1px solid #dfe7f3;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 44px -28px #274e8050;
    overflow-wrap: anywhere;
}
.flow-mark { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 25px; color: var(--flow-accent, #0b5fff); background: var(--flow-soft, #edf3ff); border: 1px solid var(--flow-border, #d8e5fa); border-radius: 23px; box-shadow: 0 0 0 8px #f8fafd; font-size: 32px; }
.flow-page .flow-card h1 { color: #203b5d; font-size: clamp(25px, 3vw, 32px); letter-spacing: -.025em; line-height: 1.3; margin: 0 0 16px; }
.flow-page .flow-card h2 { color: #304e70; font-size: 21px; line-height: 1.45; font-weight: 600; margin: 0 0 18px; }
.flow-page .flow-card p { color: #60728a; font-size: 14px; line-height: 1.8; }
.flow-page .flow-card .lead { font-size: 16px; line-height: 1.75; margin: 0 0 24px; }
.flow-page .flow-card .trust { font-size: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid #edf1f7; }
.flow-page .flow-card ul { color: #60728a; font-size: 14px; line-height: 1.8; margin: 0 0 16px; padding-left: 24px; }
.flow-page .flow-card li + li { margin-top: 6px; }
.flow-page .flow-card .btn { min-height: 44px; border-radius: 10px; padding: 12px 18px; font-size: 14px; line-height: 1.5; white-space: normal; }
.flow-page .flow-card :is(.btn-ghost, .btn-outline) { color: #426387; background: #fff; border: 1px solid #d7e3f3; }
.flow-page .flow-card :is(.btn-ghost, .btn-outline):hover { background: #f3f7fd; border-color: #b7cce8; }
.flow-page .download-box { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 24px 0 0; }
.flow-page .flow-card > p:has(> .btn) { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.flow-page .flow-card .flow-error-code { font-size: clamp(48px, 8vw, 64px); color: #0b5fff; letter-spacing: -.06em; margin-bottom: 8px; }
.flow-page .flow-card .flow-path { font: 12px/1.7 monospace; color: #71839a; background: #f8faff; border: 1px solid #edf1f7; padding: 10px 14px; border-radius: 9px; }
.flow-page .sign-status-icon { width: 72px; height: 72px; border-radius: 22px; margin-bottom: 24px; }
.flow-page .sign-status-icon-rejected { color: #b33748; background: #fff2f4; border: 1px solid #efd6dc; }
.flow-page .sign-status-quote { background: #f8faff; border: 1px solid #dfe7f3; border-left: 3px solid #d69aa5; border-radius: 10px; }
.flow-page .sign-status-quote strong { color: #425b78; }
.flow-page .flow-card .sign-status-foot { color: #71839a; font-size: 12px; }

/* Recipient signing UI only. The sheet dimensions, typography, canvas
   dimensions and all Business/device selectors remain untouched. */
.consumer-sign { background: radial-gradient(ellipse at 12% 0, #eaf2ff, transparent 60%), #f8fafd; }
.consumer-sign .sign-page-header { border-color: #dfe7f3; }
.consumer-sign .sign-page-header .logo { color: #203b5d; }
.consumer-sign .sign-page-tag { color: #60728a; }
.consumer-sign .sign-doc-card { border-radius: 17px; box-shadow: 0 0 0 1px #dfe7f3, 0 12px 34px -24px #274e8040; }
.consumer-sign .sign-doc-meta { background: #f1f6ff; border-color: #dfe7f3; }
.consumer-sign .sign-doc-meta-title { color: #203b5d; }
.consumer-sign .sign-doc-meta-sub { color: #60728a; }
.consumer-sign .sign-cta-bar { border-color: #dfe7f3; box-shadow: 0 -6px 24px -18px #274e8040; }
.consumer-sign :is(.sign-cta-btn, .sign-modal-btn-primary) { background: #0b5fff; box-shadow: 0 4px 12px -5px #0b5fff50; border-radius: 10px; }
.consumer-sign :is(.sign-cta-btn, .sign-modal-btn-primary):hover { background: #084fda; box-shadow: 0 4px 12px -5px #0b5fff50; }
.consumer-sign .sign-modal-btn-primary:disabled { box-shadow: none; }
.consumer-sign .sign-cta-reject { border-color: #efd6dc; color: #a73849; border-radius: 10px; }
.consumer-sign .sign-modal-head { background: #f8faff; border-color: #e5ecf5; }
.consumer-sign .sign-modal-step-label { color: #60728a; }
.consumer-sign .sign-modal-step-label strong { color: #0b5fff; }
.consumer-sign .sign-step-title { color: #203b5d; letter-spacing: -.02em; }
.consumer-sign .sign-step-sub { color: #60728a; line-height: 1.7; }
.consumer-sign .sign-info-row { border-color: #dfe7f3; border-radius: 12px; background: #f8faff; }
.consumer-sign .sign-info-row label { color: #60728a; text-transform: none; letter-spacing: 0; }
.consumer-sign .sign-info-row .sign-readonly { color: #29496e; }
.consumer-sign .sign-info-row input { color: #203b5d; font-size: 16px; min-width: 0; }
.consumer-sign .sign-info-row input:focus { border-color: #0b5fff; }
.consumer-sign .sign-legal { background: #fff9ee; color: #856431; border: 1px solid #efe1c6; border-radius: 12px; line-height: 1.7; }
.consumer-sign .sign-legal strong { color: #785726; }
.consumer-sign .sign-modal-foot { border-color: #e5ecf5; box-shadow: 0 -4px 18px -12px #274e8030; }
.consumer-sign .sign-modal-btn-secondary { color: #426387; background: #f0f5fc; }
.consumer-sign .sign-modal-btn-secondary:hover { background: #e6eefb; }
.consumer-sign .reject-modal { font-family: inherit; background: #152b49a3; }
.consumer-sign .reject-modal-card { border: 1px solid #dfe7f3; border-radius: 18px; max-height: calc(100dvh - 40px); overflow-y: auto; }
.consumer-sign .reject-modal-card h2 { color: #203b5d; }
.consumer-sign :is(.reject-modal-sub, .reject-modal-label) { color: #60728a; line-height: 1.65; }
.consumer-sign .reject-modal-textarea { border-color: #d7e3f3; border-radius: 10px; background: #fbfcfe; font-size: 16px; }
.consumer-sign .reject-modal-actions { flex-wrap: wrap; }
.consumer-sign .reject-modal-actions .sign-modal-btn { min-width: 110px; }
:is(.auth-utility, .personal-templates, .document-preview, .flow-page, .consumer-sign) :is(a, button, input, textarea):focus-visible { outline: 2px solid #0b5fff; outline-offset: 3px; }

@media (min-width: 768px) {
    .consumer-sign .sign-modal { background: #152b49a3; }
    .consumer-sign .sign-modal-card { border: 1px solid #dfe7f3; border-radius: 20px; }
}
@media (max-width: 760px) {
    .auth-utility .register-layout { max-width: 460px; }
    .auth-utility .auth-card { padding: 30px 26px; }
}
@media (max-width: 600px) {
    .personal-templates { padding: 28px 0 40px; }
    .personal-templates .templates-empty { padding: 28px 18px; }
    .personal-templates .templates-empty-grid { grid-template-columns: minmax(0, 1fr); }
    .personal-templates .templates-actions { gap: 8px; }
    .personal-templates .btn-tpl-action { padding: 10px 12px; }
    .personal-templates .template-card { padding: 20px; }
    .flow-page { padding: 32px 16px; min-height: 420px; }
    .flow-page-standalone { min-height: calc(100svh - 64px); }
    .flow-page-rejected { min-height: 100svh; }
    .flow-page .flow-card { padding: 30px 22px; border-radius: 18px; }
    .flow-mark { width: 64px; height: 64px; border-radius: 19px; margin-bottom: 22px; }
    .flow-page .flow-card .lead { font-size: 14px; }
    .flow-page .download-box { flex-direction: column; }
    .flow-page .flow-card .btn { font-size: 13px; }
    .consumer-sign .reject-modal { padding: 14px; }
    .consumer-sign .reject-modal-card { padding: 24px 20px; max-height: calc(100dvh - 28px); }
    .consumer-sign .sign-modal-head { padding: 12px; gap: 6px; }
    .consumer-sign .sign-modal-btn { padding: 13px 12px; font-size: 14px; }
}
@media (max-width: 380px) {
    .auth-utility .auth-card { padding: 26px 20px; }
    .flow-page .flow-card { padding: 28px 18px; }
}
@media (prefers-reduced-motion: reduce) {
    :is(.auth-utility, .personal-templates, .document-preview, .flow-page, .consumer-sign) *,
    :is(.auth-utility, .personal-templates, .document-preview, .flow-page, .consumer-sign) *::before { animation: none !important; transition: none !important; }
}

/* A quiet thank-you screen with one optional next step. */
.flow-page.thanks-page { display: block; min-height: calc(100svh - 70px); padding: 26px 0 30px; text-align: center; background: radial-gradient(ellipse at 50% 0, #edf3ff 0, #f8fafd 42%, #fff 80%); }
.thanks-wrap { max-width: 720px; }
.thanks-heading { margin-bottom: 22px; }
.thanks-illustration { display: block; width: 172px; height: 116px; margin: 0 auto 14px; }
.thanks-illustration-check { stroke-dasharray: 28; stroke-dashoffset: 0; animation: thanks-check .65s ease-out both; }
@keyframes thanks-check { from { stroke-dashoffset: 28; } to { stroke-dashoffset: 0; } }
.thanks-heading h1 { margin: 0 0 10px; color: #203b5d; font-size: 31px; line-height: 1.3; letter-spacing: -.03em; }
.thanks-heading p { margin: 0; color: #347b61; font-size: 14px; font-weight: 600; }
.thanks-document { max-width: 540px; margin: 0 auto; }
.thanks-document h2 { margin: 0 0 7px; color: #425b78; font-size: 15px; line-height: 1.6; font-weight: 650; overflow-wrap: anywhere; }
.thanks-file-location { margin: 0; color: #60728a; font-size: 12px; line-height: 1.7; }
.thanks-file-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; }
.thanks-again { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; color: #60728a; font-size: 12px; }
.thanks-edit-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid #c9d7ec; border-radius: 9px; background: #fff; color: #29496e; font-size: 13px; font-weight: 650; text-decoration: none; transition: border-color .15s, color .15s; }
.thanks-edit-link:hover { border-color: #9fb8e0; color: #0b5fff; }
.thanks-again a { display: inline-flex; align-items: center; min-height: 38px; color: #355f9c; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.thanks-again a:hover { color: #0b5fff; }
.thanks-quota { max-width: 510px; margin: 8px auto 0; color: #60728a; font-size: 11px; line-height: 1.8; }
.thanks-quota a { color: #536f94; text-underline-offset: 3px; }
.thanks-quota a { display: inline-block; }
.thanks-signing { position: relative; max-width: 540px; margin: 25px auto 0; padding: 23px 28px 20px; border: 1px solid #dfe7f3; border-radius: 15px; background: #f5f8fe; }
.thanks-signing-mark { display: inline-flex; color: #6b8bb8; margin-bottom: 9px; }
.thanks-signing h2 { margin: 0 0 8px; color: #29496e; font-size: 19px; font-weight: 700; line-height: 1.5; letter-spacing: -.02em; }
.thanks-signing > p { max-width: 410px; margin: 0 auto 17px; color: #60728a; font-size: 13px; line-height: 1.75; }
.thanks-signing .thanks-signing-action { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 44px; padding: 11px 20px; border-radius: 9px; font-size: 13px; line-height: 1.6; white-space: normal; box-shadow: none; }
.thanks-signing .thanks-signing-action:hover { transform: none; }
.thanks-signing .thanks-signing-note { margin: 11px auto 0; color: #60728a; font-size: 11px; line-height: 1.7; }
.thanks-instagram { display: flex; align-items: center; gap: 14px; max-width: 540px; margin: 14px auto 0; padding: 14px 16px 14px 18px; border: 1px solid #dfe7f3; border-radius: 15px; background: #fff; color: #29496e; text-align: left; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.thanks-instagram:hover { border-color: #c9d6ea; box-shadow: 0 12px 26px -20px #274e8070; }
.thanks-instagram-mark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 11px; color: #fff; background: radial-gradient(circle at 30% 107%, #fdf497 0, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.thanks-instagram-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.thanks-instagram-text strong { color: #29496e; font-size: 14px; font-weight: 700; line-height: 1.5; }
.thanks-instagram-text span { color: #60728a; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.thanks-instagram-go { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 13px; border: 1px solid #c9d7ec; border-radius: 9px; color: #355f9c; font-size: 12px; font-weight: 650; transition: border-color .15s, color .15s; }
.thanks-instagram:hover .thanks-instagram-go { border-color: #9fb8e0; color: #0b5fff; }
.thanks-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.thanks-return { margin: 17px 0 0; }
.thanks-return a { display: inline-flex; align-items: center; min-height: 38px; color: #60728a; font-size: 12px; text-decoration: none; }
.thanks-return a:hover { color: #355f9c; text-decoration: underline; text-underline-offset: 3px; }
.thanks-page :is(a, button):focus-visible { outline: 2px solid #0b5fff; outline-offset: 4px; }
@media (max-width: 600px) {
    .flow-page.thanks-page { padding: 22px 0 24px; min-height: calc(100svh - 62px); }
    .thanks-wrap.container { padding-inline: 22px; }
    .thanks-illustration { width: 150px; height: 101px; margin-bottom: 15px; }
    .thanks-heading { margin-bottom: 20px; }
    .thanks-heading h1 { max-width: 330px; margin-inline: auto; font-size: 27px; }
    .thanks-document h2 { font-size: 14px; }
    .thanks-again a, .thanks-edit-link, .thanks-return a { min-height: 44px; }
    .thanks-instagram { gap: 12px; padding: 13px 14px; margin-top: 12px; }
    /* Цялата карта е връзката — на телефона бутонът е само стрелка, за да има място текстът. */
    .thanks-instagram-go { justify-content: center; width: 36px; padding: 0; }
    .thanks-instagram-go-label { display: none; }
    .thanks-signing { padding: 21px 20px 18px; margin-top: 22px; }
    .thanks-signing h2 { font-size: 18px; }
    .thanks-signing > p { font-size: 12px; }
    .thanks-signing .thanks-signing-action { width: 100%; }
}
@media (max-width: 380px) {
    .thanks-wrap.container { padding-inline: 18px; }
    .thanks-heading h1 { font-size: 25px; }
    .thanks-signing { padding-inline: 17px; }
}
@media (prefers-reduced-motion: reduce) {
    .thanks-illustration-check { animation: none; }
}
