:root {
  color-scheme: dark;
  --ink: #f5fbff;
  --muted: #bed1e3;
  --blue: #38a3ff;
  --blue-soft: #74d7ff;
  --navy: #071a35;
  --deep: #020914;
  --line: rgba(167, 211, 255, .2);
  --panel: rgba(8, 28, 57, .78);
  --white-panel: rgba(245, 251, 255, .07);
  --shadow: 0 25px 70px rgba(0, 0, 0, .35);
  --radius: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(49, 157, 255, .22), transparent 31rem),
    radial-gradient(circle at 88% 25%, rgba(70, 215, 255, .12), transparent 28rem),
    linear-gradient(150deg, #020914 0%, #06162d 52%, #041021 100%);
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

button, a { font: inherit; }
button { color: inherit; }
a { color: var(--blue-soft); }

.aurora {
  position: fixed;
  width: 60vw;
  height: 60vw;
  left: 50%;
  top: -46vw;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #2aa1ff;
  filter: blur(110px);
  opacity: .13;
  pointer-events: none;
}

.site-header {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

.back-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: .01em;
}

.lang-switch {
  display: flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(2, 9, 20, .72);
}

.lang-btn {
  min-width: 44px;
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  background: transparent;
  cursor: pointer;
  font-weight: 850;
}

.lang-btn.active { background: var(--blue); color: #001124; }

main, footer {
  width: min(1040px, calc(100% - 32px));
  margin-inline: auto;
}

.hero {
  min-height: 70vh;
  padding: clamp(64px, 11vw, 126px) 0 72px;
  text-align: center;
  display: grid;
  place-items: center;
  align-content: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 9px 14px;
  border: 1px solid rgba(110, 210, 255, .38);
  border-radius: 999px;
  color: #bfeeff;
  background: rgba(28, 123, 190, .14);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .13em;
}

.eyebrow, .card-kicker, .question-topic {
  color: var(--blue-soft);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero .eyebrow { margin: 28px 0 3px; }
h1 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(3.2rem, 10vw, 7.2rem);
  line-height: .91;
  letter-spacing: -.07em;
  text-wrap: balance;
  background: linear-gradient(115deg, #fff 16%, #8bdcff 54%, #fff 89%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy {
  max-width: 710px;
  margin: 28px auto 0;
  color: var(--muted);
  font-size: clamp(1.03rem, 2.3vw, 1.32rem);
  text-wrap: balance;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin: 28px 0 24px;
  color: #dcefff;
  font-size: .9rem;
}

.primary-btn, .secondary-btn {
  border-radius: 999px;
  padding: 13px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 850;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.primary-btn {
  color: #001124;
  background: linear-gradient(100deg, #89ecff, #4bacff 60%, #8ce8ff);
  box-shadow: 0 12px 32px rgba(60, 173, 255, .24);
}

.secondary-btn {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255,255,255,.045);
}

.primary-btn:hover, .secondary-btn:hover { transform: translateY(-2px); }
.primary-btn:disabled { opacity: .36; cursor: not-allowed; transform: none; box-shadow: none; }
.disclaimer { max-width: 650px; color: #90a9be; font-size: .78rem; margin: 18px 0 0; }

.hidden { display: none !important; }

.quiz-shell, .results, .official {
  scroll-margin-top: 20px;
  margin-bottom: 80px;
}

.quiz-shell {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(4, 19, 40, .78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.quiz-topline { display: flex; justify-content: space-between; color: var(--muted); font-size: .84rem; font-weight: 800; }
.quiz-topline p { margin: 0 0 10px; }
.progress-track { height: 6px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.08); }
.progress-fill { height: 100%; width: 10%; border-radius: inherit; background: linear-gradient(90deg, #4aa9ff, #7ceaff); transition: width .28s ease; }

.question-card { padding: clamp(28px, 6vw, 58px) clamp(3px, 5vw, 52px) 36px; }
.question-number { color: rgba(137, 220, 255, .23); font-size: 4rem; line-height: 1; font-weight: 950; letter-spacing: -.08em; }
.question-topic { margin: -12px 0 8px 62px; }
.question-card h2 { margin: 16px 0 8px; font-size: clamp(1.55rem, 4vw, 2.65rem); line-height: 1.13; text-wrap: balance; }
.question-help { color: var(--muted); margin: 0 0 24px; }

.answers { display: grid; gap: 11px; }
.answer-option {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 15px 17px;
  border: 1px solid rgba(169, 214, 255, .17);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255,255,255,.035);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.answer-option:hover { transform: translateX(3px); border-color: rgba(127, 220, 255, .5); }
.answer-letter { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--blue-soft); background: rgba(73, 170, 255, .12); font-weight: 900; }
.answer-option.selected { border-color: #6fd8ff; background: rgba(63, 165, 255, .16); box-shadow: inset 0 0 0 1px rgba(111, 216, 255, .25); }
.answer-option.selected .answer-letter { color: #001225; background: #78ddff; }
.choice-note { margin: 14px 0 0; color: var(--blue-soft); font-size: .84rem; }

.quiz-actions, .results-actions { display: flex; justify-content: space-between; gap: 12px; }

.results { animation: reveal .5s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(15px); } }
.results-heading { text-align: center; margin-bottom: 28px; }
.results-heading h2, .official h2 { margin: 3px 0 8px; font-size: clamp(2rem, 6vw, 4rem); line-height: 1; letter-spacing: -.045em; }
.results-heading p:last-child, .official > p { color: var(--muted); }

.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.profile-card, .priority-card, .summary-card, .next-step-card, .party-match-card, .community-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.party-match-card { margin-bottom: 18px; padding: clamp(20px, 4vw, 32px); border-color: rgba(120, 221, 255, .32); background: linear-gradient(145deg, rgba(15, 57, 96, .72), rgba(5, 20, 42, .94)); }
.party-match-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.party-match-intro h3 { margin: 0 0 7px; font-size: clamp(1.45rem, 4vw, 2.25rem); line-height: 1.06; }
.party-match-intro p:not(.card-kicker) { max-width: 700px; margin: 0; color: var(--muted); }
.approx-badge { flex: 0 0 auto; padding: 8px 11px; border: 1px solid rgba(255, 211, 107, .4); border-radius: 999px; color: #ffe49a; background: rgba(255, 193, 49, .09); font-size: .67rem; font-weight: 900; letter-spacing: .1em; }
.party-ranking { display: grid; gap: 10px; }
.party-result { display: grid; grid-template-columns: 36px 1fr auto; gap: 15px; align-items: start; padding: 16px; border: 1px solid rgba(177, 218, 255, .13); border-left: 4px solid var(--party-color); border-radius: 17px; background: rgba(2, 13, 29, .52); }
.party-result.winner { border-color: color-mix(in srgb, var(--party-color) 65%, white 12%); box-shadow: 0 10px 28px rgba(0, 0, 0, .22); transform: scale(1.012); }
.party-rank { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #051525; background: var(--party-color); font-weight: 950; }
.party-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.party-name-row h4 { margin: 0; font-size: 1.2rem; }
.party-name-row h4 span { margin-left: 5px; color: var(--muted); font-size: .83rem; font-weight: 700; }
.closest-label { padding: 4px 8px; border-radius: 999px; color: #00142b; background: #8be8ff; font-size: .67rem; font-weight: 950; text-transform: uppercase; }
.score-track { height: 5px; margin: 10px 0 11px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.score-track span { display: block; height: 100%; border-radius: inherit; background: var(--party-color); }
.party-reasons { display: grid; gap: 5px; }
.party-reasons p { margin: 0; color: var(--muted); font-size: .84rem; }
.party-reasons b { color: #d9f5ff; }
.party-result-main > a { display: inline-block; margin-top: 9px; color: var(--blue-soft); font-size: .78rem; font-weight: 800; text-decoration: none; }
.party-result-main > a:hover { text-decoration: underline; }
.party-score { min-width: 58px; text-align: right; }
.party-score strong { display: block; color: #fff; font-size: 1.25rem; }
.party-score span { color: var(--muted); font-size: .68rem; }
.party-match-note { margin: 16px 0 0; color: #8ea9bd; font-size: .75rem; }
.community-card { margin: 0 0 18px; padding: clamp(20px, 4vw, 30px); background: linear-gradient(145deg, rgba(20, 38, 67, .92), rgba(6, 17, 35, .97)); }
.community-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; }
.community-heading h3 { margin: 0 0 7px; font-size: clamp(1.35rem, 4vw, 2rem); }
.community-heading p:not(.card-kicker) { max-width: 650px; margin: 0; color: var(--muted); }
.community-count { min-width: 108px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; text-align: center; background: rgba(255,255,255,.035); }
.community-count strong { display: block; color: var(--blue-soft); font-size: 1.45rem; }
.community-count span { color: var(--muted); font-size: .7rem; }
.community-ranking { display: grid; gap: 8px; margin: 20px 0; }
.community-row { display: grid; grid-template-columns: 28px 48px 1fr 58px; gap: 10px; align-items: center; }
.community-position { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #061424; background: var(--party-color); font-size: .76rem; font-weight: 950; }
.community-bar { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.075); }
.community-bar span { display: block; height: 100%; border-radius: inherit; background: var(--party-color); }
.community-row > b { text-align: right; font-variant-numeric: tabular-nums; }
.community-empty { margin: 0; padding: 18px; border: 1px dashed var(--line); border-radius: 15px; color: var(--muted); text-align: center; }
.community-consent { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.community-consent label { display: flex; align-items: flex-start; gap: 10px; max-width: 650px; color: #c5d9e8; font-size: .83rem; cursor: pointer; }
.community-consent input { width: 18px; height: 18px; accent-color: #66d8ff; }
.community-consent .primary-btn { flex: 0 0 auto; }
.community-status { min-height: 1.25em; margin: 12px 0 0; color: var(--muted); font-size: .82rem; }
.community-status.success { color: #88f1bd; }
.community-status.error { color: #ffb1ac; }
.community-caution { margin: 7px 0 0; color: #8199ad; font-size: .72rem; }
.profile-card { padding: 20px; }
.profile-card h3 { margin: 0; font-size: 1rem; }
.profile-answer { color: var(--blue-soft); font-weight: 850; margin: 8px 0 0; }
.profile-context { color: var(--muted); font-size: .86rem; margin: 7px 0 0; }

.priority-card, .summary-card, .next-step-card { margin-top: 14px; padding: clamp(20px, 4vw, 30px); }
.card-kicker { margin: 0 0 12px; }
.priority-list { display: flex; flex-wrap: wrap; gap: 9px; }
.priority-pill { padding: 8px 12px; border-radius: 999px; border: 1px solid rgba(117, 220, 255, .28); background: rgba(73, 170, 255, .11); }
.summary-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.summary-card p { margin: 0; }
.next-step-card h3 { margin: 0 0 8px; font-size: 1.35rem; }
.next-step-card > p:not(.card-kicker) { color: var(--muted); }
.question-prompts { display: grid; gap: 8px; margin-top: 17px; }
.research-prompt { padding: 13px 15px; border-left: 3px solid var(--blue); border-radius: 0 12px 12px 0; background: rgba(255,255,255,.04); }
.results-actions { margin-top: 18px; justify-content: center; flex-wrap: wrap; }

.official { padding-top: 22px; }
.official-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin-top: 26px; }
.official-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 1px 14px;
  align-items: center;
  min-height: 120px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: var(--white-panel);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}
.official-card:hover { transform: translateY(-3px); border-color: rgba(113, 220, 255, .58); }
.official-icon { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #001326; background: var(--blue-soft); font-size: 1.4rem; font-weight: 950; }
.official-card strong { font-size: 1.03rem; }
.official-card span:last-child { color: var(--muted); font-size: .84rem; }

.dates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--line); }
.dates div { min-height: 110px; padding: 18px; background: #07182f; display: flex; flex-direction: column; justify-content: center; }
.dates strong { color: var(--blue-soft); font-size: 1.15rem; }
.dates span { color: var(--muted); font-size: .83rem; }

footer { padding: 30px 0 45px; border-top: 1px solid var(--line); color: #91a9bd; text-align: center; font-size: .78rem; }
footer p { margin: 5px 0; }

@media (max-width: 720px) {
  .hero { min-height: auto; padding-top: 52px; }
  .profile-grid, .official-grid { grid-template-columns: 1fr; }
  .dates { grid-template-columns: 1fr; }
  .dates div { min-height: 82px; }
  .summary-card { align-items: stretch; flex-direction: column; }
  .party-match-intro { flex-direction: column; }
  .party-result { grid-template-columns: 32px 1fr; }
  .party-score { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; }
  .community-heading, .community-consent { align-items: stretch; flex-direction: column; }
  .community-count { width: 100%; }
  .community-consent .primary-btn { width: 100%; }
  .quiz-shell { padding: 14px; }
  .question-card { padding-top: 28px; }
  .quiz-actions { position: sticky; bottom: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: rgba(2, 9, 20, .9); backdrop-filter: blur(14px); }
  .quiz-actions button { flex: 1; }
}

@media (max-width: 430px) {
  .site-header { width: min(100% - 22px, 1040px); }
  main, footer { width: min(100% - 22px, 1040px); }
  .hero-badge { font-size: .64rem; }
  .trust-row { align-items: flex-start; flex-direction: column; }
  .question-topic { margin-left: 48px; }
  .question-number { font-size: 3rem; }
  .answer-option { padding: 13px 12px; }
}

@media print {
  body { background: #fff; color: #111; }
  body::before, .aurora, .site-header, .hero, .quiz-shell, .official, .results-actions, footer { display: none !important; }
  main { width: 100%; }
  .results { display: block !important; margin: 0; }
  .profile-card, .priority-card, .summary-card, .next-step-card, .party-match-card, .party-result, .community-card { color: #111; background: #fff; border: 1px solid #bbb; box-shadow: none; break-inside: avoid; }
  .profile-answer, .eyebrow, .card-kicker { color: #07589d; }
  .profile-context, .next-step-card > p:not(.card-kicker) { color: #333; }
  .summary-card button { display: none; }
}
