:root {
  --bg: #ffffff;
  --ink: #000000;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --accent: #2246f2;
  --accent-ink: #ffffff;
  --accent-soft: #eef1ff;
  --danger: #c8102e;
  --radius: 8px;
  --font: "Instrument Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 20px; }

/* ---------- landing ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0 10px; }
.brand { font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.nav small { color: var(--muted); }

.hero { padding: 48px 0 20px; }
h1 {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 20px;
  max-width: 11ch;
}
.lede { font-size: 1.25rem; margin: 0 0 28px; max-width: 32ch; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: var(--radius);
  padding: 14px 22px; font-weight: 600; font-size: 1.05rem;
  text-decoration: none; cursor: pointer;
  transition: transform 120ms var(--ease), background 120ms;
}
.btn:hover { background: #1a39c9; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.ghost:hover { background: #f4f4f4; }

.section { padding: 26px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: 1.05rem; margin: 0 0 12px; letter-spacing: -0.01em; }
.plain { margin: 0; padding-left: 1.2em; }
.plain li { margin: 6px 0; }
.plain li::marker { color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 10px; margin: 12px 0; }
.steps li::before {
  content: counter(s); font-weight: 700; color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: 50%;
  width: 26px; height: 26px; display: grid; place-items: center; font-size: 0.85rem; margin-top: 2px;
}
.steps b { display: block; }
.steps span { color: var(--muted); }

.rule { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; }
.rule b { display: block; margin-bottom: 2px; }

.foot { padding: 30px 0 40px; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }

/* ---------- survey ---------- */
.survey-body { min-height: 100dvh; display: flex; flex-direction: column; }

.pricebar {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.pricebar-inner {
  max-width: 720px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.pricebar-inner .brand { text-decoration: none; }
.price-main { display: flex; align-items: baseline; gap: 6px; }
.price-total { font-weight: 700; font-size: 1.35rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price-total.bump { animation: bump 260ms var(--ease); }
@keyframes bump { 40% { transform: scale(1.12); } }
.price-note { color: var(--muted); font-size: 0.92rem; }
.progress { height: 3px; background: var(--line); }
.progress > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 320ms var(--ease); }

.stage-wrap { flex: 1; display: flex; align-items: center; }
.stage { max-width: 720px; width: 100%; margin: 0 auto; padding: 40px 20px 60px; position: relative; overflow: hidden; }

.q { max-width: 560px; }
.q.enter-fwd { animation: in-up 380ms var(--ease) both; }
.q.enter-back { animation: in-down 380ms var(--ease) both; }
.q.leave-fwd { animation: out-up 220ms var(--ease) both; position: absolute; inset: 40px 20px auto; pointer-events: none; }
.q.leave-back { animation: out-down 220ms var(--ease) both; position: absolute; inset: 40px 20px auto; pointer-events: none; }
@keyframes in-up { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes in-down { from { opacity: 0; transform: translateY(-28px); } to { opacity: 1; transform: none; } }
@keyframes out-up { to { opacity: 0; transform: translateY(-28px); } }
@keyframes out-down { to { opacity: 0; transform: translateY(28px); } }

.q-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.q-num { color: var(--accent); font-weight: 600; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.q-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
  font-size: 1.15rem; line-height: 1; cursor: pointer;
  transition: border-color 120ms, background 120ms, transform 120ms var(--ease);
}
.q-arrow:hover { border-color: var(--accent); background: var(--accent-soft); }
.q-arrow:active { transform: translateY(1px); }
.q-arrow[disabled] { opacity: 0.4; cursor: not-allowed; }
.q-arrow[disabled]:hover { border-color: var(--line); background: var(--bg); }
.q h2 { font-size: clamp(1.5rem, 4.5vw, 2rem); line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 8px; font-weight: 600; }
.q .help { color: var(--muted); margin: 0 0 22px; }

.field {
  width: 100%; border: 0; border-bottom: 2px solid var(--line); border-radius: 0;
  padding: 10px 0; font-size: 1.35rem; background: transparent; color: var(--ink);
  transition: border-color 160ms;
}
.field:focus { outline: none; border-bottom-color: var(--accent); }
.field::placeholder { color: #b5b5b5; }
textarea.field { font-size: 1.15rem; line-height: 1.5; min-height: 150px; resize: vertical; }

.err { color: var(--danger); font-size: 0.95rem; min-height: 1.4em; margin: 8px 0 0; }
.actions { display: flex; align-items: center; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.actions .hint { color: var(--muted); font-size: 0.9rem; }
.actions .hint kbd { font-family: inherit; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; }

.addons { display: grid; gap: 10px; margin-top: 4px; }
.addon {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: start;
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.addon:hover { border-color: #bdbdbd; }
.addon input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.addon:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.addon b { display: block; }
.addon small { color: var(--muted); display: block; }
.addon .price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cap-note { margin-top: 14px; padding: 10px 14px; border-radius: var(--radius); background: var(--accent-soft); font-size: 0.95rem; }
.cap-note[hidden] { display: none; }

.review { display: grid; gap: 0; border-top: 1px solid var(--line); margin-top: 10px; }
.review-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.review-row .k { color: var(--muted); }
.review-row .v { white-space: pre-wrap; word-break: break-word; }
.review-row .edit { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; }
@media (max-width: 480px) { .review-row { grid-template-columns: 1fr auto; } .review-row .k { grid-column: 1 / -1; font-size: 0.85rem; } }

.estimate { margin-top: 22px; padding: 16px; border-radius: var(--radius); background: var(--accent-soft); }
.estimate b { font-size: 1.15rem; display: block; }
.estimate p { margin: 6px 0 0; color: #333; }
.estimate .fine { color: var(--muted); font-size: 0.9rem; }

.terms { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; }
.terms input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--accent); }

.totals { margin-top: 18px; display: grid; gap: 4px; }
.totals div { display: flex; justify-content: space-between; }
.totals .big { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }

/* ---------- success ---------- */
.status { padding: 60px 0; }
.status h1 { max-width: 16ch; }
.status .card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 20px 0; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; display: inline-block; vertical-align: -4px; margin-right: 8px; animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
