/* ─── CITIZEN ONBOARDING FLOW ──────────────────────────────────── */

.onb-wrap {
  height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.onb-wrap.onb-compact { min-height: auto; }

.onb-skip {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
  padding: 8px 14px;
  background: rgba(26,26,26,0.9);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}

/* Progress rail */
.onb-progress {
  padding: 18px 32px 0;
  background: #fff;
  border-bottom: 1px solid var(--hairline);
}
.onb-progress-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px;
  padding-bottom: 14px;
}
.onb-progress-head .brand-lockup-name { flex: 1; min-width: 0; }
.onb-progress-step-count { white-space: nowrap; }
.onb-track {
  display: flex; gap: 0; align-items: center;
  padding-bottom: 0;
  overflow-x: auto;
}
.onb-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 14px;
  position: relative;
  flex: 1; min-width: 80px;
  background: transparent;
  border-bottom: 2px solid var(--hairline);
}
.onb-step.done { border-bottom-color: var(--brand-teal); }
.onb-step.current { border-bottom-color: var(--brand-copper); border-bottom-width: 3px; }

.onb-step-pip {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  background: var(--paper-warm); color: var(--muted);
  position: relative;
}
.onb-step.done .onb-step-pip { background: var(--brand-teal); color: #fff; }
.onb-step.current .onb-step-pip {
  background: var(--brand-copper); color: var(--brand-black);
  box-shadow: 0 0 0 4px rgba(234,160,122,0.2);
}
.onb-step-pip .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand-black);
  animation: pulse 1.6s infinite;
}
.onb-step-label { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.onb-step.current .onb-step-label { color: var(--ink); font-weight: 600; }

/* Screen container */
.onb-screen {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 32px;
  overflow: hidden;
  min-height: 0;
}

/* Step shell */
.onb-step-shell {
  width: 100%; max-width: 720px;
  display: flex; flex-direction: column; gap: 28px;
}
.onb-step-head { display: flex; flex-direction: column; gap: 16px; padding-bottom: 4px; }
.onb-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(34px, 3.8vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 720px;
}
.onb-h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0;
}
.onb-italic { font-style: italic; color: var(--brand-copper-deep); }
.onb-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
  max-width: 560px;
}
.onb-step-body { display: flex; flex-direction: column; gap: 20px; }
.onb-step-foot {
  display: flex; gap: 12px; align-items: center;
  padding-top: 12px;
}

/* ─── 1. Welcome ─────────────────────────── */

.onb-welcome {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 32px;
  align-items: center;
  max-width: 1180px;
  width: 100%;
}
.onb-welcome-art {
  aspect-ratio: 1;
  display: grid; place-items: center;
  max-height: 360px;
  overflow: hidden;
}
.onb-welcome-art svg { width: 100%; height: 100%; max-width: 320px; }

.onb-welcome-text { display: flex; flex-direction: column; gap: 12px; }
.onb-welcome-sub {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
  max-width: 520px;
}
.onb-welcome-meta {
  display: flex; gap: 22px; flex-wrap: wrap;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
}
.onb-trust {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}
.onb-trust-row { display: flex; gap: 8px; align-items: center; }

/* ─── 2. Identity / OTP ──────────────────── */

.onb-field-group { display: flex; flex-direction: column; gap: 18px; }
.onb-field-large {
  display: flex; flex-direction: column; gap: 6px;
}
.input.lg {
  height: 56px;
  padding: 0 18px;
  font-size: 18px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.onb-sources {
  padding: 18px;
  background: var(--paper-soft);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--hairline);
}
.onb-sources-head {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.onb-source { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--ink-soft); }

.onb-otp {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 24px 0;
}
.otp-row { display: flex; gap: 12px; }
.otp-input {
  width: 60px; height: 72px;
  border: 2px solid var(--hairline);
  border-radius: 12px;
  background: #fff;
  text-align: center;
  font-size: 28px;
  font-family: var(--font-mono);
  font-weight: 600;
  outline: none;
  transition: border-color .12s;
}
.otp-input:focus { border-color: var(--brand-teal); box-shadow: 0 0 0 4px rgba(27,65,73,0.1); }

.onb-verified {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 24px 0;
}
.onb-verified-check {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--ok-bg); color: var(--ok);
  display: grid; place-items: center;
  animation: checkPop .4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes checkPop { from { transform: scale(0); } to { transform: scale(1); } }
