/* RSA Prompt — public stylesheet (Phase 2A).
   Mobile-first, self-contained (no CDN). Clean, modern, trustworthy
   healthcare look: calm teal/green palette, generous spacing, large
   tap targets, high legibility. */

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
/* the `hidden` attribute must win even over classes that set `display`
   (e.g. .btn{display:inline-flex}) — the UA [hidden] rule otherwise loses */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Sarabun", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.65;
  color: #1f2933;
  background: #f4f7f6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 {
  font-family: "IBM Plex Sans Thai", "Sarabun", system-ui, sans-serif;
  line-height: 1.4; margin: 0 0 .6em; color: #123a37; font-weight: var(--fw-semibold);
}
h1, h2 { text-wrap: balance; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 1em; }
a { color: #297675; text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

/* --------------------------------------------------------------- theme */
:root {
  --brand:        #297675;
  --brand-dark:   #1f5b5a;
  --brand-light:  #e4f1f0;
  --accent:       #d97706;
  --accent-dark:  #8a4d00;   /* readable amber for text/pills on light amber */
  --accent-bg:    #fff4e0;   /* gentle "attention, not danger" surface */
  --danger:       #c0392b;
  --danger-bg:    #fdecea;
  --ok:           #1e7e46;
  --ok-bg:        #e6f4ea;
  --ink:          #1f2933;
  --muted:        #4b5a62;   /* darkened one notch → ~5.6:1 on white (was #5b6b73) */
  --line:         #dfe6e3;
  --card-bg:      #ffffff;

  /* spacing scale (4px base) */
  --sp-1: .25rem;   /* 4  */
  --sp-2: .5rem;    /* 8  */
  --sp-3: .75rem;   /* 12 */
  --sp-4: 1rem;     /* 16 */
  --sp-5: 1.25rem;  /* 20 */
  --sp-6: 1.5rem;   /* 24 */
  --sp-8: 2rem;     /* 32 */

  /* radius scale */
  --radius-sm:   10px;
  --radius:      14px;
  --radius-lg:   18px;
  --radius-pill: 999px;

  /* type scale (mobile-tuned) */
  --fs-h1:   1.55rem;
  --fs-h2:   1.25rem;
  --fs-h3:   1.08rem;
  --fs-body: 1rem;
  --fs-sm:   .875rem;
  --fs-xs:   .75rem;

  /* font weights — calmer, Thai-friendly */
  --fw-body:     400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  /* focus treatment (unified) */
  --focus-ring:    0 0 0 3px rgba(41,118,117,.30);
  --focus-outline: 3px solid rgba(41,118,117,.35);

  --shadow:       0 1px 3px rgba(16,50,49,.08), 0 6px 18px rgba(16,50,49,.05);
  --shadow-lg:    0 2px 6px rgba(16,50,49,.10), 0 12px 30px rgba(16,50,49,.08);
  --maxw:         640px;
}

/* screen-reader-only utility (generalizes the honeypot pattern) */
.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;
}

/* -------------------------------------------------------------- layout */
.site-header {
  background: var(--brand);
  color: #fff;
  padding: .85rem 1rem;
  padding-top: calc(.85rem + env(safe-area-inset-top));
  box-shadow: 0 2px 8px rgba(31,91,90,.18);
  position: sticky; top: 0; z-index: 20;
}
.site-header__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: .55rem;
}
.site-header a { color: #fff; text-decoration: none; }
.site-brand {
  display: flex; align-items: baseline; gap: .6rem; width: 100%;
  justify-content: space-between; flex-wrap: nowrap;
  font-family: "IBM Plex Sans Thai", "Sarabun", system-ui, sans-serif; font-weight: 600; font-size: 1.12rem;
}
.site-brand__name { flex: 0 0 auto; white-space: nowrap; }
.site-brand__mark {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 8px; background: rgba(255,255,255,.16);
  display: grid; place-items: center; font-weight: var(--fw-bold); font-size: .95rem;
}
.site-brand__sub { font-weight: 400; font-size: .74rem; opacity: .9; text-align: right; line-height: 1.25; }

main.page { max-width: var(--maxw); margin: 0 auto; padding: 1.15rem 1rem 2.5rem; }

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: var(--fs-sm);
  padding: var(--sp-6) var(--sp-4) var(--sp-8);
}
.site-footer__inner { max-width: var(--maxw); margin: 0 auto; }
.site-footer strong { color: var(--ink); }
.hotline-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--brand-light); color: var(--brand-dark);
  border-radius: var(--radius-pill); padding: .3rem .8rem; font-weight: var(--fw-semibold);
  margin: .2rem .35rem .2rem 0;
}

