/* ── RAAJYOG Onboarding — same palette as Sabha app ───────────── */

:root {
  --bg: #fbf3e7;
  --bg-deep: #f3e6d2;
  --card: #ffffff;
  --card-soft: #f7edd9;
  --sand-top: #f0e0c8;
  --sand-mid: #fbf3e7;
  --sand-base: #fdf8f0;
  --sand-deep: #e8d7bc;
  --cream: #f7edd9;
  --cream-input: #ffffff;
  --charcoal: #2a2118;
  --ink: #3a2f24;
  --muted: #9a8670;
  --label: #8a6a28;
  --gold: #b8892e;
  --gold-lit: #c9a24a;
  --gold-deep: #8a6a28;
  --gold-border: #b8892e;
  --track: #e8d7bc;
  --line: rgba(184, 137, 46, 0.22);
  --line-soft: rgba(184, 137, 46, 0.14);
  --shell-max: 430px;
  --font-display: "Cinzel", "Times New Roman", serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: #e8d7bc;
  -webkit-font-smoothing: antialiased;
}

/* ── Mobile shell ─────────────────────────────────────────────── */

.onb-shell {
  width: 100%;
  max-width: var(--shell-max);
  min-height: 100dvh;
  min-height: 100vh;
  height: auto;
  margin: 0 auto;
  padding: 1.35rem 1.25rem 2.25rem;
  background: linear-gradient(180deg, #f0e0c8 0%, #fbf3e7 28%, #fdf8f0 100%);
  box-shadow: 0 0 0 1px rgba(90, 64, 36, 0.08), 0 20px 50px rgba(60, 40, 15, 0.15);
  overflow: visible;
  overflow-x: hidden;
}

/* ── Brand header ─────────────────────────────────────────────── */

.onb-brand {
  text-align: center;
  padding-top: 0.35rem;
}

.onb-logo {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--charcoal);
  line-height: 1.2;
}

.onb-tagline {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--gold);
}

.onb-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  width: 100%;
  max-width: 220px;
  margin: 1.1rem auto 0;
}

.onb-progress .seg {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgba(120, 90, 50, 0.18);
}

.onb-progress .seg.is-active {
  background: linear-gradient(90deg, var(--gold-lit), var(--gold));
  box-shadow: 0 0 8px rgba(196, 146, 46, 0.35);
}

/* ── Step views ───────────────────────────────────────────────── */

.onb-view[hidden] {
  display: none !important;
}

.onb-view.is-active {
  display: block;
}

.onb-view.onb-reveal.is-active {
  display: flex;
}

/* entrance once — no looping transform that can jitter */

@keyframes onbIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Title block ──────────────────────────────────────────────── */

.onb-main {
  margin-top: 1.5rem;
}

.onb-step {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.onb-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 5.6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--charcoal);
}

.onb-lead {
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  opacity: 0.88;
}

/* ── Form fields ──────────────────────────────────────────────── */

.onb-form {
  margin-top: 1.35rem;
}

.fld {
  margin-bottom: 1.05rem;
}

.fld > label:not(.toggle-row),
.fld-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--label);
  line-height: 1.35;
}

.lbl-soft {
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
}

.onb-input {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 48px;
  padding: 0 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--charcoal);
  background: var(--cream-input);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(90, 64, 36, 0.05);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  appearance: none;
  -webkit-appearance: none;
}

.onb-input.is-estimated,
.onb-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: var(--muted);
}

.onb-input:focus {
  border-color: rgba(196, 146, 46, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 0 0 3px rgba(196, 146, 46, 0.15);
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.onb-select {
  padding-right: 2.4rem;
  cursor: pointer;
  background-image: none;
}

.fld-hint {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--muted);
}

/* ── Exact time toggle ────────────────────────────────────────── */

.toggle-row {
  display: flex !important;
  align-items: center;
  gap: 0.7rem;
  width: max-content;
  max-width: 100%;
  margin: 0.75rem 0 0;
  padding: 0;
  font-size: inherit;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}

.toggle {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  margin: 0;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--track);
  border: 1px solid rgba(90, 64, 36, 0.12);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.toggle-thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 50%;
  background: #f5ebe0;
  box-shadow: 0 1px 3px rgba(60, 40, 15, 0.25);
  transition: transform 0.2s ease, background 0.2s ease;
}

