/* ============================================================
   SPECTRUM — Main Stylesheet
   ============================================================ */
:root {
  --navy:    #1B3A6B;
  --blue:    #2E5FA3;
  --sky:     #E8F0FB;
  --crimson: #C0392B;
  --amber:   #E67E22;
  --jade:    #27AE60;
  --indigo:  #2980B9;
  --bg:      #F4F6FB;
  --card:    #fff;
  --text:    #1A1A2E;
  --muted:   #6B6B80;
  --radius:  14px;
  --shadow:  0 4px 24px rgba(27,58,107,.10);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
       background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── NAVBAR ────────────────────────────────────────────── */
.navbar {
  background: var(--navy);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.logo { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: 2px; text-decoration: none; }
.logo span { color: #7DB3F0; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.user-chip { color: #B8CDE8; font-size: 14px; }
.nav-btn {
  background: rgba(255,255,255,.12); color: #fff;
  border: none; padding: 7px 16px; border-radius: 20px;
  cursor: pointer; font-size: 13px; text-decoration: none;
  transition: background .2s;
}
.nav-btn:hover { background: rgba(255,255,255,.22); }

/* ── AUTH / CENTER LAYOUT ──────────────────────────────── */
.auth-body { display: flex; flex-direction: column; min-height: 100vh; }
.center-wrap {
  flex: 1; display: flex; align-items: center;
  justify-content: center; padding: 32px 16px;
}
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 40px;
  max-width: 480px; width: 100%;
}
.card.wide { max-width: 720px; }

/* ── TYPOGRAPHY ────────────────────────────────────────── */
h1 { font-size: 28px; font-weight: 800; color: var(--navy); line-height: 1.2; margin-bottom: 6px; }
h2 { font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
h3 { font-size: 16px; font-weight: 700; color: var(--navy); }
p  { color: var(--muted); line-height: 1.7; font-size: 15px; margin-bottom: 8px; }
a  { color: var(--blue); }
.sub { color: var(--muted); font-size: 14px; }

/* ── FORMS ─────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: 12px 14px; border: 1.5px solid #D8DFF0;
  border-radius: 9px; font-size: 15px; outline: none; transition: border .2s;
  background: #fff;
}
input:focus { border-color: var(--blue); }
.btn {
  display: inline-block; background: var(--navy); color: #fff;
  border: none; padding: 13px 28px; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  width: 100%; transition: background .2s; text-align: center;
  text-decoration: none;
}
.btn:hover { background: var(--blue); color: #fff; }
.btn.ghost {
  background: transparent; color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn.ghost:hover { background: var(--sky); }
.btn.sm { padding: 9px 20px; font-size: 14px; width: auto; }
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #FDECEA; color: #911; border: 1px solid #F5C6C6; }

/* ── PROGRESS BAR ──────────────────────────────────────── */
.progress-wrap { background: var(--sky); padding: 12px 24px 0; }
.progress-track { background: #D0DCEF; border-radius: 4px; height: 5px; overflow: hidden; }
.progress-fill { background: var(--blue); height: 100%; border-radius: 4px; transition: width .4s; }
.progress-label { text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; padding-bottom: 8px; }

/* ── QUIZ ──────────────────────────────────────────────── */
.quiz-body {
  flex: 1; display: flex; align-items: center;
  justify-content: center; padding: 24px 16px; min-height: calc(100vh - 120px);
}
.q-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 36px;
  max-width: 680px; width: 100%;
}
.q-type-badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; padding: 3px 10px; border-radius: 20px;
  margin-bottom: 16px; background: var(--sky); color: var(--blue);
}
.q-text { font-size: 18px; font-weight: 600; color: var(--text); line-height: 1.5; margin-bottom: 28px; }
.q-scenario {
  background: var(--sky); border-left: 3px solid var(--blue);
  padding: 12px 16px; border-radius: 6px; font-size: 15px;
  color: var(--navy); margin-bottom: 16px; font-weight: 500;
}
.q-instruction { font-size: 13px; color: var(--muted); margin-bottom: 20px; font-style: italic; }

/* Likert */
.likert-labels { display: flex; justify-content: space-between; margin-bottom: 10px; }
.likert-labels span { font-size: 12px; color: var(--muted); }
.likert-row { display: flex; gap: 10px; flex-wrap: wrap; }
.likert-btn {
  flex: 1; min-width: 80px; padding: 14px 8px;
  border: 1.5px solid #D8DFF0; border-radius: 10px;
  background: #fff; cursor: pointer; text-align: center;
  font-size: 13px; color: var(--muted); transition: all .15s; line-height: 1.3;
}
.likert-btn:hover { border-color: var(--blue); color: var(--navy); background: var(--sky); }
.likert-btn.selected { border-color: var(--navy); background: var(--navy); color: #fff; font-weight: 700; }

/* FC / Scenario */
.fc-options { display: flex; flex-direction: column; gap: 12px; }
.fc-btn {
  padding: 18px 20px; border: 1.5px solid #D8DFF0; border-radius: 10px;
  background: #fff; cursor: pointer; text-align: left;
  font-size: 15px; color: var(--text); transition: all .15s; line-height: 1.5;
}
.fc-btn:hover { border-color: var(--blue); background: var(--sky); }
.fc-btn.selected { border-color: var(--navy); background: var(--navy); color: #fff; }
.option-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; margin-bottom: 4px; opacity: .7; }

/* Quiz footer */
.q-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; }
.q-num { font-size: 13px; color: var(--muted); }
.next-btn {
  background: var(--navy); color: #fff; border: none;
  padding: 11px 28px; border-radius: 9px; font-size: 15px;
  font-weight: 700; cursor: pointer; opacity: .35;
  pointer-events: none; transition: all .2s;
}
.next-btn.ready { opacity: 1; pointer-events: all; }
.next-btn.ready:hover { background: var(--blue); }
.back-link { background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; }
.back-link:hover { color: var(--navy); }

/* ── RESULTS ───────────────────────────────────────────── */
.results-wrap { max-width: 900px; width: 100%; margin: 0 auto; padding: 32px 16px 64px; }

/* Hero */
.profile-hero {
  border-radius: var(--radius); padding: 36px; color: #fff;
  margin-bottom: 20px; position: relative; overflow: hidden;
}
.profile-hero::before {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 220px; height: 220px; border-radius: 50%;
  opacity: .08; background: #fff;
}
.type-code { font-size: 13px; letter-spacing: 3px; font-weight: 700; opacity: .7; margin-bottom: 8px; }
.archetype-name { font-size: 36px; font-weight: 900; line-height: 1.1; margin-bottom: 8px; }
.tagline { font-size: 16px; opacity: .8; line-height: 1.5; }
.energy-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 8px 16px; border-radius: 20px;
  background: rgba(255,255,255,.12); font-size: 14px; font-weight: 600;
}
.energy-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* Notes */
.balance-note {
  background: #FFF8E1; border-left: 3px solid var(--amber);
  padding: 12px 16px; border-radius: 8px;
  font-size: 14px; color: #7B4F00; margin-bottom: 20px;
}
.flag-banner {
  background: #FFF3CD; border: 1px solid #F39C12;
  border-radius: 10px; padding: 14px 18px;
  margin-bottom: 20px; font-size: 14px; color: #7B4F00;
}

/* Save banner */
.save-banner {
  background: var(--sky); border-radius: var(--radius);
  padding: 20px 28px; display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
.save-banner p { font-size: 14px; color: var(--navy); font-weight: 600; margin: 0; }
.save-banner .sub { font-size: 12px; color: var(--muted); margin: 0; }

/* Sections */
.section-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; margin-bottom: 20px;
}
.section-card h2 { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1.5px solid var(--sky); }

/* Energy bars */
.energy-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.energy-label { font-size: 13px; font-weight: 700; width: 80px; flex-shrink: 0; }
.energy-track { flex: 1; background: #E4EAF5; border-radius: 6px; height: 14px; overflow: hidden; }
.energy-bar { height: 100%; border-radius: 6px; transition: width .8s .2s; }
.energy-pct { font-size: 13px; font-weight: 700; width: 42px; text-align: right; flex-shrink: 0; }

/* Dimension bars */
.dim-bar-wrap { margin-bottom: 20px; }
.dim-bar-labels { display: flex; justify-content: space-between; margin-bottom: 6px; }
.dim-bar-labels .pole-a { font-size: 13px; font-weight: 600; color: var(--navy); }
.dim-bar-labels .pole-b { font-size: 13px; font-weight: 600; color: var(--muted); }
.dim-bar-labels span:nth-child(2) { font-size: 13px; color: var(--muted); }
.dim-track { background: #E4EAF5; border-radius: 6px; height: 12px; position: relative; }
.dim-fill { height: 100%; border-radius: 6px; }
.dim-marker {
  position: absolute; top: -4px; width: 20px; height: 20px;
  border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2); transform: translateX(-50%);
}
.dim-score-label { text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; }
.balanced-tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: .5px; padding: 2px 8px; background: #FFF8E1;
  color: #7B4F00; border-radius: 4px; margin-left: 6px;
}

/* Strengths */
.strength-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 12px; margin-top: 4px; }
.strength-item {
  background: var(--sky); border-radius: 10px; padding: 14px 16px;
  font-size: 14px; font-weight: 600; color: var(--navy);
  border-left: 3px solid var(--blue);
}