/* --------------------------------------------------------------- cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-5);
  margin: 0 0 var(--sp-5);
}
.card--pad-lg { padding: var(--sp-6) var(--sp-5); }
.card__title { margin-top: 0; }

.hero {
  background: linear-gradient(155deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5); margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-lg);
}
.hero h1 { color: #fff; margin-bottom: var(--sp-2); }
.hero p { color: rgba(255,255,255,.92); margin-bottom: var(--sp-5); }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-family: "IBM Plex Sans Thai", "Sarabun", system-ui, sans-serif; font-weight: var(--fw-semibold);
  padding: .85rem 1.35rem; min-height: 52px;
  border-radius: var(--radius-sm); border: 2px solid transparent;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background .12s ease, box-shadow .12s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.btn--block { display: flex; width: 100%; }
.btn--lg { min-height: 60px; font-size: 1.08rem; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn--onhero { background: #fff; color: var(--brand-dark); }
.btn--onhero:hover { background: #eef7f6; text-decoration: none; }
.btn--outline { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn--outline:hover { background: var(--brand-light); text-decoration: none; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #a5281c; text-decoration: none; }
.btn--ghost { background: #f1f5f4; color: var(--ink); border-color: var(--line); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .6; cursor: default; pointer-events: none; }

/* ---------------------------------------------------------------- forms */
.form-section { margin-bottom: var(--sp-6); }
.form-section > legend, .form-section__title {
  font-weight: var(--fw-semibold); color: var(--brand-dark);
  font-size: 1.05rem; padding: 0; margin: 0 0 var(--sp-3);
  display: flex; align-items: center; gap: .5rem;
}
.field { margin-bottom: var(--sp-3); }
.field > label, .field__label {
  display: block; font-weight: var(--fw-semibold); margin-bottom: .35rem; color: #29383e;
}
/* required marker: teal (de-alarmed) instead of red; still a clear cue */
.field .req, .req { color: var(--brand); margin-left: .15rem; }
.field .hint { display: block; font-size: var(--fs-sm); color: var(--muted); margin-top: .3rem; }
/* escape-hatch link inside a hint (e.g. "no Thai id?") — visible, never shouty */
.hint__link {
  display: inline-block; margin-left: .35rem;
  color: var(--brand); font-weight: var(--fw-semibold); text-decoration: underline;
  text-underline-offset: .18em;
}

/* /register/{code}: the one clinic that link belongs to, shown instead of the
   picker step (never a wizard step — it is context, not a question) */