.toggle input:checked + .toggle-track {
  background: linear-gradient(90deg, var(--gold-lit), var(--gold));
  border-color: transparent;
}

.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
  background: #fff8ec;
}

.toggle input:focus-visible + .toggle-track {
  outline: 2px solid rgba(196, 146, 46, 0.45);
  outline-offset: 2px;
}

.toggle-label {
  display: block;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.2;
  color: var(--muted);
}

/* ── Gender pills ─────────────────────────────────────────────── */

.gender-pills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.gender-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.7rem 0.25rem;
  font-family: var(--font-body);
  font-size: clamp(0.62rem, 2.7vw, 0.72rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  background: var(--cream-input);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.gender-pill:hover {
  border-color: rgba(196, 146, 46, 0.4);
}

.gender-pill.is-active {
  color: var(--charcoal);
  background: linear-gradient(180deg, #f3e4c4 0%, #e0c878 100%);
  border-color: var(--gold-border);
  box-shadow: 0 2px 8px rgba(138, 106, 40, 0.2);
}

.gender-pill:focus-visible {
  outline: 2px solid rgba(196, 146, 46, 0.5);
  outline-offset: 2px;
}

/* ── Actions ──────────────────────────────────────────────────── */

.onb-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.95rem;
  margin-top: 1.5rem;
  padding-bottom: 0.5rem;
}

.btn-continue {
  display: block;
  width: 100%;
  padding: 0.95rem 1.25rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--charcoal);
  text-align: center;
  background: linear-gradient(180deg, #e0c878 0%, #b8892e 48%, #8a6a28 100%);
  border: 1px solid rgba(138, 106, 40, 0.28);
  border-radius: 14px;
  box-shadow:
    0 1px 0 rgba(255, 230, 180, 0.45) inset,
    0 6px 18px rgba(90, 64, 36, 0.2);
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.15s ease;
}

.btn-continue:hover {
  filter: brightness(1.04);
}

.btn-continue:active {
  transform: translateY(1px);
}

.btn-continue:focus-visible {
  outline: 2px solid rgba(196, 146, 46, 0.55);
  outline-offset: 3px;
}

.skip-link {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: rgba(138, 115, 88, 0.55);
}

.skip-link:hover {
  color: var(--ink);
}

/* ── Step 2 · Persona quiz ────────────────────────────────────── */

.onb-quiz {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding-bottom: 1.5rem;
  text-align: center;
}

.quiz-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0 0 1rem;
  text-align: center;
}

.quiz-qnum {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
}

.onb-quiz .onb-step {
  margin: 0;
  text-align: center;
}

.quiz-title {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0 0 1.35rem;
  padding: 0 0.15rem;
  text-align: center;
  text-wrap: balance;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: left;
}

.quiz-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 1rem 1.15rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--charcoal);
  text-align: left;
  background: var(--cream-input);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(90, 64, 36, 0.05);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.quiz-option:hover {
  border-color: rgba(184, 137, 46, 0.45);
}

.quiz-option:focus-visible {
  outline: 2px solid rgba(196, 146, 46, 0.5);
  outline-offset: 2px;
}

.quiz-option.is-selected {
  color: var(--charcoal);
  background: linear-gradient(180deg, #f3e4c4 0%, #e0c878 100%);
  border-color: var(--gold-border);
  box-shadow: 0 2px 10px rgba(138, 106, 40, 0.2);
}

.quiz-option:disabled:not(.is-selected) {
  opacity: 0.55;
}

.quiz-options.is-long .quiz-option {
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
}

/* ── Step 3 · Archetype reveal ────────────────────────────────── */

.onb-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 1.75rem;
}

.reveal-step {
  margin: 0 0 1.25rem;
  width: 100%;
  text-align: center;
}

.reveal-ring {
  display: grid;
  place-items: center;
  margin: 0 0 1rem;
}

.reveal-glow {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 220, 150, 0.85), rgba(212, 168, 74, 0.35) 45%, transparent 70%),
    var(--cream-input);
  border: 1.5px solid rgba(196, 146, 46, 0.45);
  box-shadow:
    0 0 0 10px rgba(212, 168, 74, 0.08),
    0 0 28px rgba(196, 146, 46, 0.35);
}

.reveal-glyph {
  font-size: 2.4rem;
  line-height: 1;
}

