:root {
  --primary: #5731ED;
  --primary-dark: #4626c9;
  --accent: #D6568A;
  --bg: #F6F5F3;
  --text: #18072B;
  --text-secondary: #7A7085;
  --white: #FFFFFF;
  --border: rgba(24, 7, 43, 0.12);
  --border-soft: rgba(24, 7, 43, 0.06);
  --font-title: 'Bricolage Grotesque', 'Inter Tight', system-ui, sans-serif;
  --font-body: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow-card: 0 1px 2px rgba(24,7,43,.04), 0 24px 60px -30px rgba(87,49,237,.28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
::selection { background: rgba(214, 86, 138, .22); }

@keyframes qEnter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.container { max-width: 620px; margin: 0 auto; padding: 52px 24px 72px; }
.container.wide { max-width: 720px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 245, 243, .86);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 86, 138, .16);
}
.logo-name { font-family: var(--font-title); font-weight: 700; font-size: 1.02rem; }
.q-count { font-size: .82rem; font-weight: 600; color: var(--text-secondary); }
.progress-track { height: 3px; background: rgba(24, 7, 43, .07); }
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 0 99px 99px 0;
  transition: width .5s var(--ease);
}

/* ---------- Typography ---------- */
.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin: 0;
}
h1 {
  font-family: var(--font-title); font-weight: 700; line-height: 1.22;
  margin: 0 0 24px; font-size: clamp(1.9rem, 4.6vw, 2.6rem);
  letter-spacing: -.01em; text-wrap: balance;
}
.lede { font-size: 1.08rem; color: var(--text-secondary); text-wrap: pretty; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-title); font-weight: 600; cursor: pointer;
  border-radius: 999px; border: none; text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-hero {
  font-size: 1.05rem; padding: 16px 40px;
  box-shadow: 0 12px 30px -10px rgba(87, 49, 237, .5);
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px rgba(87, 49, 237, .6); }
.btn-hero:active { transform: translateY(0) scale(.98); }
.btn-nav-next { font-size: .98rem; padding: 12px 26px; }
.btn-nav-prev {
  font-size: .98rem; font-weight: 600; padding: 12px 22px; border-radius: 999px;
  background: transparent; border: 1.5px solid var(--border); color: var(--text-secondary);
  cursor: pointer; transition: border-color .18s var(--ease), color .18s var(--ease);
}
.btn-nav-prev:hover { border-color: var(--text-secondary); color: var(--text); }
.btn-nav-next:disabled { opacity: .4; cursor: not-allowed; }
.btn-cta {
  display: inline-block; font-size: 1.05rem; padding: 16px 38px;
  background: var(--accent); color: var(--white);
  box-shadow: 0 14px 34px -14px rgba(214, 86, 138, .6);
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px rgba(214, 86, 138, .7); text-decoration: none; color: var(--white); }
.btn-cta:active { transform: translateY(0) scale(.98); }
.btn-restart {
  font-size: .92rem; font-weight: 600; padding: 10px 20px; border-radius: 999px;
  background: transparent; border: none; color: var(--text-secondary);
  cursor: pointer; transition: color .18s var(--ease);
}
.btn-restart:hover { color: var(--text); }

/* ---------- Screens ---------- */
.screen.hidden { display: none; }

.intro { text-align: center; }
.intro .container { max-width: 620px; padding-top: 88px; padding-bottom: 96px; }
.intro-rule { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 22px; }
.intro-rule span.line { width: 26px; height: 1px; background: var(--accent); opacity: .5; }
.intro .lede { max-width: 520px; margin: 0 auto 40px; }

/* ---------- Question ---------- */
.question-card {
  background: var(--white); border: 1px solid var(--border); border-radius: 22px;
  padding: clamp(28px, 5vw, 44px); box-shadow: var(--shadow-card);
  animation: qEnter .42s var(--ease) both;
}
.q-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.q-number { font-family: var(--font-title); font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.q-divider { width: 1px; height: 16px; background: var(--border); }
.q-category { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.q-text {
  font-family: var(--font-title); font-weight: 700; line-height: 1.28; margin: 0 0 28px;
  font-size: clamp(1.35rem, 3.3vw, 1.68rem); letter-spacing: -.005em; text-wrap: pretty;
}
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex; align-items: flex-start; gap: 14px; padding: 17px 20px;
  border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; background: var(--white);
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.option:hover { border-color: var(--accent); }
.option.selected {
  border-color: var(--primary); background: rgba(87, 49, 237, .055);
  box-shadow: 0 8px 22px -12px rgba(87, 49, 237, .4);
}
.option-dot {
  position: relative; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); margin-top: 2px; transition: border-color .18s var(--ease);
}
.option.selected .option-dot { border-color: var(--primary); }
.option.selected .option-dot::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary);
}
.option span { font-size: 1rem; line-height: 1.5; }
.nav-row { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; gap: 16px; }

