/* Pride Dental Group · Patient Intake
   Warm paper by day, warm near-black by night, blue for the one action, sand for warmth: the same palette as the site. */

:root {
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-text: #1d4ed8;
    --accent-soft: #eaf1ff;
    --ink: #1c1714;
    --ink-2: #4a4038;
    --ink-3: #7c6a58;
    --bg: #faf6f0;
    --bg-2: #fbf2e1;
    --surface: #ffffff;
    --line: #e5e5e2;
    --line-2: #d8d2c8;
    --ok: #b4791f;
    --ok-soft: #fbf2e1;
    --danger: #d12f2f;
    --danger-soft: #fdeeee;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .05);
    --shadow: 0 4px 12px -4px rgb(0 0 0 / .12);
    --shadow-lg: 0 12px 28px -8px rgb(0 0 0 / .18);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --radius: 10px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --accent: #2563eb;
        --accent-dark: #1d4ed8;
        --accent-text: #60a5fa;
        --accent-soft: #2a2318;
        --ink: #f4f4f5;
        --ink-2: #a8a29e;
        --ink-3: #968c82;
        --bg: #0b0b0c;
        --bg-2: #1c1a19;
        --surface: #141416;
        --line: #2a2a2e;
        --line-2: #3a3a40;
        --ok: #f0b860;
        --ok-soft: #2a2318;
        --danger: #f87171;
        --danger-soft: #331b1b;
        --shadow-sm: 0 1px 2px rgb(0 0 0 / .5);
        --shadow: 0 4px 12px -4px rgb(0 0 0 / .6);
        --shadow-lg: 0 12px 28px -8px rgb(0 0 0 / .7);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-text: #60a5fa;
    --accent-soft: #2a2318;
    --ink: #f4f4f5;
    --ink-2: #a8a29e;
    --ink-3: #968c82;
    --bg: #0b0b0c;
    --bg-2: #1c1a19;
    --surface: #141416;
    --line: #2a2a2e;
    --line-2: #3a3a40;
    --ok: #f0b860;
    --ok-soft: #2a2318;
    --danger: #f87171;
    --danger-soft: #331b1b;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .5);
    --shadow: 0 4px 12px -4px rgb(0 0 0 / .6);
    --shadow-lg: 0 12px 28px -8px rgb(0 0 0 / .7);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

:root[dir="rtl"] body { font-family: 'Noto Naskh Arabic', var(--font); }
a { color: var(--accent-text); }
h1, h2, h3 { font-weight: 700; line-height: 1.2; margin: 0; letter-spacing: -.01em; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:root[dir="rtl"] .wchoice-arrow, :root[dir="rtl"] .btn-next .i, :root[dir="rtl"] .btn-back .i, :root[dir="rtl"] #back-btn .i, :root[dir="rtl"] .link-btn .i[data-flip] { transform: scaleX(-1); }

.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -9999px; opacity: 0; }

/* ---------- Top bar ---------- */

.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1120px; margin: 0 auto; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 16px; }
.brand svg { width: 18px; height: 20px; color: var(--accent); }
.bar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; text-decoration: none; }
.icon-btn:hover { color: var(--accent-text); border-color: var(--accent); }
.icon-btn .i { width: 18px; height: 18px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
    :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}

.lang { position: relative; display: inline-flex; align-items: center; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-2); }
.lang > .i { position: absolute; inset-inline-start: 11px; pointer-events: none; }
.lang select { appearance: none; height: 100%; padding: 0 30px 0 36px; border: 0; background: transparent; color: var(--ink); font: 600 14px var(--font); cursor: pointer; }
:root[dir="rtl"] .lang select { padding: 0 36px 0 30px; }
.lang select:focus { outline: none; }
.lang:focus-within { border-color: var(--accent); }
.lang-chev { position: absolute; inset-inline-end: 9px; width: 15px; height: 15px; pointer-events: none; }