.reveal-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 7vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--charcoal);
  line-height: 1.15;
}

.reveal-dev {
  margin: 0.45rem 0 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--gold);
}

.reveal-strength {
  margin: 0.75rem 0 0;
  max-width: 28ch;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink);
}

.reveal-aim {
  margin: 0.85rem 0 0;
  max-width: 34ch;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.45;
  color: var(--gold);
}

.reveal-ank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  color: var(--gold);
}

.reveal-ank b {
  font-weight: 700;
  color: var(--charcoal);
}

.ank-icon {
  font-size: 0.95rem;
}

.reveal-dosha {
  width: 100%;
  margin-top: 1.35rem;
  padding: 1rem 1.05rem 1.05rem;
  text-align: left;
  background: #ffffff;
  border: 1px solid rgba(196, 146, 46, 0.28);
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(90, 64, 36, 0.07);
}

.dosha-eyebrow {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.dosha-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 0.55rem;
}

.dosha-pct {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1;
}

.dosha-status {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.dosha-upay {
  margin: 0.85rem 0 0;
  padding-left: 0.75rem;
  border-left: 2px solid var(--gold);
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink);
}

.dosha-upay b {
  color: var(--charcoal);
}

.dosha-note {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ── In-depth persona panel ───────────────────────────────────── */

.reveal-deep {
  width: 100%;
  margin-top: 1.35rem;
  padding: 1rem 0.15rem 0.25rem;
  text-align: left;
}

.reveal-deep-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.95rem;
  text-align: center;
}

.reveal-deep-badge {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.15rem;
  border-radius: 50%;
  color: #6e5320;
  font-size: 0.95rem;
  background: linear-gradient(180deg, #e8c878 0%, #b8892e 100%);
  box-shadow: 0 3px 10px rgba(120, 80, 30, 0.25);
}

.reveal-deep-eyebrow {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.reveal-deep-sub {
  margin: 0;
  max-width: 22rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}

.reveal-metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.reveal-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.7rem 0.35rem;
  background: linear-gradient(180deg, #ffffff 0%, #f7edd9 100%);
  border: 1px solid rgba(184, 137, 46, 0.28);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(90, 64, 36, 0.06);
}

.reveal-metric-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.reveal-metric-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--charcoal);
  display: block;
  width: 100%;
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
  padding: 0 0.15rem;
  box-sizing: border-box;
}

#revElement.reveal-metric-value,
.reveal-metric-value#revElement {
  font-size: clamp(0.72rem, 2.6vw, 0.95rem);
  letter-spacing: 0.02em;
  line-height: 1.35;
  white-space: pre-line;
}

.reveal-deep-card {
  position: relative;
  margin: 0 0 0.75rem;
  padding: 0.95rem 1rem;
  text-align: left;
  background: #ffffff;
  border: 1px solid rgba(184, 137, 46, 0.22);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 4px 14px rgba(90, 64, 36, 0.07);
  overflow: hidden;
}

.reveal-deep-card.is-upay {
  background: linear-gradient(180deg, #fffaf0 0%, #f5e6c4 100%);
  border-color: rgba(184, 137, 46, 0.42);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 6px 16px rgba(120, 85, 30, 0.12);
}

.reveal-deep-card-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.45rem;
}

.reveal-deep-ico {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  flex-shrink: 0;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1;
  color: #6e5320;
  background: linear-gradient(160deg, #f5e6c8 0%, #e4cfa0 100%);
  border: 1px solid rgba(184, 137, 46, 0.35);
}

.reveal-deep-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  text-align: left;
}

.reveal-deep-body {
  margin: 0;
  padding-left: 0.1rem;
  font-size: 0.9rem;
  line-height: 1.58;
  color: var(--ink);
  text-align: left;
}

.reveal-strength {
  font-size: 0.95rem;
  line-height: 1.55;
}

.reveal-actions {
  width: 100%;
  margin-top: 1.35rem;
}

/* Legacy strip (if present) */
.reveal-ank-strip {
  display: none;
}

/* ── Narrow phones ────────────────────────────────────────────── */

@media (max-width: 360px) {
  .onb-shell {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .gender-pill {
    font-size: 0.6rem;
    padding: 0.65rem 0.15rem;
  }

  .onb-logo {
    font-size: 1.35rem;
    letter-spacing: 0.22em;
  }
}
