/* Quiz A: the Coursiv shell. Measurements taken from coursiv.io/dynamic (390 px viewport).
   Neutral palette, one accent: gold #dec085 for fills only. Gold as text uses #8a6a1f (5.05:1 on white). */
:root {
  --bg: #fff;
  --ink: #100018;
  --muted: #565b66;
  --card: #f3f5f6;
  --card-border: #ececec;
  --track: #ececec;
  --gold: #dec085;
  --gold-text: #8a6a1f;
  --gold-soft: #fbf6ec;
  --footer: #8a8f98;
  --consent-h: 0px;
  --consent-bg: #100018;
  --consent-accept-bg: #dec085;
  --consent-accept-fg: #100018;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.resuming #app { visibility: hidden; }

.shell { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); padding-top: env(safe-area-inset-top); }
/* Three columns, side columns equal (1fr), so the logo in the middle stays centered
   in the bar no matter whether the back arrow or the counter is showing. */
.bar { height: 48px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px; gap: 4px; }
.back {
  width: 32px; height: 32px; margin-left: -6px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; justify-self: start; visibility: hidden;
}
.back svg { width: 22px; height: 22px; }
.has-back .back { visibility: visible; }
.logo-wrap { justify-self: center; }
.logo { display: block; width: 30px; height: 28px; }
.count { justify-self: end; font-size: 14px; font-weight: 700; visibility: hidden; }
.count b { color: var(--gold-text); }
.progress { height: 4px; margin: 0 16px; border-radius: 2px; background: var(--track); overflow: hidden; visibility: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 2px; transition: width .35s ease; }
.has-progress .count, .has-progress .progress { visibility: visible; }

/* ---------- screens ---------- */
main { flex: 1; }
.screen { padding: 24px 16px 24px; animation: in .22s ease both; }
/* Room for the fixed .cta-wrap bar (Hits and multi-select questions), so it never covers content. */
.shell.cta-on .screen { padding-bottom: calc(88px + env(safe-area-inset-bottom) + var(--consent-h)); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } .progress i { transition: none; } }

.q-title { margin: 0; font-size: 24px; line-height: 36px; font-weight: 700; text-align: center; }
.q-sub { margin: 8px 0 0; color: var(--muted); font-weight: 500; text-align: center; }