/* ---------- Results ---------- */
.results { animation: fadeIn .5s ease both; }
.results-title {
  font-family: var(--font-title); font-weight: 700; line-height: 1.2; margin: 0 0 28px;
  font-size: clamp(1.7rem, 4vw, 2.2rem); letter-spacing: -.01em;
}
.map-card {
  background: var(--white); border: 1px solid var(--border); border-radius: 22px;
  padding: clamp(24px, 4vw, 36px); box-shadow: var(--shadow-card);
}
.map-legend {
  display: flex; flex-wrap: wrap; gap: 6px 18px; padding-bottom: 20px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border); font-size: .74rem; color: var(--text-secondary);
}
.map-legend b { color: var(--text); font-weight: 700; }
.dept-row { display: flex; align-items: center; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--border-soft); }
.dept-row:last-child { border-bottom: none; }
.dept-name { flex: 0 0 160px; font-size: .92rem; font-weight: 600; }
.dept-bar-bg { flex: 1; height: 12px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.dept-bar-fill {
  height: 100%; width: 0%; border-radius: 99px; background: var(--primary);
  transition: width 1.1s var(--ease);
}
.dept-bar-fill.weak { background: var(--accent); }
.dept-score { flex: 0 0 42px; text-align: right; font-size: .9rem; font-weight: 700; }
.dept-score.weak { color: var(--accent); }

.reco-header { margin: 52px 0 8px; }
.reco-lede { font-size: 1.05rem; color: var(--text-secondary); margin: 0 0 28px; max-width: 560px; text-wrap: pretty; }
.reco-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 48px; }
.reco-item {
  background: var(--white); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 14px; padding: 24px 28px;
  box-shadow: 0 1px 2px rgba(24,7,43,.04), 0 16px 40px -30px rgba(87,49,237,.3);
  animation: fadeUp .55s var(--ease) both;
}
.reco-item-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.reco-num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  color: var(--white); font-size: .82rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.reco-tag { font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.reco-item p { margin: 0; font-size: 1rem; line-height: 1.62; text-wrap: pretty; }

.cta-card {
  background: var(--text); color: var(--white); border-radius: 24px;
  padding: clamp(32px, 5vw, 48px); text-align: center; position: relative; overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(24, 7, 43, .6);
}
.cta-glow {
  position: absolute; top: -60px; right: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 86, 138, .35), transparent 70%);
}
.cta-inner { position: relative; }
.cta-card h3 {
  font-family: var(--font-title); font-weight: 700; color: var(--white);
  font-size: clamp(1.4rem, 3.4vw, 1.8rem); line-height: 1.25; margin: 0 0 14px; text-wrap: balance;
}
.cta-card p { color: rgba(255, 255, 255, .72); margin: 0 auto 30px; font-size: 1.05rem; max-width: 460px; text-wrap: pretty; }
.restart-row { text-align: center; margin-top: 28px; }

/* ---------- Email gate ---------- */
.email-form {
  display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; max-width: 520px;
  animation: fadeUp .5s var(--ease) both;
}
.email-input {
  flex: 1 1 240px; min-width: 0; font-family: var(--font-body); font-size: 1.02rem;
  padding: 15px 18px; border: 1.5px solid var(--border); border-radius: 999px;
  background: var(--white); color: var(--text);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.email-input::placeholder { color: var(--text-secondary); }
.email-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(87, 49, 237, .12);
}
.email-form .btn-hero { flex: 0 0 auto; }
.email-error { color: var(--accent); font-size: .92rem; font-weight: 600; margin: 0 0 10px; }
.email-note { color: var(--text-secondary); font-size: .86rem; margin: 8px 0 0; max-width: 560px; text-wrap: pretty; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 36px 24px 48px; color: var(--text-secondary); font-size: .85rem; }
.site-footer p { margin: 0; font-style: italic; font-family: var(--font-title); }

@media (max-width: 600px) {
  .dept-name { flex-basis: 116px; font-size: .82rem; }
}
