/* Onboarding flow: one question per step, inside a single centered card. Tokens come from styles.css. */

.ob-body { min-height: 100vh; min-height: 100dvh; }

.ob-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  /* Anchored near the top (not centered) so the card doesn't jump when its height changes between steps. */
  padding: clamp(24px, 9vh, 96px) var(--gutter) calc(32px + env(safe-area-inset-bottom));
}

.ob-exit {
  display: inline-flex; align-items: center; gap: 4px;
  align-self: center; width: min(600px, 100%);
  margin-bottom: 14px; font-size: 14px; color: var(--muted); text-decoration: none;
}
.ob-exit:hover { color: var(--ink); }
.ob-exit svg, .ob-private svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- The card ---------- */
.ob-card {
  width: min(600px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 32px 28px;
  box-shadow: 0 1px 2px rgba(21, 25, 27, .04), 0 24px 60px -24px rgba(14, 26, 120, .22);
}

.ob-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ob-logo { font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.ob-logo span { color: var(--accent); }
.ob-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Segmented progress bar */
.ob-segs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 18px 0 30px; }
.ob-segs span { position: relative; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.ob-segs span::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .55s cubic-bezier(.34, 1.25, .64, 1);
}
.ob-segs span.is-on::after { transform: scaleX(1); }

.ob-stage { position: relative; }
.ob-step { padding: 0; margin: 0; max-width: none; } /* override the site-wide section spacing */

/* ---------- Question ---------- */
.ob-q {
  margin: 0; font-size: clamp(22px, 3vw, 26px); line-height: 1.2;
  letter-spacing: -0.025em; font-weight: 600; outline: none;
}
.ob-hint { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.ob-form { margin-top: 24px; }

/* ---------- Option cards ---------- */
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.opts--list { grid-template-columns: 1fr; gap: 10px; }

.opt {
  position: relative; display: block;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 16px 16px 16px; cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .2s, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt__icon {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
  background: var(--accent-wash); color: var(--accent-ink); margin-bottom: 14px;
  transition: background-color .2s, color .2s;
}
.opt__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.opt__title { display: block; font-weight: 600; font-size: 15.5px; letter-spacing: -0.01em; line-height: 1.3; padding-right: 26px; }
.opt__desc { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }

/* Radio circle, top right */
.opt__radio {
  position: absolute; top: 16px; right: 16px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid #c9cfcc; background: #fff;
  transition: border-color .15s;
}
.opt__radio::after {
  content: ""; position: absolute; inset: 3.5px; border-radius: 50%; background: var(--accent);
  transform: scale(0); transition: transform .3s cubic-bezier(.34, 1.8, .64, 1);
}

/* List rows (income, budget): title on the left, radio on the right, vertically centered */
.opts--list .opt { padding: 15px 16px; }
.opts--list .opt__radio { top: 50%; margin-top: -10px; }

.opt:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-wash) 45%, #fff);
}
.opt:has(input:checked) .opt__icon { background: var(--accent); color: #fff; }
.opt:has(input:checked) .opt__radio { border-color: var(--accent); }
.opt:has(input:checked) .opt__radio::after { transform: scale(1); }
.opt:has(input:focus-visible) { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.opt:active { transform: scale(.985); }
@media (hover: hover) {
  .opt:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: 0 6px 18px -10px rgba(14, 26, 120, .25); }
}

/* ---------- Text inputs ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.field__label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.field__label small { font-weight: 400; color: var(--muted); font-size: 14px; }
.input {
  width: 100%;
  font: 500 17px/1.3 var(--sans); color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input--big { font-size: 24px; letter-spacing: 0.03em; padding: 14px 16px; }
textarea.input { min-height: 120px; resize: vertical; font-size: 16px; line-height: 1.5; }
.input::placeholder { color: #a8afb2; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
.input[aria-invalid="true"] { border-color: #c2412d; box-shadow: 0 0 0 4px #fbe5e1; }
.error { min-height: 0; margin: 8px 0 0; font-size: 14px; color: #a33a2b; }
.error:empty { display: none; }

.consent {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 16px; font-size: 12.5px; line-height: 1.5; color: var(--muted); cursor: pointer;
}
.consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }

.zipnote {
  margin-top: 12px; padding: 14px 16px;
  background: #fff8e8; border: 1px solid #f1dfb2; border-radius: 12px;
  font-size: 14.5px; line-height: 1.5; color: #5c4a1c;
}
.zipnote p { margin: 0; }
.zipnote .ob-actions { margin-top: 14px; }
.ob-actions[hidden] { display: none; }
.zipnote strong { color: #3f3210; font-weight: 600; }

/* ---------- Footer row: back / skip on the left, Continue on the right ---------- */
.ob-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; }
.ob-actions__left { display: flex; align-items: center; gap: 18px; }
.link-btn {
  font: 500 14px var(--sans); color: var(--muted);
  background: none; border: 0; padding: 6px 0; cursor: pointer;
}
.link-btn:hover { color: var(--ink); }

a.btn-go { text-decoration: none; }
.btn-go {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 15px/1 var(--sans); color: #fff;
  background: var(--ink); border: 0; border-radius: 11px;
  padding: 13px 18px 13px 20px; cursor: pointer;
  transition: background-color .15s, opacity .15s, transform .15s;
}
.btn-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.btn-go:hover:not([disabled]) { background: #000; }
.btn-go:hover:not([disabled]) svg { transform: translateX(3px); }
.btn-go:active:not([disabled]) { transform: scale(.97); }
.btn-go[disabled] { opacity: .35; cursor: not-allowed; }
.btn-go--accent { background: var(--accent); }
.btn-go--accent:hover:not([disabled]) { background: var(--accent-ink); }

/* ---------- Sending + done ---------- */
.sending { text-align: center; padding: 12px 0 8px; }
.sending__list { list-style: none; padding: 0; margin: 24px auto 0; display: inline-grid; gap: 12px; text-align: left; }
.sending__list li { display: flex; align-items: center; gap: 12px; color: var(--muted); transition: color .3s; }
.sending__list li::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.sending__list li.is-done { color: var(--ink); }
.sending__list li.is-done::before {
  animation: none; border-color: var(--accent); background: var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.sending__list li.is-waiting::before { animation: none; border-color: var(--line); }
@keyframes spin { to { transform: rotate(360deg); } }

.done { text-align: center; padding: 8px 0 4px; }
.done__mark { width: 72px; height: 72px; margin: 0 auto 20px; display: block; }
.done__mark circle { fill: var(--accent-wash); }
.done__mark path {
  fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .25s cubic-bezier(.65, 0, .35, 1) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.done .ob-q { font-size: clamp(24px, 3.4vw, 30px); }
.done p { color: var(--muted); max-width: 30em; margin: 12px auto 0; }
.recap {
  text-align: left; margin: 24px 0 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 4px 18px;
}
.recap div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; font-size: 14.5px; }
.recap div + div { border-top: 1px solid var(--line); }
.recap dt { color: var(--muted); }
.recap dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.recap__sig { display: block; text-align: right; font-family: var(--hand); color: var(--accent); font-size: 19px; margin-top: 6px; }
.done .ob-actions { justify-content: center; }

.ob-noscript { color: var(--muted); }

.ob-private {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 16px 0 0; font-size: 13px; color: var(--muted);
}

[tabindex="-1"]:focus { outline: none; }

/* ---------- Phone ---------- */
@media (max-width: 600px) {
  .ob-wrap { justify-content: flex-start; padding-top: 16px; }
  .ob-card { padding: 22px 18px 20px; border-radius: 18px; }
  .ob-segs { margin: 16px 0 24px; gap: 4px; }
  .opts { grid-template-columns: 1fr; gap: 10px; }
  .opt { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding: 14px; }
  .opt__icon { grid-row: span 2; margin-bottom: 0; }
  .opt__radio { top: 50%; margin-top: -10px; right: 14px; }
  .opt__desc { margin-top: 2px; padding-right: 26px; }
  .opts--list .opt { display: block; }
  .ob-actions { margin-top: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .ob-segs span::after, .opt, .opt__radio::after, .btn-go, .btn-go svg { transition: none; }
  .sending__list li::before { animation: none; }
  .done__mark path { animation: none; stroke-dashoffset: 0; }
}