/* ---------- option cards ---------- */
.options { display: grid; gap: 12px; margin-top: 24px; }
.opt {
  width: 100%; min-height: 80px; padding: 16px; display: flex; align-items: center; gap: 16px;
  text-align: left; font-weight: 700; line-height: 24px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 8px; cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.opt:active { transform: scale(.985); }
.opt .emo { flex: none; width: 44px; font-size: 32px; line-height: 1; text-align: center; font-weight: 400; }
.opt .txt { flex: 1; }
.opt.multi { min-height: 64px; padding-top: 12px; padding-bottom: 12px; }
.opt .check {
  flex: none; width: 24px; height: 24px; border-radius: 6px; border: 2px solid #c3c8cf; background: #fff;
  display: grid; place-items: center; transition: background-color .15s, border-color .15s;
}
.opt.selected .check { background: var(--gold); border-color: var(--gold); }
.opt.selected .check::after { content: ""; width: 10px; height: 6px; border: solid #000; border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg); }
.opt.full { justify-content: center; text-align: center; padding: 24px 16px; }
.options.full { gap: 16px; }
.opt.selected { background: var(--gold-soft); border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
@media (hover: hover) { .opt:hover { border-color: var(--gold); } }
.opt:focus-visible, .cta:focus-visible, .entry-card:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 2px; }

/* entry: Coursiv's two picture cards, with an emoji in place of the picture */
.entry-head { margin: 16px 0 0; font-size: 28px; line-height: 36px; font-weight: 800; text-align: center; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.entry-card {
  padding: 0; border: 2px solid var(--gold); border-radius: 12px; overflow: hidden; background: var(--card);
  display: flex; flex-direction: column; cursor: pointer; text-align: center;
  transition: transform .1s, box-shadow .15s;
}
.entry-card:active { transform: scale(.985); }
.entry-card .pic { height: 120px; display: grid; place-items: center; font-size: 56px; line-height: 1; }
.entry-card .lbl {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 10px;
  background: var(--gold); color: #000; font-weight: 700; font-size: 16px; line-height: 22px;
}
.entry-card .lbl svg { flex: none; width: 16px; height: 16px; }
.entry-card.selected { box-shadow: 0 0 0 3px var(--gold-soft), 0 0 0 5px var(--gold); }

/* ---------- interstitials ---------- */
.proof-big { margin: 0; font-size: 26px; line-height: 34px; font-weight: 800; text-align: center; color: var(--gold-text); }
.photo-card { position: relative; margin: 16px auto 0; width: 100%; max-width: 400px; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #e9e4dc; }
.photo-card picture { display: block; height: 100%; }
.photo-card img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.photo-card::after { content: ""; position: absolute; inset: auto 0 0 0; height: 38%; background: linear-gradient(to bottom, rgba(255,255,255,0), var(--bg)); }
.hit-body { margin: 14px 0 0; color: var(--muted); font-size: 16px; line-height: 24px; }
.hit-small { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.center { text-align: center; }
.tp { width: 112px; height: auto; margin: 14px auto 0; }

.hit-title { margin: 8px 0 0; font-size: 24px; line-height: 32px; font-weight: 800; }
.hit-row { display: flex; gap: 16px; align-items: flex-start; margin-top: 20px; }
.hit-row picture { flex: none; }
.hit-row img { flex: none; width: 112px; height: 140px; object-fit: cover; border-radius: 12px; background: #e9e4dc; }
.hit-row .hit-body { margin: 0; }
.good-news { margin: 20px 0 0; padding: 14px 16px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-text); font-weight: 700; line-height: 22px; }
.legal-line.entry-legal { margin-top: 28px; }
.loader-title { font-size: 22px; line-height: 30px; }
.screen[data-screen="loader"] .q-sub { margin-bottom: 16px; }
.rule { width: 48px; height: 4px; border-radius: 2px; background: var(--gold); margin: 8px 0 20px; }

/* ---------- fixed button ---------- */
.cta-wrap {
  position: fixed; left: 0; right: 0; bottom: var(--consent-h); z-index: 20;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--bg) 28%);
}
.cta {
  display: flex; align-items: center; justify-content: center; width: 100%; max-width: 448px; height: 56px; margin: 0 auto;
  border: 0; border-radius: 8px; background: var(--gold); color: #000; cursor: pointer;
  font-size: 16px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.cta:active { transform: scale(.99); }
.cta[disabled] { opacity: .6; cursor: default; }
/* In-flow Hit button (spec: Continue sits after the content, like Coursiv). Side margins match
   .screen's own padding since this button renders as a sibling of .screen, not inside it. */
.cta-static { width: calc(100% - 32px); margin: 24px 16px calc(24px + env(safe-area-inset-bottom)); }

/* ---------- loader ---------- */
.ring { position: relative; width: 128px; height: 128px; margin: 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--track); }
.ring .fill { stroke: var(--gold); stroke-linecap: round; }
.ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; font-weight: 800; }
.steps { list-style: none; margin: 16px auto 0; padding: 0; max-width: 320px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: #9aa0a8; font-weight: 600; transition: color .3s; }
.steps li.active, .steps li.done { color: var(--ink); }
.steps .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--track); display: grid; place-items: center; }
.steps li.active .dot { border-color: var(--gold); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps li.done .dot { border-color: var(--gold); background: var(--gold); }
.steps li.done .dot::after { content: ""; width: 9px; height: 5px; border: solid #000; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
@keyframes spin { to { transform: rotate(360deg); } }
.quotes { position: relative; margin: 16px 0 0; min-height: 138px; }
.quote {
  position: absolute; inset: 0 0 auto 0; margin: 0; padding: 16px; border-radius: 12px; background: var(--bg);
  border: 1px solid var(--card-border); box-shadow: 0 4px 16px rgba(16, 0, 24, .06);
  opacity: 0; transition: opacity .6s ease;
}
.quote.on { opacity: 1; }
.quote p { margin: 0; font-size: 15px; line-height: 22px; }
.quote footer { margin-top: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- gate ---------- */
.gate-form { margin-top: 24px; display: grid; gap: 12px; }
.field {
  width: 100%; height: 56px; padding: 0 16px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--card); border: 1px solid var(--card-border); border-radius: 8px; outline: none;
}
.field:focus { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: #fff; }
.field.bad { border-color: #c0392b; }
.err { margin: -4px 0 0; min-height: 0; color: #b3261e; font-size: 14px; }
.err:empty { display: none; }
.lock { display: flex; gap: 8px; align-items: flex-start; margin: 0; color: var(--muted); font-size: 13px; line-height: 18px; }
.lock svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.gate-form .cta { margin-top: 4px; max-width: none; }
.legal-line { margin: 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 18px; }
.legal-line a { color: inherit; }

/* ---------- footer ---------- */
/* Spec 8.6: entry screen and the bottom of the results page only. Hidden everywhere else
   (Hits, questions, loader, gate), toggled by app.js via .has-footer on .shell. */
.site-footer { display: none; margin-top: auto; }
.shell.has-footer .site-footer { display: block; }

/* ---------- results (spec 6) ---------- */
.results { padding-bottom: 32px; }
.res-head { margin: 8px 0 0; font-size: 26px; line-height: 34px; font-weight: 700; }
.res-head strong { font-weight: 800; }
.res-sit { margin: 8px 0 0; color: var(--muted); font-size: 17px; font-weight: 600; }

.gauge { margin: 20px 0 0; padding: 16px; border: 1px solid var(--card-border); border-radius: 12px; background: var(--card); }
.gauge-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--gold-text); }
.gauge-word { margin-top: 4px; font-size: 22px; line-height: 28px; font-weight: 800; }
.gauge-bar { height: 6px; margin: 10px 0 0; border-radius: 3px; background: var(--track); overflow: hidden; }
.gauge-bar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; transform-origin: left; animation: grow .9s ease-out both .2s; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.gauge-copy { margin: 10px 0 0; font-size: 15px; line-height: 22px; }

.diag { margin-top: 24px; }
.diag p, .why p, .qual p { margin: 0 0 14px; font-size: 17px; line-height: 27px; }
.why { margin-top: 12px; padding-top: 20px; border-top: 1px solid var(--card-border); }
.why h2, .qual h2 { margin: 0 0 10px; font-size: 20px; line-height: 27px; font-weight: 800; }
.why-close { font-weight: 800; }
.duration { margin: 24px 0 0; font-size: 17px; line-height: 26px; }
.cost { margin: 12px 0 0; padding: 16px; border-left: 4px solid var(--gold); background: var(--gold-soft); border-radius: 0 10px 10px 0; font-size: 17px; line-height: 26px; font-weight: 700; }

.qual { margin-top: 28px; padding: 20px 14px; border: 2px solid var(--gold); border-radius: 14px; }
.qual-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--gold-text); margin-bottom: 12px; }
.qual-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.qual-head picture { flex: none; }
.qual-head img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; background: #e9e4dc; }
.qual-head h2 { margin: 0; }
.qual .cta { max-width: none; }
.cta.wa { gap: 8px; height: auto; min-height: 56px; padding: 8px 10px; text-decoration: none; font-size: 13px; line-height: 18px; letter-spacing: 0; text-align: center; }
.screen.still { animation: none; }
.cta.wa svg { width: 22px; height: 22px; flex: none; }
.wa-row { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.wa-row .cta { flex: 1; }
.qr { display: none; }
.qr.on { display: block; flex: none; width: 132px; margin: 0; text-align: center; }
.qr-code { width: 120px; height: 120px; margin: 0 auto; padding: 6px; background: #fff; border: 1px solid var(--card-border); border-radius: 8px; }
.qr-code svg { display: block; width: 100%; height: 100%; }
.qr figcaption { margin-top: 6px; font-size: 11px; line-height: 14px; color: var(--muted); }
.wa-row { align-items: flex-start; }
.qual-under { margin: 12px 0 0 !important; color: var(--muted); font-size: 14px !important; line-height: 20px !important; text-align: center; }
.qual .options.ready { margin-top: 8px; }
.proof { margin: 20px 0 0; text-align: center; font-weight: 700; font-size: 14px; }
.small-print { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
