/* The clinic signup page.
 *
 * Its own stylesheet rather than a slice of the landing bundle: this page is server
 * rendered so it works before any JavaScript arrives, and a form somebody is halfway
 * through should never be waiting on a 300KB bundle to look like a form.
 *
 * Colour, spacing, radius and motion all come from tokens.css. Nothing is invented here
 * that the rest of the product already has a name for.
 */

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: vazirmatn, 'Segoe UI', Tahoma, sans-serif;
    line-height: 1.9;
}

.su-wrap { width: min(980px, 100% - 2 * var(--space-5)); margin-inline: auto; }

/* ---- header ---- */

.su-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-4);
    width: min(980px, 100% - 2 * var(--space-5)); margin-inline: auto;
    padding: var(--space-5) 0;
}
.su-brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 800; color: var(--text); text-decoration: none;
}
.su-brand img { width: 34px; height: 34px; border-radius: 10px; }
.su-back { color: var(--text-secondary); text-decoration: none; font-size: 0.85rem; }
.su-back:hover { color: var(--primary); }

/* ---- the choice ---- */

.su-eyebrow {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 10px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; color: var(--primary);
}
.su-eyebrow::before {
    content: ''; width: 18px; height: 2px; border-radius: 2px;
    background: var(--primary); flex: 0 0 auto;
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(1.5rem, 1.1rem + 1.7vw, 2.1rem);
    font-weight: 900; line-height: 1.5; letter-spacing: -0.01em;
}
.su-lede { margin: 0 0 var(--space-6); color: var(--text-secondary); font-size: 0.92rem; }

.su-doors {
    display: grid; gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

/* Two doors to one room. Deliberately the same weight: the brief was «whichever is
   comfortable», and making one of them quieter would be answering a question the visitor
   was supposed to answer. What differs is character, not rank. */
.su-door {
    position: relative; display: flex; flex-direction: column;
    padding: var(--space-5);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--surface); box-shadow: var(--shadow-sm);
    color: inherit; text-decoration: none;
    transition: transform var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
}
.su-door:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.su-door:focus-visible { box-shadow: var(--focus-ring); }
.su-door h2 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 800; }
.su-door p { margin: 0; color: var(--text-secondary); font-size: 0.87rem; }

.su-door-tag {
    align-self: flex-start; margin-bottom: var(--space-4);
    padding: 4px 10px; border-radius: 999px;
    background: var(--primary-light); color: var(--primary);
    font-size: 0.72rem; font-weight: 700;
}
.su-door-go {
    margin-top: var(--space-4); color: var(--primary);
    font-size: 0.86rem; font-weight: 700;
}

/* The Bale door shows what the Bale door IS: a question answered straight away. Two
   bubbles is the whole claim, and it is cheaper to show than to assert. */
.su-chat {
    display: flex; flex-direction: column; gap: 6px;
    margin-top: var(--space-4);
}
.su-bubble {
    max-width: 88%; padding: 7px 11px;
    border-radius: 13px; font-size: 0.78rem; line-height: 1.8;
}
.su-them { align-self: flex-start; background: var(--bg); color: var(--text-secondary); }
.su-us { align-self: flex-end; background: var(--primary); color: var(--on-primary); }

/* And the form door shows three fields. Same trick, same honesty. */
.su-mini { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: 7px; }
.su-mini li { height: 9px; border-radius: 5px; background: var(--bg); }
.su-mini li:nth-child(2) { width: 72%; }
.su-mini li:nth-child(3) { width: 45%; }

/* ---- what happens next ---- */

.su-steps { padding: var(--space-8) 0; }
.su-steps ol {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    counter-reset: step;
}
/* Numbered because it genuinely is a sequence and the order is the information: the
   question this section answers is «how long until I can use it». */
.su-steps li {
    counter-increment: step;
    display: flex; flex-direction: column; gap: 2px;
    padding-top: var(--space-4); border-top: 2px solid var(--border);
}
.su-steps li::before {
    content: counter(step); margin-bottom: 6px;
    font-size: 0.75rem; font-weight: 800; color: var(--primary);
}
.su-steps strong { font-size: 0.95rem; }
.su-steps span { color: var(--text-secondary); font-size: 0.85rem; }

/* ---- the form ---- */

.su-form-wrap { padding: var(--space-8) 0 var(--space-8); }
.su-form-wrap h2 { margin: 0 0 8px; font-size: 1.3rem; font-weight: 900; }

#su-form {
    display: grid; gap: var(--space-4);
    padding: var(--space-6);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--surface); box-shadow: var(--shadow-sm);
}
.su-row { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

label { display: grid; gap: 6px; min-width: 0; }
label > span { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }

input, select, textarea {
    width: 100%; box-sizing: border-box;
    /* 16px so iOS Safari does not zoom the page the moment a field is focused. */
    padding: 11px 13px; font: inherit; font-size: 16px;
    color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: var(--focus-ring);
}

#su-submit {
    justify-self: start; margin-top: var(--space-2);
    padding: 12px 30px; border: 0; border-radius: var(--radius);
    background: var(--primary); color: var(--on-primary);
    font: inherit; font-weight: 700; cursor: pointer;
    box-shadow: var(--shadow-primary);
    transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
#su-submit:hover:not(:disabled) { background: var(--primary-hover); }
#su-submit:active:not(:disabled) { transform: scale(0.98); }
#su-submit:disabled { opacity: 0.65; cursor: default; box-shadow: none; }

.su-note { margin: 0; min-height: 1.3em; font-size: 0.82rem; color: var(--text-muted); }
/* The agreement box, shown when the form pays. A real checkbox with its label around it, so
   the whole sentence is the target and a screen reader reads it as one thing. */
.su-agree {
    display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
    font-size: 0.88rem; line-height: 1.9; color: var(--text-secondary);
}
.su-agree[hidden] { display: none; }
.su-agree input { width: 18px; height: 18px; margin-top: 5px; flex-shrink: 0; accent-color: var(--primary); }
.su-agree a { color: var(--primary); font-weight: 700; }
.su-note.is-error { color: var(--danger); font-weight: 600; }

/* ---- sent ---- */

.su-done {
    padding: var(--space-8) var(--space-6);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--surface); box-shadow: var(--shadow-sm); text-align: center;
}
.su-done h3 { margin: var(--space-4) 0 8px; font-size: 1.2rem; font-weight: 900; }
.su-done p { margin: 0 auto; max-width: 34rem; color: var(--text-secondary); font-size: 0.9rem; }
.su-done .su-note { margin-top: var(--space-4); }
.su-done a { color: var(--primary); font-weight: 700; }

