/* ── Variables ───────────────────────────────────────────── */
:root {
  --blue:       #2774AE;
  --blue-dark:  #1a5276;
  --blue-light: #e8f1f9;
  --gold:       #FFD100;
  --gold-dark:  #c9a800;
  --white:      #ffffff;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-500:   #6b7280;
  --gray-700:   #374151;
  --gray-900:   #111827;
  --radius:     12px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.08);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ──────────────────────────────────────────────── */
.page-wrapper {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, #3a8fd1 100%);
  margin: 0 -16px;
  padding: 56px 32px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 60px,
    rgba(255,209,0,.04) 60px,
    rgba(255,209,0,.04) 62px
  );
}
.header-inner { position: relative; z-index: 1; }

.ucla-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .12em;
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.site-header h1 {
  color: var(--white);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.subtitle {
  color: rgba(255,255,255,.8);
  font-size: 1.05rem;
  font-weight: 400;
}

/* ── Intro card ──────────────────────────────────────────── */
.intro-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  margin: 28px 0 20px;
  border-left: 4px solid var(--gold);
}
.intro-card p {
  color: var(--gray-700);
  font-size: .97rem;
  margin-bottom: 10px;
}
.intro-card p:last-of-type { margin-bottom: 14px; }
.intro-card strong { color: var(--gray-900); }

.anon-note {
  font-size: .85rem !important;
  color: var(--gray-500) !important;
  font-style: italic;
  margin-bottom: 16px !important;
}

.check-counter {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-weight: 600;
  font-size: .92rem;
  padding: 6px 16px;
  border-radius: 100px;
}
.check-counter #checkedCount,
.check-counter #liveScore {
  font-weight: 700;
  color: var(--blue);
}

/* ── Questions ───────────────────────────────────────────── */
.questions-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 8px 0;
  margin-bottom: 20px;
}

.question-list {
  list-style: none;
  counter-reset: q-counter;
  padding: 0;
}

.question-list li {
  counter-increment: q-counter;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 28px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background .12s ease;
  user-select: none;
}
.question-list li:last-child { border-bottom: none; }
.question-list li:hover { background: var(--gray-50); }
.question-list li.checked { background: var(--blue-light); }

.question-list li input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--blue);
  cursor: pointer;
}

.q-number {
  flex-shrink: 0;
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-500);
  min-width: 26px;
  padding-top: 1px;
  text-align: right;
}

.q-text {
  font-size: .96rem;
  color: var(--gray-700);
  line-height: 1.5;
}
.question-list li.checked .q-text {
  color: var(--blue-dark);
}

/* special styling for #69 */
.question-list li.q-69 .q-text {
  color: var(--gray-500);
  font-style: italic;
  letter-spacing: .1em;
}

/* ── Calculate bar ───────────────────────────────────────── */
.calculate-bar {
  text-align: center;
  padding: 8px 0 24px;
}

#calculateBtn {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 16px 48px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 100px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
  letter-spacing: .01em;
}
#calculateBtn:hover {
  background: var(--blue-dark);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
#calculateBtn:active { transform: translateY(0); }

/* ── Results ─────────────────────────────────────────────── */
.results-section {
  margin-top: 8px;
  animation: fadeUp .4s ease;
}
.results-section.hidden { display: none; }

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

.results-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 48px 32px 40px;
  text-align: center;
  border-top: 5px solid var(--gold);
}

.score-circle {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: var(--white);
  padding: 28px 36px;
  border-radius: 50%;
  margin-bottom: 24px;
  box-shadow: 0 8px 30px rgba(39,116,174,.35);
  min-width: 160px;
  justify-content: center;
}

.score-number {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
}

.score-out-of {
  font-size: 1.1rem;
  opacity: .75;
  font-weight: 500;
  align-self: flex-end;
  padding-bottom: 4px;
}

.score-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 12px;
}

.score-desc {
  font-size: 1rem;
  color: var(--gray-700);
  max-width: 480px;
  margin: 0 auto 20px;
  line-height: 1.65;
}

.score-breakdown {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: .85rem;
  padding: 6px 18px;
  border-radius: 100px;
  margin-bottom: 28px;
}

#retakeBtn {
  background: transparent;
  border: 2px solid var(--blue);
  color: var(--blue);
  padding: 12px 36px;
  font-size: .96rem;
  font-weight: 600;
  border-radius: 100px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
#retakeBtn:hover {
  background: var(--blue);
  color: var(--white);
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 32px 0 0;
  color: var(--gray-500);
  font-size: .83rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 520px) {
  .site-header { padding: 40px 20px 36px; }
  .intro-card  { padding: 20px; }
  .question-list li { padding: 12px 16px; }
  .results-card { padding: 36px 20px 32px; }
  .score-circle { padding: 22px 28px; min-width: 130px; }
  .score-number { font-size: 2.8rem; }
}