.onb-verified-fill {
  display: flex; flex-direction: column; gap: 6px;
  width: 100%;
  max-width: 320px;
}
.fill-row {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 14px;
  background: var(--ok-bg);
  color: var(--ok);
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  animation: slideIn .3s ease-out backwards;
}
.fill-row:nth-child(1) { animation-delay: 0.1s; }
.fill-row:nth-child(2) { animation-delay: 0.2s; }
.fill-row:nth-child(3) { animation-delay: 0.3s; }
.fill-row:nth-child(4) { animation-delay: 0.4s; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

/* ─── 3. Personal ─────────────────────── */

.onb-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.read-field {
  padding: 14px 16px;
  background: var(--paper-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: 4px;
}
.read-value {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.onb-helper {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  background: rgba(27,65,73,0.06);
  border-radius: 10px;
  color: var(--ink-soft);
}
.onb-helper.warn {
  background: rgba(156, 96, 17, 0.08);
  color: var(--warn);
}

/* ─── 4. Income ────────────────────────── */

.onb-income { display: flex; flex-direction: column; gap: 22px; }

.onb-currency-input {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  height: 64px;
  background: #fff;
  border: 2px solid var(--hairline);
  border-radius: 12px;
}
.currency-prefix, .currency-suffix {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.input.lg.currency {
  border: 0;
  height: auto;
  padding: 0;
  font-family: var(--font-serif);
  font-size: 36px;
  letter-spacing: -0.01em;
}
.input.lg.currency:focus { box-shadow: none; }

.onb-band {
  position: relative;
  padding: 4px 0 30px;
}
.onb-band-track {
  height: 6px;
  background: var(--hairline);
  border-radius: 999px;
  position: relative;
}
.onb-band-fill {
  position: absolute;
  top: -3px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--brand-copper);
  box-shadow: 0 0 0 4px rgba(234,160,122,0.25);
  transition: left .15s;
}
.onb-band-labels {
  position: relative;
  display: flex; justify-content: space-between;
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
}
.onb-band-marker {
  position: absolute;
  transform: translateX(-50%);
}
.onb-band-tiers {
  position: relative;
  height: 3px;
  margin-top: 6px;
}
.band-tier {
  position: absolute;
  height: 3px;
  background: var(--ok);
  opacity: 0.6;
}
.band-tier::after {
  content: attr(class);
  display: none;
}
.band-tier.mid { background: #8a9554; }
.band-tier.high { background: var(--brand-copper-deep); }

.onb-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.onb-affordability-preview {
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--brand-teal), #1b4149);
  color: #fff;
  border-radius: var(--r-md);
}
.onb-affordability-preview .label-eyebrow { color: rgba(255,255,255,0.7); }
.onb-affordability-preview .muted { color: rgba(255,255,255,0.65); }
.serif-big {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.01em;
}

/* ─── 5. Housing ─────────────────────── */

.onb-questions { display: flex; flex-direction: column; gap: 12px; }
.onb-question {
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}
.onb-yn { display: flex; gap: 6px; }
.yn {
  padding: 10px 24px;
  border: 1.5px solid var(--hairline);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 14px; font-weight: 600;
  transition: all .12s;
}
.yn:hover { border-color: var(--ink); color: var(--ink); }
.yn.active.yes { background: var(--ok); color: #fff; border-color: var(--ok); }
.yn.active.no { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ─── 6. Documents ────────────────────── */

.onb-docs { display: flex; flex-direction: column; gap: 18px; }
.onb-doc-progress {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 18px;
  background: var(--paper-soft);
  border-radius: var(--r-md);
}
.onb-doc-progress-text {
  display: flex; align-items: baseline; gap: 8px;
}
.onb-doc-progress-bar {
  height: 6px;
  background: var(--hairline);
  border-radius: 999px;
  overflow: hidden;
}
.onb-doc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-teal), var(--brand-copper));
  border-radius: 999px;
  transition: width .25s;
}

.onb-doc-list { display: flex; flex-direction: column; gap: 8px; }
.onb-doc-row {
  display: flex; gap: 14px; align-items: center;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  transition: border-color .12s;
}
.onb-doc-row.done { border-color: rgba(27,65,73,0.3); background: rgba(27,65,73,0.02); }
.onb-doc-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--paper-warm);
  color: var(--muted);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.onb-doc-row.done .onb-doc-icon {
  background: var(--ok-bg);
  color: var(--ok);
}

/* ─── 7. Scanning animation ────────────── */

.onb-scanning {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px;
  text-align: center;
  max-width: 580px;
  margin: 0 auto;
}
.onb-scan-art {
  width: 200px; height: 200px;
  display: grid; place-items: center;
  position: relative;
  margin-bottom: 12px;
}
.scan-orbit {
  width: 100%; height: 100%;
  position: relative;
  display: grid; place-items: center;
}
.scan-orbit-ring {
  position: absolute;
  border: 1.5px solid var(--brand-copper);
  border-radius: 50%;
  opacity: 0.3;
}
.scan-orbit-ring.r1 { width: 100%; height: 100%; animation: scanRing 3s infinite; }
.scan-orbit-ring.r2 { width: 70%; height: 70%; animation: scanRing 3s infinite 0.4s; }
.scan-orbit-ring.r3 { width: 40%; height: 40%; animation: scanRing 3s infinite 0.8s; }
@keyframes scanRing {
  0% { opacity: 0; transform: scale(0.6); }
  20% { opacity: 0.6; }
  100% { opacity: 0; transform: scale(1.4); }
}
.scan-center {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--brand-teal);
  color: #fff;
  display: grid; place-items: center;
  position: relative; z-index: 1;
}

