:root {
  --navy: #051e40;
  --navy-2: #16345b;
  --slate: #526479;
  --line: #c9d4df;
  --paper: #f4f6f8;
  --wash: #e7eef4;
  --white: #ffffff;
  --focus: #0f9ed5;
  --danger: #7a2430;
  --danger-bg: #fdecee;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Aptos, "Segoe UI", system-ui, sans-serif;
  --pad: 20px;
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: #d7e2ec;
  color: var(--navy);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

.app {
  width: min(440px, 100%);
  height: 100dvh;
  margin: 0 auto;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.top {
  background: var(--navy);
  padding: 14px var(--pad) 12px;
  text-align: center;
}

.top img {
  display: block;
  height: 64px;
  width: auto;
  max-width: min(320px, 86%);
  margin: 0 auto;
}

.progress {
  padding: 14px var(--pad) 0;
}

.progress[hidden] { display: none; }

.kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}

.track {
  height: 6px;
  background: var(--wash);
  border-radius: 99px;
  overflow: hidden;
}

.fill {
  height: 100%;
  width: 0;
  background: var(--navy);
  border-radius: inherit;
}

.stage {
  flex: 1;
  overflow: auto;
  padding: 18px var(--pad) 28px;
}

.stage h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.stage h1:focus { outline: none; }

.lede {
  margin: 0 0 18px;
  color: var(--slate);
}

.group-label {
  margin: 18px 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}

.group-label:first-child { margin-top: 0; }

.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 14px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  min-height: 56px;
}

.choice-copy { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.choice-title { font-weight: 600; }

.choice-hint { color: var(--slate); font-size: 0.92rem; }

.tick {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid var(--navy);
  border-radius: 6px;
  background: var(--white);
}

.choice[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.choice[aria-pressed="true"] .choice-hint { color: #d5e2ef; }

.choice[aria-pressed="true"] .tick {
  background: var(--white);
  border-color: var(--white);
}

.choice[aria-pressed="true"] .tick::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  margin: 3px auto 0;
  border: solid var(--navy);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.choice.radio .tick { border-radius: 50%; }

.choice.radio[aria-pressed="true"] .tick::after {
  width: 10px;
  height: 10px;
  margin: 4px auto 0;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  transform: none;
}

.choice.quiet {
  background: var(--paper);
}

.steps {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.steps span {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: grid;
  place-items: center;
  font-family: var(--serif);
}

.field { display: block; margin-top: 14px; }

.field span,
.field-legend {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.select-wrap { position: relative; }

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

select, textarea, input[type="text"], input[type="tel"], input[type="email"] {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1.0625rem;
}

select {
  appearance: none;
  min-height: 56px;
  padding-right: 44px;
}

textarea { min-height: 120px; resize: vertical; }

.reveal { margin-top: 10px; }

.pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.panel {
  margin-top: 18px;
  padding-top: 6px;
}

.note {
  margin: 18px 0 0;
  color: var(--slate);
  font-size: 0.92rem;
}

.imprint {
  margin: 22px 0 8px;
  color: var(--slate);
  font-size: 0.78rem;
}

.dock {
  flex: none;
  padding: 10px var(--pad) calc(12px + env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--line);
}

.dock[hidden] { display: none; }

.alert {
  margin: 0 0 10px;
  padding: 10px 12px;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 10px;
  font-size: 0.95rem;
}

.alert[hidden] { display: none; }

.actions {
  display: grid;
  grid-template-columns: 0.7fr 1.4fr;
  gap: 10px;
}

.actions.single { grid-template-columns: 1fr; }

.btn {
  min-height: 56px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  padding: 12px 16px;
  font-weight: 700;
}

.btn-primary { background: var(--navy); color: var(--white); }

.btn-ghost {
  background: var(--white);
  color: var(--navy);
  border-color: var(--line);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (min-width: 760px) {
  body { padding: 24px 0; }

  .app {
    height: calc(100dvh - 48px);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 16px 50px rgba(5, 30, 64, 0.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
