/* Onboarding page — floating nav (nav.css) + a full-height split:
   dark stickman stage on the left (onboarding-stage.css), stepper card on the right.
   Desktop (≥1024px): no page scroll, the right column scrolls internally.
   Below 1024px: the stage becomes a compact banner and the page scrolls normally. */

:root { --ob-nav-h: 60px; }   /* fallback only — on desktop the split flexes to fill whatever the nav renders at */

/* ---- nav: identical component to the landing; only the email chip is page-specific ---- */
/* divider under the top navbar (Razorpay-style) */
.ob-nav { border-bottom: 1px solid var(--line); }
.ob-nav .user-email {
  display: inline-block;
  max-width: 220px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ob-nav .user-email:empty { display: none; }

/* ---- split ---- */
.ob-split {
  height: calc(100vh - var(--ob-nav-h));
  height: calc(100dvh - var(--ob-nav-h));
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 44%) 1fr;
  gap: 0;                       /* the two containers sit flush — no gap between them */
  padding: 0;                   /* full-bleed: panels run to the screen edges (Razorpay-style) */
}
@media (min-width: 1024px) {
  html, body.ob-body { height: 100%; overflow: hidden; }
  /* nav + split fill the viewport exactly, independent of the nav's rendered height */
  body.ob-body { display: flex; flex-direction: column; }
  .ob-split { flex: 1; height: auto; grid-template-rows: minmax(0, 1fr); }
  /* full-bleed panels — no radius, no shadow; a subtle vertical seam between them */
  .ob-pane  { padding: 0; }
  .ob-stage { border-radius: 0; border: 0; box-shadow: none; }
  .ob-card  { border-radius: 0; border: 0; box-shadow: none; border-left: 1px solid var(--line); }
}

/* right column — scroll container; the card centres when short, scrolls when tall */
.ob-pane {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  padding: 0;                /* full-bleed: the white container fills its column on all sides */
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.ob-card {
  margin: 0;
  width: 100%;
  max-width: none;         /* fill the whole right column so it sits flush against the left panel */
  flex: 1;                 /* card fills the full column height (background runs start to end) */
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: safe center;  /* group the content and centre it — even gap top & bottom, none in the middle */
  align-items: center;     /* keep the form at a readable width, centred in the panel */
  overflow-y: auto;        /* the card itself scrolls when a step is tall */
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 28px 30px 24px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
body.ob-ready .ob-card { opacity: 1; transform: none; }

/* form flows naturally; footer sits right under the fields (no stretched gap) */
#obForm { display: flex; flex-direction: column; min-height: 0; }
/* the content sits in a readable, centred column inside the full-width panel */
.ob-head, .ob-steps, #obForm { width: 100%; max-width: 520px; }

/* ---- card head ---- */
.ob-head .eyebrow { display: block; }
.ob-head h1 { font-size: clamp(1.5rem, 2.2vw, 1.9rem); margin-top: 6px; }
.ob-head .sub { color: var(--ink-2); margin-top: 6px; font-size: 0.95rem; }

/* ---- stepper ---- */
.ob-steps {
  list-style: none;
  display: flex;
  align-items: center;
  padding: 0;
  margin: 22px 0;
}
.ob-steps li { display: flex; align-items: center; min-width: 0; }
.ob-steps li:not(:last-child) { flex: 1; }
.ob-steps li:not(:last-child)::after {
  content: "";
  flex: 1;
  height: 2px;
  margin: 0 10px;
  border-radius: 2px;
  background: var(--line-strong);
  transition: background 0.35s ease;
}
.ob-steps li.done::after { background: color-mix(in srgb, var(--aqua) 70%, var(--mint)); }

.ob-steps button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  cursor: default;
  transition: color 0.25s ease;
}
.ob-steps li.active button { color: var(--ink); }
.ob-steps li.done button { color: var(--ink-2); cursor: pointer; }
.ob-steps li.done button:hover { color: var(--ink); }

.ob-steps .n {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.ob-steps li.active .n {
  background: linear-gradient(180deg, var(--aqua), var(--aqua-2));
  color: var(--aqua-ink);
  border-color: transparent;
  box-shadow: 0 0 0 4px var(--aqua-glow);
}
.ob-steps li.done .n {
  background: color-mix(in srgb, var(--aqua) 16%, transparent);
  border-color: transparent;
  color: transparent;
}
/* done = a drawn tick instead of the number */
.ob-steps li.done .n::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 6px;
  height: 11px;
  border-right: 2px solid var(--aqua);
  border-bottom: 2px solid var(--aqua);
  transform: translateY(-2px) rotate(45deg);
}

/* ---- step panels ---- */
.ob-step { animation: obfade 0.3s ease; }
@keyframes obfade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.ob-step h3 { font-size: 1.12rem; font-weight: 600; }
.ob-step-sub { color: var(--ink-2); font-size: 0.9rem; margin: 4px 0 16px; }
.ob-step .field:last-child { margin-bottom: 0; }
.field label .opt {
  margin-left: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
}
.field-hint { margin-top: 7px; font-size: 0.78rem; color: var(--muted); }

.ob-card select {
  width: 100%;
  padding: 12px 38px 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2346584f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 14px center / 12px 8px,
    color-mix(in srgb, var(--bg-0) 45%, transparent);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.98rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.ob-card select:focus { outline: none; border-color: var(--aqua); box-shadow: 0 0 0 3px var(--aqua-glow); }

.ob-card input.invalid,
.ob-card select.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(211, 86, 78, 0.14);
}

.ob-plan-note { margin-top: 12px; font-size: 0.82rem; color: var(--muted); }

/* ---- footer ---- */
.ob-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;         /* sits directly under the fields — no stretched gap */
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.ob-count {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.ob-foot-right { display: flex; align-items: center; gap: 10px; }
.ob-foot .btn { padding: 11px 20px; }
.ob-foot .btn:disabled { opacity: 0.6; cursor: progress; }
.ob-card .form-note { text-align: left; margin-top: 12px; }
.ob-card .form-note.err { color: var(--red); }

/* ---- short desktop viewports: tighten the card so it still fits ---- */
@media (min-width: 1024px) and (max-height: 720px) {
  .ob-card { padding: 20px 24px 18px; }
  .ob-head .sub { display: none; }
  .ob-steps { margin: 16px 0; }
  .ob-foot { margin-top: 16px; padding-top: 14px; }
}

/* ---- stacked layout below 1024px: banner above the card, page scrolls ---- */
@media (max-width: 1023px) {
  .ob-split {
    height: auto;
    display: block;
    padding: 6px var(--gutter) 48px;
  }
  .ob-pane { display: block; overflow: visible; padding: 0; }
  .ob-card { max-width: 640px; margin: 0 auto; flex: none; overflow: visible; min-height: 0; }
  .ob-foot { position: static; }
}
@media (max-width: 560px) {
  .ob-card { padding: 22px 18px 20px; border-radius: 20px; }
  .ob-steps .t { display: none; }
  .ob-steps li.active .t { display: inline; }
  .ob-nav .user-email { max-width: 130px; }
}
@media (max-width: 420px) {
  .ob-nav .user-email { display: none; }
  .ob-foot { flex-wrap: wrap; }
  .ob-foot-right { width: 100%; }
  .ob-foot-right .btn { flex: 1; justify-content: center; }
}