.call-link { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 13px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
.call-link:hover { background: var(--accent-dark); color: #fff; }
.call-link .i { width: 15px; height: 15px; }

/* ---------- Mobile bottom strip ---------- */

.mobile-strip { display: none; }

@media (max-width: 959px) {
    .topbar .bar-actions { display: none; }
    .mobile-strip {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
        display: grid; grid-template-columns: 1fr 44px 1fr; gap: 8px; align-items: center;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        background: var(--surface); border-top: 1px solid var(--line);
    }
    .mobile-strip .lang { height: 44px; }
    .mobile-strip .lang select { width: 100%; }
    .mobile-strip .icon-btn { width: 44px; height: 44px; }
    .mobile-strip .call-link { height: 44px; justify-content: center; }
    body .welcome, body .done { padding-bottom: 100px; }
    body .actionbar { bottom: calc(66px + env(safe-area-inset-bottom)); }
    body .actionbar .secure { display: none; }
    body .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
    body .sheet-card { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ---------- Welcome ---------- */

.welcome { min-height: calc(100vh - 61px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.welcome-inner { width: 100%; max-width: 960px; text-align: center; }
.welcome-mark { width: 72px; height: 72px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.welcome-mark svg { width: 34px; height: 37px; }
.welcome h1 { font-size: clamp(32px, 4.6vw, 58px); margin-bottom: 12px; }
.welcome h1 em { font-style: normal; color: var(--accent-text); }
.welcome-sub { margin: 0 auto 30px; max-width: 34rem; color: var(--ink-2); font-size: clamp(17px, 1.5vw, 21px); }
.welcome-q { margin: 0 0 14px; font-size: clamp(19px, 2vw, 24px); font-weight: 700; }
.welcome-choices { display: grid; gap: 14px; }

.wchoice {
    display: flex; align-items: center; gap: 16px; width: 100%; min-height: 88px; padding: 16px 18px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink);
    font: inherit; text-align: start; cursor: pointer; box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.wchoice:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.wchoice:active { transform: scale(.99); }
.wchoice-icon { width: 52px; height: 52px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
.wchoice-icon .i { width: 24px; height: 24px; }
.wchoice-text { flex: 1; display: flex; flex-direction: column; }
.wchoice-text strong { font-size: 18px; }
.wchoice-text small { font-size: 14.5px; color: var(--ink-2); }
.wchoice-arrow { width: 20px; height: 20px; color: var(--accent); }

.resume-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-2); font: 600 14px var(--font); cursor: pointer; }
.resume-link .i { width: 15px; height: 15px; }

.welcome-perks { list-style: none; margin: 36px auto 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: 13.5px; color: var(--ink-3); }
.welcome-perks li { display: inline-flex; align-items: center; gap: 7px; }
.welcome-perks .i { width: 15px; height: 15px; color: var(--accent); }

/* ---------- Flow layout ---------- */

.flow { min-height: calc(100vh - 61px); display: flex; flex-direction: column; }
.side { display: none; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.stepbar { position: sticky; top: 45px; z-index: 25; background: var(--surface); border-bottom: 1px solid var(--line); }
.stepbar-inner { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; max-width: 720px; margin: 0 auto; padding: 10px 18px 8px; }
.step-count { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.step-name { font-size: 15px; font-weight: 700; }
.progress-track { position: relative; height: 4px; background: var(--line); }
.progress-fill { position: absolute; inset: 0 auto 0 0; width: 0%; background: var(--accent); transition: width .35s ease; }
:root[dir="rtl"] .progress-fill { inset: 0 0 0 auto; }

.form { flex: 1; display: flex; flex-direction: column; }
.steps { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 24px 18px 28px; display: flex; flex-direction: column; gap: 44px; }
.step { display: flex; flex-direction: column; gap: 22px; scroll-margin-top: 80px; }
.step.enter-fwd { animation: in-fwd .3s ease; }
.step.enter-back { animation: in-back .3s ease; }
@keyframes in-fwd { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes in-back { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
.step-head { position: relative; padding-inline-start: 48px; }
.sec-num { position: absolute; inset-inline-start: 0; top: 2px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; }
.step-head h2 { font-size: 26px; margin-bottom: 6px; }
.step-head p { margin: 0; color: var(--ink-2); font-size: 16px; }

.ptype-pill { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: -20px; }
.ptype-badge { padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; }

/* Desktop: side panel + form */
@media (min-width: 960px) {
    .flow { flex-direction: row; max-width: 1120px; width: 100%; margin: 0 auto; }
    .side { display: block; width: 300px; flex-shrink: 0; border-inline-end: 1px solid var(--line); }
    .side-inner { position: sticky; top: 61px; padding: 36px 28px; display: flex; flex-direction: column; gap: 26px; }
    .side-kicker { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
    .side-name { margin: -18px 0 0; font-size: 20px; font-weight: 700; }
    .side-name:empty { display: none; }
    .side-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
    .side-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; font-size: 16px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
    .side-steps li:hover { background: var(--bg-2); }
    .side-steps li.current { background: var(--accent-soft); color: var(--accent-text); }
    .side-steps .n { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid currentColor; font-size: 13px; }
    .side-steps li.current .n { background: var(--accent); border-color: var(--accent); color: #fff; }
    .side-steps li.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
    .side-steps .n .i { width: 13px; height: 13px; stroke-width: 3; }
    .side-office { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
    .side-office p { margin: 0 0 10px; }
    .side-office strong { color: var(--ink); }
    .side-office a { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; text-decoration: none; }
    .side-office .i { width: 15px; height: 15px; }
    .side-secure { display: flex; align-items: flex-start; gap: 7px; margin: 0; font-size: 12.5px; color: var(--ink-3); }
    .side-secure .i { width: 14px; height: 14px; margin-top: 3px; }
    .steps { max-width: 900px; margin: 0; padding: 48px 56px 32px; gap: 56px; }
    .step { gap: 26px; }
    .step-head { padding-inline-start: 56px; }
    .sec-num { width: 40px; height: 40px; font-size: 17px; top: 4px; }
    .step-head h2 { font-size: 34px; margin-bottom: 8px; }
    .step-head p { font-size: 18px; }
    .flow .field > label, .flow .sub-label { font-size: 15.5px; }
    .flow .input { min-height: 56px; padding: 14px 16px; font-size: 17px; }
    .flow .grid-2 { gap: 18px; }
    .flow .seg-btn { min-height: 68px; font-size: 15.5px; }
    .flow .seg-2 .seg-btn { min-height: 58px; }
    .flow .choice { min-height: 76px; }
    .flow .choice-text strong { font-size: 16.5px; }
    .flow .choice-text small { font-size: 14px; }
    .flow .scan { padding: 20px; }
    .flow .slots { gap: 14px; }
    .flow .callout { font-size: 15.5px; padding: 15px 18px; }
    .flow .date { min-height: 108px; }
    .flow .date .day { font-size: 36px; }
    .flow .time { min-height: 104px; }
    .flow .time strong { font-size: 15.5px; }
    .flow .chip { min-height: 44px; font-size: 15px; }
    .flow .composer-text { min-height: 150px; font-size: 17px; }
    .flow .review { padding: 20px; }
    .flow .review-list span { font-size: 15.5px; }
    .stepbar { display: none; }
    /* Desktop: the divider and both buttons span exactly the form fields' width. */
    .flow .actionbar { position: static; background: transparent; border-top: 0; padding: 0 56px 48px; }
    .flow .actionbar-inner { max-width: calc(900px - 112px); margin: 0; gap: 16px; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--line); }
    .flow .btn-back { min-height: 58px; padding: 0 22px 0 18px; gap: 8px; font-size: 16px; border-radius: var(--radius); }
    .flow .btn-back span { display: inline; }
    .flow .btn-next { flex: 0 0 auto; width: auto; min-width: 240px; min-height: 58px; padding: 0 30px; font-size: 17px; }
    /* The sidebar already says answers are saved; under the buttons the note
       only appears on the last step, where it reassures next to Submit. */
    .flow .actionbar .secure { display: none; }
    .flow .actionbar:has(#submit-btn:not([hidden])) .secure { display: flex; max-width: calc(900px - 112px); justify-content: flex-end; margin-top: 12px; }
    .side { width: 320px; }
    .side-inner { padding: 48px 32px; }
    .side-steps li { font-size: 16px; padding: 11px 12px; }
    .side-steps .n { width: 28px; height: 28px; }
    .side-office { font-size: 15px; }
    .welcome-choices { grid-template-columns: 1fr 1fr; }
    .wchoice { flex-direction: column; align-items: flex-start; gap: 18px; min-height: 160px; padding: 26px; }
    .wchoice-icon { width: 60px; height: 60px; }
    .wchoice-icon .i { width: 28px; height: 28px; }
    .wchoice-text strong { font-size: 22px; }
    .wchoice-text small { font-size: 15.5px; }
    .wchoice-arrow { align-self: flex-end; margin-top: -30px; width: 24px; height: 24px; }
    .topbar-inner { padding: 13px 24px; }
    .brand { font-size: 17px; }
    .done .done-mark { width: 96px; height: 96px; }
    .done .done-mark .i { width: 46px; height: 46px; }
    .done .done-card h2 { font-size: 44px; }
    .done .done-sub { font-size: 19px; }
    .done .recap { max-width: 34rem; }
    .done .done-actions { max-width: 34rem; }
}

/* ---------- Continue / Submit ---------- */

.actionbar { position: sticky; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
.actionbar-inner { max-width: 684px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.btn-back { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 58px; min-height: 58px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); font: 600 15px var(--font); cursor: pointer; }
.btn-back:hover { color: var(--accent-text); border-color: var(--accent); }
.btn-back span { display: none; }
.actionbar .secure { margin-top: 8px; }
.btn-next { flex: 1; }

.btn-next {
    position: relative; width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 0 24px;
    border: 0; border-radius: var(--radius); background: var(--accent); color: #fff; font: 700 17px var(--font); cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

/* ---------- Photo sheet ---------- */

.sheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .5); }
.sheet-card { position: relative; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 10px; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--surface); box-shadow: var(--shadow-lg); }
.sheet-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; text-align: center; }
.sheet-btn { min-height: 56px; font-size: 16px; }
.sheet-cancel { align-self: center; font-size: 15px; color: var(--ink-2); }
@media (min-width: 640px) { .sheet { align-items: center; padding: 20px; } .sheet-card { border-radius: 16px; padding: 22px 20px; } }

.btn-next:hover { background: var(--accent-dark); }
.btn-next:active { transform: scale(.99); }
.btn-next .i { width: 18px; height: 18px; }
.btn-send .spinner { display: none; width: 17px; height: 17px; border-radius: 50%; border: 2.5px solid rgb(255 255 255 / .35); border-top-color: #fff; animation: spin .8s linear infinite; }
.btn-send.is-sending { cursor: progress; }
.btn-send.is-sending .spinner { display: block; }
.btn-send.is-sending .send-icon { display: none; }
.secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 0; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.secure .i { width: 13px; height: 13px; }

/* ---------- Scan ---------- */

.scan { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); scroll-margin-top: 120px; }
.scan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.scan-title { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.scan-title .i { color: var(--accent); }
.scan-sub { font-size: 12.5px; color: var(--ink-3); }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.slot { position: relative; display: grid; place-items: center; aspect-ratio: 1.586; border-radius: 10px; border: 1.5px dashed var(--line-2); background: var(--bg); overflow: hidden; cursor: pointer; transition: border-color .15s ease; }
.slot:hover { border-color: var(--accent); }
.slot:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px; }
.slot-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; }
.slot-art { width: 70%; max-width: 116px; aspect-ratio: 1.6; }
.slot-label { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 700; }
.slot-label .i { width: 13px; height: 13px; }
.slot-img { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot.has-photo { border-style: solid; background: var(--bg-2); }
.slot.has-photo .slot-empty { visibility: hidden; }
.slot.has-photo .slot-img { display: block; }
.slot-tag { display: none; position: absolute; inset-inline-start: 8px; bottom: 8px; padding: 3px 8px; border-radius: 999px; background: rgb(0 0 0 / .7); color: #fff; font-size: 11px; font-weight: 700; }
.slot.has-photo .slot-tag { display: block; }
.slot-badge { position: absolute; top: 8px; inset-inline-end: 8px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #fff; transform: scale(0); transition: transform .2s ease; }
.slot-badge .i { width: 13px; height: 13px; stroke-width: 3; }
.slot.is-done .slot-badge { transform: scale(1); }
.slot.is-done { border-color: var(--ok); }
.slot-beam { display: none; position: absolute; left: 0; right: 0; top: 0; height: 40%; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--accent) 50%, transparent) 70%, #fff); mix-blend-mode: screen; animation: scanline 1.5s ease-in-out infinite alternate; }
.slot.is-reading .slot-beam { display: block; }

.art-card { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.5; }
.art-band { fill: var(--accent); opacity: .85; }
.art-photo { fill: var(--accent-soft); }
.art-person { fill: none; stroke: var(--accent-text); stroke-width: 3; stroke-linecap: round; opacity: .7; }
.art-line { fill: var(--line); }
.art-line.strong { fill: var(--line-2); }
.art-line.faint { fill: var(--line); opacity: .7; }
.art-accent { fill: var(--accent); }
.art-cross { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.art-bars { fill: var(--ink-3); }

.scan-foot { display: flex; flex-direction: column; gap: 8px; }
.scan-status { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.scan.is-done .scan-status { color: var(--ok); }
.scan-bar { width: 100%; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.scan-bar span { display: block; height: 100%; width: 0%; background: var(--accent); transition: width .25s ease; }
.scan:not(.is-reading) .scan-bar { display: none; }
.scan-reset { align-self: flex-start; }
.scan-error { display: none; }
.scan.invalid { border-color: var(--danger); }
.scan.invalid .scan-error { display: block; }

/* ---------- Buttons & fields ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 9px; border: 1px solid transparent; font: 600 15px var(--font); text-decoration: none; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-text); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: none; color: var(--accent-text); font: 600 13.5px var(--font); text-decoration: none; cursor: pointer; }
.link-btn .i { width: 15px; height: 15px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { position: relative; display: flex; flex-direction: column; gap: 6px; scroll-margin-top: 130px; scroll-margin-bottom: 110px; }
.field > label { font-size: 15.5px; font-weight: 600; }
.opt { font-weight: 500; color: var(--ink-3); }

.input { appearance: none; width: 100%; min-height: 54px; padding: 13px 15px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: 500 17px var(--font); transition: border-color .15s ease, box-shadow .15s ease; }
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input.mono { font-variant-numeric: tabular-nums; }
textarea.input { resize: vertical; min-height: 88px; line-height: 1.5; }

.auto-tag { display: none; position: absolute; top: 0; inset-inline-end: 0; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--ok); background: var(--ok-soft); }
.field.autofilled .auto-tag { display: inline-block; }
.field.autofilled .input { border-color: var(--ok); }
.field-help { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.field-error { display: none; margin: 0; font-size: 13px; color: var(--danger); font-weight: 500; }
.field.invalid .field-error { display: block; }
.field.invalid .input { border-color: var(--danger); }
.field.invalid .choice, .field.invalid .date, .field.invalid .seg-btn, .field.invalid .composer, .field.invalid .check-box { border-color: var(--danger); }

.choice-row { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; text-align: start; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.choice:hover { border-color: var(--accent); }
.choice-icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 9px; background: var(--bg-2); color: var(--ink-2); }
.choice-icon .i { width: 20px; height: 20px; }
.choice-text { flex: 1; display: flex; flex-direction: column; }
.choice-text strong { font-size: 15px; }
.choice-text small { font-size: 13px; color: var(--ink-2); }
.choice-check { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line-2); color: transparent; }
.choice-check .i { width: 13px; height: 13px; stroke-width: 3; }
.choice[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.choice[aria-checked="true"] .choice-icon { background: var(--accent); color: #fff; }
.choice[aria-checked="true"] .choice-check { background: var(--accent); border-color: var(--accent); color: #fff; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg-2 { grid-template-columns: 1fr 1fr; }
.seg-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 66px; padding: 8px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: 600 15px var(--font); cursor: pointer; transition: border-color .15s ease, background .15s ease; text-align: center; }
.seg-btn .i { width: 19px; height: 19px; color: var(--ink-3); }
.seg-btn:hover { border-color: var(--accent); }
.seg-btn[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.seg-btn[aria-checked="true"] .i { color: var(--accent-text); }
.seg-2 .seg-btn { flex-direction: row; gap: 8px; min-height: 50px; }
.seg-warn[aria-checked="true"] { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.seg-warn[aria-checked="true"] .i { color: var(--danger); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-1 { background: #f3b95c; }
.dot-2 { background: #f59e0b; }
.dot-3 { background: var(--danger); }

.callout { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border-radius: var(--radius); background: var(--bg-2); color: var(--ink-2); font-size: 14.5px; }
.callout .i { width: 19px; height: 19px; margin-top: 2px; color: var(--accent-text); }
.callout p { margin: 0; }
.callout strong { color: var(--ink); }
.callout-brand { background: var(--accent-soft); }
.callout-sea { background: var(--ok-soft); }
.callout-sea .i { color: var(--ok); }
.callout-warn { background: var(--danger-soft); }
.callout-warn .i { color: var(--danger); }
.hint { margin: -6px 0 0; font-size: 13px; color: var(--ink-2); }
.sub-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: -8px; font-size: 14px; font-weight: 600; }
.sub-label span:last-child { font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.panel { display: flex; flex-direction: column; gap: 16px; }

.ac { position: relative; }
.ac-icon { position: absolute; inset-inline-start: 14px; top: 15px; color: var(--ink-3); pointer-events: none; }
.ac .input { padding-inline-start: 40px; }
.ac-pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.ac-list { list-style: none; margin: 0; padding: 5px; max-height: 280px; overflow-y: auto; }
.ac-item { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border-radius: 8px; cursor: pointer; }
.ac-item .i { margin-top: 2px; color: var(--ink-3); }
.ac-item:hover, .ac-item[aria-selected="true"] { background: var(--accent-soft); }
.ac-main { display: block; font-size: 15px; font-weight: 600; }
.ac-sub { display: block; font-size: 13px; color: var(--ink-2); }
.ac-credit { margin: 0; padding: 6px 11px 8px; font-size: 11px; color: var(--ink-3); border-top: 1px solid var(--line); }

.phone-list { display: flex; flex-direction: column; gap: 8px; }
.phone-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 8px; }
.phone-row.extra { grid-template-columns: minmax(0, 1fr) 100px 44px; }
.phone-list.single .phone-row { grid-template-columns: minmax(0, 1fr); }
.phone-list.single .select { display: none; }
.icon-btn-sm { width: 44px; height: 48px; display: grid; place-items: center; border-radius: 9px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink-3); cursor: pointer; }
.icon-btn-sm:hover { color: var(--danger); border-color: var(--danger); }
.add-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; border: 0; background: none; color: var(--accent-text); font: 600 14px var(--font); cursor: pointer; }
.add-btn .i { width: 16px; height: 16px; }

.select-wrap { position: relative; }
.select { padding-inline-end: 40px; cursor: pointer; }
.select-chev { position: absolute; inset-inline-end: 13px; top: 50%; margin-top: -9px; color: var(--ink-3); pointer-events: none; }
.phone-row .select { padding: 12px 26px 12px 10px; font-size: 15px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 21px, calc(100% - 10px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }

.check-list { display: flex; flex-direction: column; gap: 4px; margin-top: -4px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check.consent { align-items: flex-start; font-size: 14.5px; color: var(--ink); line-height: 1.5; }
.check.consent .check-box { margin-top: 2px; }
/* The carrier-required small print under the consent box: message frequency,
   rates, STOP, HELP, and the promise that a mobile number is never sold. */
.consent-terms { margin: 8px 0 0 32px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3, #6b7280); }
.consent-terms a { color: inherit; text-decoration: underline; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; border-radius: 6px; border: 2px solid var(--line-2); background: var(--surface); color: transparent; }
.check-box .i { width: 13px; height: 13px; stroke-width: 3; }
.check input:checked + .check-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.check input:focus-visible + .check-box { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px; }

.reveal { position: relative; }
.reveal .input { padding-inline-end: 50px; letter-spacing: .1em; }
.reveal-btn { position: absolute; inset-inline-end: 5px; top: 50%; width: 38px; height: 38px; margin-top: -19px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ink-3); cursor: pointer; }
.reveal-btn[aria-pressed="true"] { color: var(--accent-text); }

/* ---------- Dates & times ---------- */

.date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.date { position: relative; display: flex; flex-direction: column; align-items: center; min-height: 90px; padding: 12px 8px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.date:hover { border-color: var(--accent); }
.date .dow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.date .day { font-size: 30px; font-weight: 700; line-height: 1.15; }
.date .mon { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.date .tick { position: absolute; top: 8px; inset-inline-end: 8px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; transform: scale(0); transition: transform .2s ease; }
.date .tick .i { width: 12px; height: 12px; stroke-width: 3; }
.date[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.date[aria-pressed="true"] .tick { transform: scale(1); }
.date[aria-pressed="true"] .dow, .date[aria-pressed="true"] .mon { color: var(--accent-text); }
.none-btn { align-self: flex-start; min-height: 42px; padding: 0 15px; border: 1.5px dashed var(--line-2); border-radius: 999px; background: none; color: var(--ink-2); font: 600 14px var(--font); cursor: pointer; }
.none-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.none-btn[aria-pressed="true"] { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }

.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.time { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 90px; padding: 12px 6px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.time:hover { border-color: var(--accent); }
.time .i { width: 20px; height: 20px; margin-bottom: 4px; color: var(--ink-3); }
.time strong { font-size: 14px; }
.time small { font-size: 12px; color: var(--ink-3); }
.time .only { font-size: 10.5px; font-weight: 700; color: var(--accent-text); }
.time[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.time[aria-pressed="true"] .i { color: var(--accent-text); }

/* ---------- Voice composer ---------- */

.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble { display: flex; align-items: flex-end; gap: 9px; padding-inline-end: 24px; }
.bubble-avatar { width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.bubble-avatar svg { width: 13px; height: 15px; }
.bubble p { margin: 0; padding: 11px 14px; border-radius: 14px 14px 14px 4px; border: 1px solid var(--line); background: var(--surface); font-size: 14.5px; }
:root[dir="rtl"] .bubble p { border-radius: 14px 14px 4px 14px; }
.composer { border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: border-color .15s ease; }
.composer:focus-within { border-color: var(--accent); }
.composer.is-listening { border-color: var(--danger); }
.composer-text { display: block; width: 100%; min-height: 120px; padding: 14px 15px 6px; border: 0; background: transparent; color: var(--ink); font: 500 16px/1.55 var(--font); resize: none; outline: none; }
.composer-text::placeholder { color: var(--ink-3); }
.live-text { margin: 0; padding: 0 15px 8px; font-size: 15px; font-style: italic; color: var(--ink-3); }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 15px; border-top: 1px solid var(--line); }
.rec-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.composer.is-listening .rec-status { color: var(--danger); font-weight: 700; }
.composer.is-listening .rec-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blink 1s ease-in-out infinite; }
.mic-btn { position: relative; width: 50px; height: 50px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer; }
.mic-btn .i { width: 22px; height: 22px; }
.mic-btn .stop-icon { display: none; width: 18px; height: 18px; }
.mic-btn[aria-pressed="true"] { background: var(--danger); }
.mic-btn[aria-pressed="true"] .mic-icon { display: none; }
.mic-btn[aria-pressed="true"] .stop-icon { display: block; }
.mic-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--danger); opacity: 0; }
.mic-btn[aria-pressed="true"] .mic-ring { animation: ring 1.5s ease-out infinite; }

/* ---------- Review ---------- */

.review { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.review h3 { font-size: 16px; }
.review-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.review-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.review-list small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.review-list span { display: block; font-size: 14.5px; font-weight: 500; white-space: pre-line; }
.review-list .link-btn { flex-shrink: 0; }

/* ---------- Done ---------- */

.done { min-height: calc(100vh - 61px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; text-align: center; }
.done-card { width: 100%; max-width: 560px; }
.done-mark { width: 76px; height: 76px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.done-mark .i { width: 38px; height: 38px; stroke-width: 2.4; }
.done h2 { font-size: clamp(26px, 5vw, 34px); margin-bottom: 10px; }
.done h2 em { font-style: normal; color: var(--accent-text); }
.done-sub { margin: 0 auto; max-width: 30rem; color: var(--ink-2); }
.recap { list-style: none; width: 100%; margin: 22px auto 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: start; }
.recap li { display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.recap .i { width: 17px; height: 17px; margin-top: 3px; color: var(--ok); stroke-width: 2.6; }
.recap small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.recap span { display: block; font-weight: 600; }
.done-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 auto 16px; }
.foot { margin-top: 32px; text-align: center; color: var(--ink-3); font-size: 13px; }
.foot p { margin: 3px 0; }
.foot strong { color: var(--ink-2); }

/* ---------- Toast ---------- */

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60; max-width: calc(100vw - 32px); width: max-content; padding: 12px 17px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; text-align: center; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }
@media (min-width: 960px) { .toast { bottom: 32px; } }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scanline { from { transform: translateY(-100%); } to { transform: translateY(160%); } }
@keyframes ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (min-width: 560px) {
    .choice-row { grid-template-columns: 1fr 1fr; }
    .date-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 400px) {
    .grid-2 { grid-template-columns: 1fr; }
    .time strong { font-size: 13px; }
}