.locked-clinic { border-left: 4px solid var(--brand); }
.locked-clinic__label {
  display: flex; align-items: center; gap: .4rem;
  margin: 0 0 .15rem; font-size: var(--fs-sm); color: var(--muted);
}
.locked-clinic__name { margin: 0 0 .5rem; font-size: 1.15rem; }
.locked-clinic__details { margin: .2rem 0 .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.locked-clinic__details .faq__q { padding: .6rem .8rem; font-size: var(--fs-sm); }
.locked-clinic__details .faq__a { padding: 0 .8rem .8rem; }

/* plain bulleted list inside a card (no global ul styling exists) */
.doc-list { margin: .2rem 0 1em; padding-left: 1.25rem; }
.doc-list li { margin-bottom: .35rem; }

.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: .75rem .85rem; min-height: 50px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; appearance: none;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path fill='%235b6b73' d='M4 6l4 4 4-4z'/></svg>");
  background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.2rem;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: var(--focus-ring);
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--danger); box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}
input[type="file"].input { padding: .55rem .6rem; min-height: 0; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
/* collapse paired fields on narrow phones — except short pairs (names) kept 2-up */
@media (max-width: 460px) { .row2:not(.row2--keep) { grid-template-columns: 1fr; } }
@media (max-width: 340px) { .row2 { grid-template-columns: 1fr; } }

.field-error { color: var(--danger); font-size: .82rem; margin-top: .3rem; font-weight: var(--fw-semibold); }

/* radio / checkbox option cards */
.option {
  display: flex; align-items: flex-start; gap: .6rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: .7rem .8rem; margin-bottom: .55rem; min-height: 44px; cursor: pointer;
  background: #fff; transition: border-color .1s, background .1s, box-shadow .1s;
}
.option:hover { border-color: var(--brand); }
.option input { margin-top: .2rem; width: 22px; height: 22px; flex: 0 0 22px; accent-color: var(--brand); }
.option__text { flex: 1; }
.option__text small { display: block; color: var(--muted); font-size: .8rem; }
.option:has(input:checked) { border-color: var(--brand); background: var(--brand-light); }
/* keyboard/switch-access focus visibility on the whole card */
.option:has(input:focus-visible) {
  border-color: var(--brand); box-shadow: var(--focus-ring);
}

/* consent step: scrollable terms box (bottom fade signals "more below") */
.consent-terms {
  max-height: 340px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background:
    linear-gradient(#fbfdfc 30%, rgba(251,253,252,0)) top / 100% 24px no-repeat,
    linear-gradient(rgba(251,253,252,0), #fbfdfc 70%) bottom / 100% 28px no-repeat,
    #fbfdfc;
  background-attachment: local, local, scroll;
  padding: .9rem 1rem; margin-top: .4rem;
  -webkit-overflow-scrolling: touch;
}
.consent-terms:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.consent-list { margin: 0; padding-left: 1.2rem; }
.consent-list li { margin: 0 0 .7rem; font-size: .9rem; line-height: 1.55; }
.consent-list li:last-child { margin-bottom: 0; }
.consent-terms__note {
  margin: .85rem 0 0; padding-top: .85rem; border-top: 1px dashed var(--line);
  font-size: .9rem; line-height: 1.55; color: var(--ink);
}

.inline-choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.inline-choices .option { flex: 1 1 auto; margin-bottom: 0; }

/* rating stars */
.stars { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label {
  position: relative;
  font-size: 2rem; line-height: 1; color: #b9c6c1; cursor: pointer; padding: 0 .05rem;
  transition: color .08s;
}
.stars label::before { content: "\2605"; }
.stars input:checked ~ label,
.stars label:hover, .stars label:hover ~ label { color: #f5b301; }
.stars input:focus-visible + label { outline: var(--focus-outline); border-radius: 4px; }
/* live numeric echo of the chosen rating (non-color state cue) */
.stars-echo { display: block; margin-top: .35rem; font-size: var(--fs-sm); color: var(--brand-dark); font-weight: var(--fw-medium); }

/* honeypot: visually hidden but present */
/* honeypot: display:none (not just off-screen) so browser/password-manager
   autofill skips it — an autofilled trap used to swallow real submissions */
.hp-field { display: none !important; }

/* ------------------------------------------------------------- messages */
.alert {
  display: flex; align-items: flex-start; gap: .5rem;
  border-radius: var(--radius-sm); padding: .85rem 1rem; margin-bottom: var(--sp-5);
  font-weight: var(--fw-semibold); border: 1px solid transparent;
}
.alert > svg, .alert__icon { flex: 0 0 auto; margin-top: .1rem; }
.alert__body { flex: 1 1 auto; }
.alert--error { background: var(--danger-bg); color: #8a231a; border-color: #f3c6c1; }
.alert--ok    { background: var(--ok-bg); color: #14602f; border-color: #bfe3ca; }
.alert--info  { background: var(--brand-light); color: var(--brand-dark); border-color: #bcdedc; }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.alert li { margin: .15rem 0; }

/* status pill */
.pill {
  display: inline-block; padding: .25rem .7rem; border-radius: var(--radius-pill);
  font-size: .82rem; font-weight: var(--fw-semibold);
}
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--wait { background: var(--accent-bg); color: var(--accent-dark); }
.pill--muted { background: #eef2f1; color: var(--muted); }

/* content page body (trusted admin HTML) */
.content-body { font-size: 1.02rem; }
.content-body h2, .content-body h3 { margin-top: 1.4rem; }
.content-body img { border-radius: 10px; margin: 1rem 0; }
.content-body ul, .content-body ol { padding-left: 1.3rem; }
.content-body a { text-decoration: underline; }

/* content list on home */
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { border-top: 1px solid var(--line); }
.link-list li:first-child { border-top: none; }
.link-list a {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem .2rem; color: var(--ink); font-weight: 600; text-decoration: none;
}
.link-list a:hover { color: var(--brand); }
.link-list .chev { color: var(--muted); }

.eval-section {
  font-size: 1.06rem; color: var(--brand-dark); margin: var(--sp-6) .1rem var(--sp-1);
  padding-bottom: .35rem; border-bottom: 2px solid var(--brand-light);
}
.greeting { font-size: 1.2rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
/* readable measure for pure-Thai text blocks (~60ch reads best) */
.content-body p, .measure { max-width: 42ch; }
.stack > * + * { margin-top: var(--sp-4); }

.big-icon { font-size: 3rem; line-height: 1; text-align: center; margin: .3rem 0 .6rem; }
.big-icon svg { display: inline-block; }
.big-icon--ok { color: var(--ok); }

/* the 3 followup action buttons */
.action-btns { display: grid; gap: .85rem; }
.action-btn {
  display: flex; align-items: center; gap: .85rem; width: 100%;
  text-align: left; font: inherit; font-family: "IBM Plex Sans Thai", "Sarabun", system-ui, sans-serif; font-weight: var(--fw-semibold); font-size: 1.05rem;
  padding: 1.05rem 1.1rem; min-height: 68px;
  border-radius: var(--radius-sm); border: 2px solid var(--line); background: #fff;
  color: var(--ink); cursor: pointer;
}
.action-btn:hover { border-color: var(--brand); }
.action-btn .ico { font-size: 1.6rem; line-height: 1; flex: 0 0 auto; display: inline-flex; color: var(--brand); }
.action-btn small { display: block; font-weight: var(--fw-body); font-size: var(--fs-sm); color: var(--muted); }
.action-btn--pill { border-color: #bcdedc; }
.action-btn--complete { border-color: #bfe3ca; }
.action-btn--incomplete { border-color: #f3c6c1; }
.action-btn.is-done { background: var(--ok-bg); border-color: #bfe3ca; color: #14602f; cursor: default; }
.action-btn.is-done .ico { color: var(--ok); }
.action-btn.is-done:hover { border-color: #bfe3ca; }
.action-btn:disabled { cursor: default; }
a.action-btn { text-decoration: none; }
a.action-btn:hover { text-decoration: none; }

/* round-1 "ระบุวันเวลา" — native expandable button (no JS) */
.act-details { display: block; }
.act-details > summary { list-style: none; }
.act-details > summary::-webkit-details-marker { display: none; }
.act-details[open] > summary { border-color: var(--brand); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.act-details__form {
  border: 2px solid var(--brand); border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: .9rem 1rem 1rem;
  display: grid; gap: .7rem; margin-top: -2px; background: #fbfdfc;
}
.act-dt { display: block; font-weight: var(--fw-semibold); font-size: .9rem; }
.act-dt input { display: block; width: 100%; margin-top: .35rem; padding: .7rem .8rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); font: inherit; }

/* LINE notification opt-in card */
.line-optin { border: 1px solid #bfe6cf; background: #f2fbf5; }
.line-optin__row { display: flex; align-items: flex-start; gap: .7rem; margin-bottom: .9rem; }
.line-optin__badge {
  flex: 0 0 auto; background: #06C755; color: #fff; font-weight: var(--fw-bold);
  font-size: .82rem; letter-spacing: .02em; padding: .3rem .5rem; border-radius: 8px;
}
.line-optin__title { display: block; font-size: 1.02rem; color: #123a37; }
/* on the tinted line-optin surface, use brand-dark (strong contrast) not --muted */
.line-optin__desc { margin-top: .2rem; font-size: .88rem; color: var(--brand-dark); }
.line-optin__btn { background: #06C755; color: #fff; border-color: #06C755; }
.line-optin__btn:hover { background: #05b34c; color: #fff; text-decoration: none; }
/* The LINE opt-in gates the whole followup flow — pulse so it reads as the next
   action, and settle once the user has touched it. Scoped to the opt-in card so
   the other green LINE buttons (clinic chat) stay calm — one pulse per page. */
.line-optin .line-optin__btn {
  position: relative;
  animation: line-cta-pulse 2.4s cubic-bezier(.66, 0, 0, 1) infinite;
}
.line-optin .line-optin__btn:hover,
.line-optin .line-optin__btn:focus-visible,
.line-optin .line-optin__btn:active { animation: none; }

/* clinic name doubling as the "chat on LINE" button — long names must wrap */
.clinic-chat { text-align: center; line-height: 1.4; padding-top: .7rem; padding-bottom: .7rem; }
.clinic-chat span { white-space: normal; overflow-wrap: anywhere; }
.clinic-chat svg { flex: 0 0 auto; }
@keyframes line-cta-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(6, 199, 85, .55); transform: scale(1); }
  55%  { box-shadow: 0 0 0 .75rem rgba(6, 199, 85, 0); transform: scale(1.015); }
  100% { box-shadow: 0 0 0 0 rgba(6, 199, 85, 0); transform: scale(1); }
}

/* Collapsible explainer cards (thank-you page) — collapsed until tapped so the
   LINE opt-in above stays the focus. */
.faq { padding: 0; }
.faq__q {
  display: flex; align-items: center; gap: .5rem;
  padding: var(--sp-4) var(--sp-5); cursor: pointer;
  font-weight: var(--fw-semibold); font-size: 1.02rem; color: var(--brand-dark);
  list-style: none; border-radius: var(--radius);
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q > span { flex: 1 1 auto; }
.faq__q::after {
  content: ''; flex: 0 0 auto; width: .55rem; height: .55rem; margin-right: .2rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-.12rem, -.12rem);
  transition: transform .18s ease;
}
.faq[open] .faq__q::after { transform: rotate(-135deg) translate(-.1rem, -.1rem); }
.faq[open] .faq__q { padding-bottom: .35rem; }
.faq__q:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.faq__a { padding: 0 var(--sp-5) var(--sp-5); }

.hotline-callout {
  background: var(--brand-light); border: 1px solid #bcdedc; border-radius: var(--radius-sm);
  padding: 1rem 1.1rem; margin-top: var(--sp-4);
}
.hotline-callout .num { font-size: 1.5rem; font-weight: 800; color: var(--brand-dark); }

.result-score {
  text-align: center; padding: var(--sp-5); border-radius: var(--radius-sm);
  background: var(--brand-light); margin-bottom: var(--sp-4);
}
.result-score .num { font-size: 2.6rem; font-weight: 800; color: var(--brand-dark); line-height: 1; }
/* muted sub-labels on the tinted surface need stronger contrast than --muted */
.result-score .muted, .hotline-callout .muted { color: var(--brand-dark); }
.result-score.is-high { background: var(--danger-bg); }
.result-score.is-high .num { color: var(--danger); }
.result-score.is-high .muted { color: #8a231a; }

/* ==================================================================
   Mobile-first registration wizard (progressive enhancement)
   Without .js on <html>: all steps show, plain submit works.
   With .js: one step at a time + sticky Back/Next/Submit bar.
   ================================================================== */

/* touch feedback */
.option:active { transform: scale(.99); }
.action-btn:active { transform: scale(.995); }

/* progress */
.wizard__progress { margin: 0 0 1.1rem; }
.wizard__bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.wizard__bar-fill {
  display: block; height: 100%; width: 25%;
  background: var(--brand); border-radius: 999px;
  transition: width .28s ease;
}
.wizard__dots {
  list-style: none; display: flex; gap: .3rem;
  margin: .6rem 0 0; padding: 0;
}
.wizard__dot { flex: 1 1 0; text-align: center; color: var(--muted); min-width: 0; }
.wizard__dot span {
  display: grid; place-items: center; width: 28px; height: 28px;
  margin: 0 auto .25rem; border-radius: 50%;
  background: var(--line); color: #fff; font-weight: 700; font-size: .88rem;
  transition: background .2s ease;
}
.wizard__dot small {
  display: block; font-size: .68rem; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wizard__dot.is-active { color: var(--brand-dark); font-weight: 700; }
.wizard__dot.is-active span, .wizard__dot.is-done span { background: var(--brand); }
.wizard__dot.is-done span::before { content: "\2713"; } /* ✓ on completed */
.wizard__dot.is-done span { font-size: .95rem; }

/* one step at a time (JS only) */
.js .wizard__step { display: none; }
.js .wizard__step.is-active { display: block; }

/* sticky action bar — reads as a bar floating over the content beneath it */
.wizard__nav {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; gap: .6rem; align-items: stretch;
  margin: var(--sp-1) 0 0;
  padding: var(--sp-3) 0 calc(var(--sp-3) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, #f4f7f6 68%, rgba(244,247,246,0));
  box-shadow: 0 -6px 16px rgba(16,50,49,.05);
}
.wizard__nav .btn { flex: 1 1 auto; min-height: 54px; }
/* the ghost Back button needs a visible border so it doesn't read as disabled */
.wizard__back { flex: 0 0 auto; padding-left: 1rem; padding-right: 1rem; border-color: var(--line); }
/* without JS the Next button is inert → hide it, keep only Submit */
html:not(.js) .wizard__next { display: none; }

/* on wider screens the wizard reads fine centered; nav not full-bleed */
@media (min-width: 680px) {
  .wizard__nav { padding-bottom: 1rem; }
}

/* ---- clinic cards with expandable service details ---- */
.clinic-card {
  border: 1.5px solid var(--line); border-radius: 10px;
  margin-bottom: .6rem; background: #fff; overflow: hidden;
  transition: border-color .1s, background .1s;
}
.clinic-card:has(input:checked),
.clinic-card.is-selected { border-color: var(--brand); background: var(--brand-light); }
.clinic-card .option--clinic { border: 0; border-radius: 0; margin: 0; background: transparent; }
/* tappable hint on the right (JS only) */
.clinic-card__chev { display: none; margin-left: auto; color: var(--brand); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.js .clinic-card__chev { display: inline; }
.js .option--clinic { cursor: pointer; }
/* Phase 3 reselect: mark the case's current clinic */
.clinic-card.is-current { border-style: dashed; }
.clinic-card__cur { display: block; margin-top: .15rem; color: var(--brand); font-size: .78rem; font-weight: 600; }

/* No JS: details shown inline under each clinic. With JS: hidden (shown in the drawer). */
.clinic-details__body {
  padding: .55rem .95rem .85rem; font-size: .9rem; color: var(--ink);
  line-height: 1.6; border-top: 1px dashed var(--brand);
}
.js .clinic-details { display: none; }

/* ---- slide-in detail drawer (from the right) ---- */
.sheet { position: fixed; inset: 0; z-index: 100; }
.sheet__overlay {
  position: absolute; inset: 0; background: rgba(16,50,49,.45);
  opacity: 0; transition: opacity .3s ease;
}
.sheet__panel {
  position: absolute; top: 0; right: 0; height: 100%;
  width: min(92%, 420px);
  background: #fff; box-shadow: -8px 0 28px rgba(16,50,49,.22);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
}
.sheet.is-open .sheet__overlay { opacity: 1; }
.sheet.is-open .sheet__panel { transform: translateX(0); }
.sheet__head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: 1rem 1.1rem; padding-top: calc(1rem + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
}
.sheet__title { margin: 0; font-size: 1.12rem; color: var(--brand-dark); }
.sheet__close {
  flex: 0 0 auto; border: 0; background: transparent; cursor: pointer;
  width: 40px; height: 40px; border-radius: 8px;
  font-size: 1.7rem; line-height: 1; color: var(--muted);
}
.sheet__close:hover { background: #f1f5f4; }
.sheet__body { padding: 1.15rem 1.1rem; overflow-y: auto; flex: 1 1 auto; line-height: 1.7; }
.sheet__label { display: block; color: var(--brand-dark); font-size: .85rem; margin-bottom: .4rem; }
.sheet__details { white-space: normal; }
.sheet__foot {
  padding: .9rem 1.1rem; padding-bottom: calc(.9rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
body.sheet-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .sheet__panel, .sheet__overlay { transition: none; }
  .line-optin__btn { animation: none; }
  .faq__q::after { transition: none; }
}

/* ---- footer brand / logo ---- */
.site-footer--center { text-align: center; }
.site-footer__brand {
  display: flex; flex-direction: row; align-items: center;
  justify-content: space-between; gap: 1rem;
}
.site-footer__logo { width: 40%; max-width: 140px; height: auto; margin: 0; flex: 0 0 auto; }
/* TrueHits counter badge — a flex item in the brand row, so it stays on the
   same line as the logos/copyright instead of dropping below them. The auto
   margin parks it next to the logos (a lone badge mid-row reads as a stray). */
#truehits_div { flex: 0 0 auto; display: flex; align-items: center; line-height: 0; margin-right: auto; }
#truehits_div img { display: inline-block; }
.site-footer__brand p { font-size: .82rem; }
.site-footer__copy { text-align: right; line-height: 1.5; }
/* narrow phones: shrink copy + logo so it stays exactly 2 lines */
@media (max-width: 430px) {
  .site-footer__logo { max-width: 112px; }
  .site-footer__brand .site-footer__copy { font-size: .7rem; }
}

/* ---- mobile bottom navigation (phones only) ---- */
.bottom-nav { display: none; }
@media (max-width: 720px) {
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -2px 10px rgba(16,50,49,.06);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav__item {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px; padding: .5rem .2rem;
    color: var(--muted); font-size: .68rem; font-weight: 600; text-decoration: none;
    min-height: 56px;
  }
  .bottom-nav__item svg { opacity: .8; }
  .bottom-nav__item span { line-height: 1.1; text-align: center; }
  .bottom-nav__item:hover, .bottom-nav__item:focus { text-decoration: none; color: var(--brand); }
  .bottom-nav__item.is-active { color: var(--brand); }
  .bottom-nav__item.is-active svg { opacity: 1; }
  /* keep content clear of the fixed bar */
  body.has-bottom-nav { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
}

/* ---- clickable home poster → register ---- */
.home-poster { display: block; margin: var(--sp-5) 0 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.home-poster img { width: 100%; height: auto; display: block; }
.home-poster:active { transform: scale(.995); }