.onb-scan-list {
  width: 100%;
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 20px;
  text-align: left;
}
.scan-row {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  transition: all .25s;
}
.scan-row.pending { opacity: 0.5; }
.scan-row.done { border-color: rgba(27,65,73,0.25); background: rgba(27,65,73,0.02); }
.scan-row-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--paper-warm);
  color: var(--muted);
  display: grid; place-items: center;
}
.scan-row.done .scan-row-icon {
  background: var(--ok-bg);
  color: var(--ok);
}
.scan-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--hairline);
  border-top-color: var(--brand-teal);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ─── 8. Program matches ─────────────── */

.onb-matches {
  width: 100%; max-width: 1180px;
  display: flex; flex-direction: column; gap: 28px;
}
.onb-matches-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
}
.onb-result-art { width: 100px; height: 100px; }
.result-ring {
  position: relative; width: 100%; height: 100%;
  display: grid; place-items: center;
}
.result-ring-inner {
  position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center;
}

.onb-program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.program-match {
  position: relative;
  padding: 22px 22px 18px;
  background: #fff;
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: 14px;
}
.program-match.featured { border-color: var(--brand-copper); box-shadow: 0 0 0 3px rgba(234,160,122,0.12); }
.program-match.status-bad { opacity: 0.85; }

.match-best {
  position: absolute; top: -10px; left: 18px;
  padding: 3px 10px;
  background: var(--brand-copper); color: var(--brand-black);
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
}
.match-head {
  display: flex; justify-content: space-between; gap: 14px;
}
.match-name {
  font-size: 22px;
  margin-top: 4px;
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.005em;
}
.match-score {
  text-align: right;
  display: flex; flex-direction: column;
}
.match-score .serif-big { font-size: 36px; color: var(--brand-teal); }

.match-status {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  background: var(--paper-soft);
  line-height: 1.4;
}
.program-match.status-ok .match-status { background: var(--ok-bg); color: var(--ok); }
.program-match.status-warn .match-status { background: var(--warn-bg); color: var(--warn); }
.program-match.status-bad .match-status { background: var(--bad-bg); color: var(--bad); }

.match-perks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.perk { display: flex; gap: 8px; align-items: center; }

.match-blockers { padding-top: 4px; }
.match-blocker {
  display: flex; gap: 6px; align-items: center;
  padding: 4px 8px;
  background: var(--bad-bg); color: var(--bad);
  border-radius: 6px;
  font-size: 12px; font-weight: 500;
  margin-bottom: 4px;
}

.match-foot {
  display: flex; gap: 8px;
  justify-content: flex-end;
}

.onb-matches-foot {
  display: flex; gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
}

/* ─── Onboarding responsive ──────────────────────────────── */

@media (max-width: 1024px) {
  .onb-welcome { gap: 32px; }
  .onb-welcome-art svg { max-width: 300px; }
}

@media (max-width: 768px) {
  .onb-screen { padding: 24px 16px; }

  .onb-progress { padding: 12px 16px 0; }
  .onb-step { min-width: 44px; padding: 8px 6px; }
  .onb-step-label { display: none; }

  .onb-welcome {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
    max-width: 100%;
  }
  .onb-welcome-art { max-width: 200px; margin: 0 auto; }
  .onb-welcome-art svg { max-width: 200px; }
  .onb-welcome-meta { justify-content: center; }
  .onb-welcome-sub { max-width: 100%; }

  .onb-step-shell { max-width: 100%; }

  .onb-grid-2 { grid-template-columns: 1fr; }
  .onb-card-grid { grid-template-columns: 1fr; }
}
