:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #161616;
  --muted: #6b6a66;
  --line: #dcdad4;
  --accent: #161616;
  --accent-text: #ffffff;
  --error: #b3261e;
  --focus: #3d5afe;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1b1b1b;
    --text: #f1f0ec;
    --muted: #9a9993;
    --line: #2f2f2d;
    --accent: #f1f0ec;
    --accent-text: #121212;
    --error: #ff8a80;
    --focus: #8c9eff;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 16px 80px;
}

.brand {
  margin: 0 0 40px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 7vw, 44px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -.02em;
}

.lead { margin: 12px 0 0; color: var(--muted); }

.form { margin-top: 48px; }

.step {
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.step h2 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
}

.num {
  display: inline-block;
  min-width: 2.2em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.choices { display: grid; gap: 10px; }

@media (min-width: 600px) {
  .choices { grid-template-columns: repeat(3, 1fr); }
}

.choice { position: relative; cursor: pointer; }

.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }

.choice-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}

.choice-body small { color: var(--muted); font-size: 13px; line-height: 1.4; }

.choice:hover .choice-body { border-color: var(--muted); }

.choice input:checked + .choice-body {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}

.choice input:focus-visible + .choice-body { outline: 2px solid var(--focus); outline-offset: 2px; }

fieldset { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }

legend, .field label {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
}

.pills { display: flex; flex-wrap: wrap; gap: 8px; }

.pills label { position: relative; cursor: pointer; }

.pills input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }

.pills span {
  display: inline-block;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  transition: background .15s, color .15s, border-color .15s;
}

.pills label:hover span { border-color: var(--muted); }

.pills input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.pills input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.row { display: grid; gap: 0 16px; }

@media (min-width: 600px) {
  .row { grid-template-columns: 1fr 1fr; }
}

.field { margin-bottom: 20px; min-width: 0; }

.req { color: var(--muted); font-weight: 400; }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 16px;
  transition: border-color .15s;
}

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

select {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }

input:hover, select:hover, textarea:hover { border-color: var(--muted); }

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text); }

input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }

[aria-invalid="true"] { border-color: var(--error) !important; }

.error { margin: 6px 0 0; color: var(--error); font-size: 13px; }

.error:empty { display: none; }

.hint { margin: -4px 0 0; color: var(--muted); font-size: 13px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.actions {
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.submit {
  width: 100%;
  padding: 16px 24px;
  background: var(--accent);
  color: var(--accent-text);
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}

@media (min-width: 600px) {
  .submit { width: auto; min-width: 220px; }
}

.submit:hover { opacity: .88; }

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

.submit[disabled] { opacity: .5; cursor: progress; }

.status { margin: 14px 0 0; font-size: 14px; color: var(--muted); }

.status.is-error { color: var(--error); }

.done {
  margin-top: 48px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.done:focus { outline: none; }

.done h2 { margin: 0 0 8px; font-size: 24px; font-weight: 600; }

.done p { margin: 0; color: var(--muted); }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
