/* =================================================================
   Spatial Intelligence Assessment — XVenture
   Design system rebuilt faithfully from the original prototype.
   ================================================================= */

:root {
  --navy-950: #070b1c;
  --navy-900: #0b1330;
  --navy-800: #121b42;
  --navy-700: #1a2456;
  --teal: #16b8a6;
  --teal-soft: rgba(22, 184, 166, 0.2);
  --teal-bright: #3dd9c4;
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.2);
  --ink: #eef1fa;
  --ink-dim: #aab4d4;
  --ink-faint: #6b76a0;
  --line: rgba(170, 180, 212, 0.14);
  --card: rgba(255, 255, 255, 0.03);
  --card-hover: rgba(255, 255, 255, 0.06);
  --danger: #e0664f;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --maxw: 760px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(22, 184, 166, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(212, 175, 55, 0.08), transparent 55%),
    var(--navy-950);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

#root { min-height: 100%; }

h1, h2, h3, .brand-name { font-family: 'Sora', sans-serif; }

.mono { font-family: 'JetBrains Mono', monospace; }

/* ---------- Layout shell ---------- */
.shell { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 64px; }

.brandbar {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 0 26px; border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--teal), var(--gold));
  color: var(--navy-950); font-family: 'Sora'; font-weight: 800; font-size: 18px;
}
.brand-name { font-weight: 700; letter-spacing: 0.2px; font-size: 16px; }
.brand-sub {
  margin-left: auto; font-size: 11px; letter-spacing: 2px;
  color: var(--ink-faint); text-transform: uppercase;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 3px;
  color: var(--teal); text-transform: uppercase; margin-bottom: 18px;
}

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
}

.h-lead { font-size: clamp(26px, 4.5vw, 40px); font-weight: 700; line-height: 1.15; letter-spacing: -0.5px; }
.subtle { color: var(--ink-dim); }
.muted { color: var(--ink-faint); }
.mt-14 { margin-top: 14px; } .mt-18 { margin-top: 18px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }

/* ---------- Dimension chips (welcome) ---------- */
.dim-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 26px 0; }
.dim-chip {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; background: var(--card);
}
.dim-chip .ic {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  font-size: 18px; background: var(--navy-800); color: var(--teal-bright);
}
.dim-chip .nm { font-family: 'Sora'; font-weight: 600; font-size: 14px; }
.dim-chip .sb { font-size: 12px; color: var(--ink-faint); }

/* ---------- Buttons ---------- */
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 26px; }
.btn {
  font-family: 'Sora'; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; border-radius: 12px; padding: 13px 22px;
  cursor: pointer; transition: transform .08s ease, background .15s ease, opacity .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--teal), var(--teal-bright)); color: var(--navy-950); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-dim); }
.btn-ghost:hover { background: var(--card-hover); color: var(--ink); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn-link { background: none; border: none; color: var(--teal); cursor: pointer; font-size: 14px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--ink-dim); margin-bottom: 7px; font-weight: 500; }
.field .req { color: var(--gold); }
.input, .select {
  width: 100%; background: var(--navy-900); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 15px; font-family: inherit;
}
.input:focus, .select:focus { outline: none; border-color: var(--teal); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 13px; color: var(--ink-dim); }
.consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--teal); }

/* ---------- Quiz ---------- */
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.section-head .ic {
  width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center;
  font-size: 22px; background: var(--navy-800); color: var(--teal-bright);
}
.section-head .nm { font-family: 'Sora'; font-weight: 700; font-size: 20px; }
.section-head .sb { font-size: 13px; color: var(--ink-faint); }

.progress-wrap { margin: 20px 0 6px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-faint); margin-bottom: 8px; }
.progress { height: 6px; background: var(--navy-800); border-radius: 999px; overflow: hidden; }
.progress .fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); transition: width .3s ease; }

.q-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 16px; background: var(--card); }
.q-text { font-size: 16px; font-weight: 500; margin-bottom: 16px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale-opt {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 6px;
  text-align: center; cursor: pointer; transition: all .12s ease; background: var(--navy-900);
}
.scale-opt:hover { border-color: var(--teal); }
.scale-opt.sel { border-color: var(--teal); background: var(--teal-soft); }
.scale-opt .v { font-family: 'JetBrains Mono'; font-weight: 500; font-size: 18px; color: var(--teal-bright); }
.scale-opt .t { font-size: 10px; color: var(--ink-faint); margin-top: 4px; line-height: 1.25; }
.scale-opt.sel .t { color: var(--ink-dim); }

.quiz-nav { display: flex; justify-content: space-between; margin-top: 22px; }

/* ---------- Results ---------- */
.score-hero { text-align: center; padding: 12px 0 8px; }
.score-num { font-family: 'Sora'; font-weight: 800; font-size: clamp(56px, 12vw, 88px); line-height: 1; }
.band-name { font-family: 'Sora'; font-weight: 700; font-size: 22px; margin-top: 6px; }
.band-desc { color: var(--ink-dim); max-width: 560px; margin: 12px auto 0; }

.dims { margin-top: 30px; display: grid; gap: 16px; }
.dim-row .top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 7px; }
.dim-row .nm { font-family: 'Sora'; font-weight: 600; }
.dim-row .pc { font-family: 'JetBrains Mono'; color: var(--ink-dim); }
.bar { height: 9px; background: var(--navy-800); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 999px; transition: width .5s ease; }

.reco { margin-top: 30px; }
.reco h3 { font-size: 18px; margin-bottom: 14px; }
.reco-card { border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 12px; background: var(--card); }
.reco-card.priority { border-left-color: var(--gold); }
.reco-card .lab { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.reco-card .bdy { font-size: 14px; color: var(--ink-dim); }
.reco-overall { background: var(--navy-800); border-radius: var(--radius-sm); padding: 18px; margin-top: 8px; font-size: 14px; color: var(--ink-dim); }

/* ---------- Aggregate ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 8px 0 26px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; background: var(--card); }
.stat .n { font-family: 'Sora'; font-weight: 700; font-size: 30px; }
.stat .l { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.band-dist { display: grid; gap: 8px; margin-top: 8px; }
.band-dist .row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.band-dist .key { width: 96px; color: var(--ink-dim); }
.band-dist .track { flex: 1; height: 8px; background: var(--navy-800); border-radius: 999px; overflow: hidden; }
.band-dist .ct { width: 34px; text-align: right; font-family: 'JetBrains Mono'; color: var(--ink-faint); }

/* ---------- Misc ---------- */
.footer { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-faint); text-align: center; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy-700); border: 1px solid var(--line); color: var(--ink); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; z-index: 50; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }
.error { color: var(--danger); font-size: 13px; margin-top: 8px; }

@media (max-width: 560px) {
  .dim-grid, .grid-2 { grid-template-columns: 1fr; }
  .scale { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .scale-opt { padding: 10px 2px; }
  .scale-opt .t { display: none; }
}
