/* Shared look for every survey in this folder. A survey can override the colour tokens in its own page. */
:root { color-scheme: light; box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; padding: 0; }
[hidden]:not([hidden=until-found i]) { display: none !important; }

/* Layout: one question per screen, centered column, progress rail pinned to the top edge, Back/Next under each question */
:root {
  --bg: #F4F7FC; --surface: #FFFFFF; --ink: #14213A; --muted: #5A6782; --line: #D8E0EE;
  --accent: #2F74F5; --accent-ink: #FFFFFF; --accent-soft: #E7EFFF; --accent-glow: rgba(47,116,245,.22); --mark: #F2A93B;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1); --bounce: cubic-bezier(.34,1.56,.64,1);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0D1422; --surface: #151F31; --ink: #E7EDF8; --muted: #98A6C0; --line: #27344D;
  --accent: #6CA3FF; --accent-ink: #071A3D; --accent-soft: #19294A; --accent-glow: rgba(108,163,255,.25); --mark: #F5B654; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0D1422; --surface: #151F31; --ink: #E7EDF8; --muted: #98A6C0; --line: #27344D;
  --accent: #6CA3FF; --accent-ink: #071A3D; --accent-soft: #19294A; --accent-glow: rgba(108,163,255,.25); --mark: #F5B654; color-scheme: dark }

html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 17px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }

.rail { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 5; display: flex; gap: 4px; box-sizing: border-box; max-width: 712px; margin: 0 auto; padding: 0 16px; background: var(--bg); }
.rail button { flex: 1; min-width: 0; height: 28px; padding: 11px 0 12px; border: 0; background: none; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.rail button[disabled] { cursor: default; }
.rail button:focus-visible { outline: 2px solid var(--mark); outline-offset: -2px; border-radius: 6px; }
.rail i { display: block; height: 5px; border-radius: 999px; background: var(--line); transition: background .3s, opacity .3s; }
.rail i.seen { background: var(--accent); opacity: .3; }
.rail i.on { background: var(--accent); opacity: 1; }
@media (hover: hover) { .rail button:not([disabled]):hover i { background: var(--accent); opacity: .7; } }

.app { min-height: 100%; display: grid; grid-template-rows: auto 1fr;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 34px 0; max-width: 680px; width: 100%; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 15px/1 var(--display); letter-spacing: .01em; }
.brand svg { width: 22px; height: 22px; flex: none; }
.count { font: 600 13px/1 var(--body); color: var(--muted); font-variant-numeric: tabular-nums; }

.stage { display: grid; align-items: center; max-width: 680px; width: 100%; margin: 0 auto; padding-block: 28px 40px; min-width: 0; }
.screen { display: grid; gap: 22px; min-width: 0; animation: enter .55s var(--ease) both; }
.screen.back { animation-name: enterBack; }
.screen.leaving { animation: leave .22s ease-in both; }
@keyframes enter { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes enterBack { from { opacity: 0; transform: translateY(-28px); } to { opacity: 1; transform: none; } }
@keyframes leave { to { opacity: 0; transform: translateY(-14px); } }

.eyebrow { display: flex; align-items: center; gap: 10px; font: 600 15px/1.3 var(--body); color: var(--accent); }
.eyebrow b { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; }
h2:focus { outline: none; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.015em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(32px, 6vw, 46px); line-height: 1.06; }
h2 { font-size: clamp(24px, 4.4vw, 32px); line-height: 1.15; }
.outline { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 18px; }
.outline li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.outline li::before { content: "✓"; color: var(--accent); font-weight: 700; }
.lede { margin: 0; color: var(--muted); max-width: 56ch; }
.help { margin: -10px 0 0; color: var(--muted); font-size: 15px; transition: color .2s; }
.help.warn { color: var(--mark); }

.opts { display: grid; gap: 10px; }
.opt, .btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.opt { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 15px 18px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink);
  font: 500 16px/1.35 var(--body); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .2s, transform .2s var(--bounce); }
/* Hover only on real pointers: on a phone it would stick to the last option tapped. */
@media (hover: hover) {
  .opt:hover { border-color: var(--accent); transform: translateY(-1px); }
  .btn:not([disabled]):hover { transform: translateY(-2px); }
  .back-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
}
.opt:active { transform: scale(.985); }
.opt:focus-visible, .btn:focus-visible, .back-link:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 6px 18px -8px var(--accent-glow); }
.mark { display: grid; place-items: center; width: 22px; height: 22px; box-sizing: border-box; border: 2px solid var(--line); color: var(--accent-ink); transition: background .15s, border-color .15s, transform .2s var(--bounce); }
.mark.box { border-radius: 7px; }
.mark.dot { border-radius: 50%; }
.mark svg { width: 14px; height: 14px; opacity: 0; transform: scale(.4); transition: opacity .15s, transform .2s var(--bounce); }
.opt[aria-pressed="true"] .mark { background: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.opt[aria-pressed="true"] .mark svg { opacity: 1; transform: none; }
.detail { margin-top: 2px; animation: enter .3s var(--ease) both; }

input[type="text"], input[type="email"], textarea { width: 100%; padding: 14px 18px; border: 2px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--ink); font: 400 17px/1.4 var(--body); transition: border-color .15s, box-shadow .2s; box-sizing: border-box; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); outline: none; }
textarea { min-height: 120px; resize: vertical; }
.fields { display: grid; gap: 14px; }
.fields label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.check { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 500; color: var(--ink); cursor: pointer; padding: 6px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.btn:only-child { margin-left: auto; }
.screen > .start .btn { margin-left: 0; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 15px 26px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font: 600 16px/1 var(--body); cursor: pointer; box-shadow: 0 8px 20px -10px var(--accent-glow); transition: transform .2s var(--bounce), opacity .2s; }
.btn[disabled] { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.back-link { padding: 12px 12px 12px 0; border: 0; background: none; color: var(--muted); font: 500 15px/1 var(--body); cursor: pointer; touch-action: manipulation; }
.fine { font-size: 13px; color: var(--muted); margin: 0; }

.wins { display: grid; gap: 12px; counter-reset: w; }
.win { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line);
  animation: enter .55s var(--ease) both; }
.win:nth-child(2) { animation-delay: .12s; } .win:nth-child(3) { animation-delay: .24s; }
.win::before { counter-increment: w; content: counter(w); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font: 700 14px/1 var(--body); }
.win h3 { margin: 3px 0 4px; font: 600 17px/1.3 var(--body); }
.win p { margin: 0; color: var(--muted); font-size: 15px; }
.next { padding: 18px 20px; border-radius: 16px; background: var(--accent-soft); display: grid; gap: 6px; }
.next h3 { margin: 0; font: 600 16px/1.3 var(--body); }
.next p { margin: 0; color: var(--muted); font-size: 15px; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .opt { padding: 13px 14px; gap: 12px; }
  /* Long option lists keep Next in reach. */
  .actions { position: sticky; bottom: 0; z-index: 2; padding-block: 20px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to bottom, transparent, var(--bg) 22px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