.su-tick {
    width: 52px; height: 52px; margin: 0 auto; border-radius: 50%;
    background: var(--success-light);
    -webkit-mask: none; mask: none;
    position: relative;
}
.su-tick::after {
    content: ''; position: absolute; inset: 0;
    background: var(--success);
    -webkit-mask: var(--icon-check) center / 24px 24px no-repeat;
            mask: var(--icon-check) center / 24px 24px no-repeat;
}

/* ---- the plan and the duration ---- */

.su-plan {
    display: grid; gap: var(--space-4); margin: 0;
    padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg);
}
.su-plan legend { padding: 0 8px; font-size: 0.85rem; font-weight: 800; color: var(--primary); }
.su-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.su-tabs[hidden] { display: none; }
.su-tabs button {
    flex: 1 1 0; min-width: 110px;
    display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 10px 8px; cursor: pointer;
    font: inherit; font-size: 0.88rem; font-weight: 700; color: var(--text-secondary);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.su-tabs button em { font-style: normal; font-size: 0.72rem; font-weight: 700; color: var(--danger); min-height: 1.1em; }
.su-tabs button[aria-checked="true"] {
    border-color: var(--primary); background: var(--primary-light); color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}
.su-tabs button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.su-sum { display: grid; gap: 6px; }
.su-sum p { margin: 4px 0 0; font-size: 0.84rem; color: var(--text-secondary); line-height: 1.9; }
.su-sum-total, .su-sum-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.su-sum-total {
    padding: 10px 14px; border-radius: var(--radius-sm);
    background: var(--primary-light); color: var(--text);
}
.su-sum-total b { font-size: 1.15rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.su-sum-row { padding: 0 14px; font-size: 0.84rem; color: var(--text-muted); }
.su-sum-row s { text-decoration-color: var(--danger); }
.su-sum-row.is-save b { color: var(--success); }

/* The discount code: a field and its button on one line, the answer under it. */
.su-code { display: grid; gap: 6px; }
.su-code[hidden] { display: none; }
.su-code > span { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.su-code-line { display: flex; gap: 8px; }
.su-code-line input { direction: ltr; text-align: left; text-transform: uppercase; }
.su-code-line button {
    flex: 0 0 auto; padding: 0 18px; font: inherit; font-weight: 700;
    border: 1px solid var(--primary); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--primary); cursor: pointer;
}
.su-code-line button:disabled { opacity: 0.6; cursor: default; }
.su-code-msg { margin: 0; min-height: 1.2em; font-size: 0.8rem; color: var(--text-muted); }
.su-code-msg.is-ok { color: var(--success); }
.su-code-msg.is-error { color: var(--danger); }

/* ---- the receipt, after the bank ---- */

.su-receipt h1 { margin: var(--space-4) 0 var(--space-5); font-size: 1.3rem; font-weight: 900; }
.su-receipt.is-bad .su-tick { background: var(--danger-light); }
.su-receipt.is-bad .su-tick::after { background: var(--danger); -webkit-mask: none; mask: none;
    inset: 17px; border-radius: 3px; clip-path: polygon(20% 0, 50% 30%, 80% 0, 100% 20%, 70% 50%, 100% 80%, 80% 100%, 50% 70%, 20% 100%, 0 80%, 30% 50%, 0 20%); }
.su-receipt.is-wait .su-tick { background: var(--warning-light, #fef3c7); }
.su-receipt.is-wait .su-tick::after { background: var(--warning, #b45309); -webkit-mask: none; mask: none;
    inset: 21px; border-radius: 50%; }
.su-facts {
    display: grid; gap: 0; margin: 0 auto var(--space-5); max-width: 26rem; text-align: start;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.su-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.su-facts div + div { border-top: 1px solid var(--border); }
.su-facts dt { color: var(--text-muted); font-size: 0.84rem; }
.su-facts dd { margin: 0; font-weight: 700; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.su-actions { margin-top: var(--space-5); }
.su-done a.su-cta, .su-cta {
    display: inline-block; padding: 12px 30px; border-radius: var(--radius);
    background: var(--primary); color: var(--on-primary); font-weight: 700; text-decoration: none;
    box-shadow: var(--shadow-primary);
}
.su-cta:hover { background: var(--primary-hover); }

/* ---- footer ---- */

.su-foot { padding: var(--space-6) 0 var(--space-8); }
.su-foot .su-wrap { display: flex; gap: var(--space-5); flex-wrap: wrap; }
.su-foot a { color: var(--text-muted); text-decoration: none; font-size: 0.84rem; }
.su-foot a:hover { color: var(--primary); }

@media (max-width: 560px) {
    .su-top, .su-wrap { width: calc(100% - 2 * var(--space-4)); }
    #su-form { padding: var(--space-5) var(--space-4); }
    #su-submit { justify-self: stretch; text-align: center; }
}