/* Blind spots */
.blind-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #F0F3FA; }
.blind-item:last-child { border-bottom: none; }
.blind-icon { color: #C0392B; font-size: 16px; margin-top: 1px; flex-shrink: 0; }
.blind-item p { font-size: 14px; color: var(--text); margin: 0; }

/* Career */
.career-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.career-tag { background: var(--sky); color: var(--navy); padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; }

/* Compatibility */
.compat-group { margin-bottom: 4px; }
.compat-label { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; margin-bottom: 8px; }
.compat-label.allies { color: var(--jade); }
.compat-label.growth { color: var(--blue); }
.compat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.compat-chip { padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 700; }
.compat-chip.ally   { background: #E8F8EE; color: #1B5E20; }
.compat-chip.growth { background: #E8F0FB; color: #0D47A1; }

/* Tips */
.tip-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F0F3FA; align-items: flex-start; }
.tip-item:last-child { border-bottom: none; }
.tip-num {
  background: var(--navy); color: #fff; width: 24px; height: 24px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.tip-item p { font-size: 14px; color: var(--text); margin: 0; line-height: 1.6; }

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 600px) {
  .navbar { padding: 12px 16px; }
  .q-card { padding: 24px 16px; }
  .likert-row { gap: 6px; }
  .likert-btn { padding: 10px 4px; font-size: 12px; min-width: 56px; }
  .archetype-name { font-size: 26px; }
  .save-banner { flex-direction: column; align-items: flex-start; }
  .strength-grid { grid-template-columns: 1fr; }
  .results-wrap { padding: 20px 12px 48px; }
}
