:root {
  --bg: #F7F4EC; --surface: #FFFFFF; --ink: #1F3632; --muted: #5D6D69;
  --line: #E3DDD0; --line-strong: #C9C1B0;
  --accent: #007019; --accent-ink: #FFFFFF; --accent-soft: #E4EFE3;
  --danger: #A23B2C; --danger-soft: #F8E7E3;
  --display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --r: 12px; --gutter: max(16px, env(safe-area-inset-left, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12201D; --surface: #1A2B28; --ink: #E6EEE9; --muted: #9FB2AC;
    --line: #2B3F3B; --line-strong: #3E5650;
    --accent: #53C26A; --accent-ink: #0D1916; --accent-soft: #1E3A2B;
    --danger: #F08E7C; --danger-soft: #3A2420; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--body); min-height: 100dvh;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Header + progress rail */
.bar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.bar-in { max-width: 720px; margin: 0 auto; padding: 12px var(--gutter) 8px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { font: 600 14px var(--display); letter-spacing: 0.02em; }
.brand .x { color: var(--muted); font-weight: 500; }
.save { font-size: 12px; color: var(--muted); }
.rail { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter) 10px; display: flex; gap: 6px; }
.rail span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .25s; }
.rail span.done { background: var(--accent); }
.rail span.on { background: color-mix(in srgb, var(--accent) 55%, var(--line)); }

/* Layout */
.wrap { max-width: 720px; margin: 0 auto; padding: 28px var(--gutter) 24px; display: flex; flex-direction: column; gap: 18px; outline: none; }
.eyebrow { font: 600 12px var(--display); text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); }
.lede { color: var(--muted); margin: 0; }
.sec-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.sec-head h1 { font-size: clamp(26px, 6vw, 34px); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }

/* Intro */
.hero { display: flex; flex-direction: column; gap: 14px; }
.hero h1 { font-size: clamp(32px, 8vw, 46px); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 4px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.facts b { display: block; font: 600 18px var(--display); }
.facts small { color: var(--muted); font-size: 13px; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; } }

/* Questions */
.q { display: flex; flex-direction: column; gap: 10px; border: 0; margin: 0; padding: 0 0 8px; min-width: 0; }
.q + .q { padding-top: 22px; border-top: 1px solid var(--line); }
.q-label { font-weight: 600; font-size: 16px; display: flex; gap: 10px; padding: 0; }
legend.q-label { float: left; width: 100%; margin-bottom: 10px; }
legend.q-label + * { clear: both; }
.q-n { font: 600 13px var(--display); color: var(--muted); min-width: 24px; padding-top: 2px; }
.opt { font-weight: 400; color: var(--muted); font-size: 13px; }
.help { color: var(--muted); font-size: 14px; margin: -4px 0 0 34px; }
.field { margin-left: 34px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 480px) { .field, .help { margin-left: 0; } }

input[type=text], input[type=email], input[type=number], textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 12px 14px; min-height: 48px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 104px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 48px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer;
  transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--ink); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .mark { flex: none; width: 20px; height: 20px; border: 2px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; }
.choice.cb .mark { border-radius: 5px; }
.choice input:checked ~ .mark { border-color: var(--accent); background: var(--accent); }
.choice input:checked ~ .mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-ink); }
.choice.cb input:checked ~ .mark::after { width: 10px; height: 6px; border-radius: 0; background: none;
  border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale label { position: relative; }
.scale input { position: absolute; opacity: 0; }
.scale span { display: grid; place-items: center; height: 48px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); font: 600 17px var(--display); cursor: pointer; transition: all .15s; }
.scale label:hover span { border-color: var(--ink); }
.scale input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.scale input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.scale-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.err { color: var(--danger); font-size: 14px; font-weight: 500; }
.q.invalid input[type=text], .q.invalid input[type=email], .q.invalid input[type=number], .q.invalid textarea,
.q.invalid .choice, .q.invalid .scale span { border-color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Review */
.review dl { margin: 0; display: grid; gap: 14px; }
.review dt { font-size: 13px; color: var(--muted); }
.review dd { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review .edit { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px 0; }
.review h2 { font-size: 18px; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }

/* Footer nav */
.nav { position: fixed; inset: auto 0 0 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px); }
.nav-in { max-width: 720px; margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.step-count { font-size: 13px; color: var(--muted); }
.btn { border: 1px solid transparent; border-radius: 999px; padding: 12px 22px; min-height: 48px; font-weight: 600; cursor: pointer; transition: transform .1s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn.ghost { background: transparent; border-color: var(--line-strong); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn.big { align-self: flex-start; padding: 14px 28px; font-size: 17px; }

/* Done */
.done { text-align: left; display: flex; flex-direction: column; gap: 14px; }
.tick { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; }
.tick svg { width: 28px; height: 28px; stroke: var(--accent-ink); }
.banner { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 12px 14px; font-weight: 500; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
