/* ============================================================
   Canada Exams - Main Stylesheet
   Hand-crafted CSS with CSS variables for theme support
   Mobile-first, dark mode, responsive
   ============================================================ */

:root {
  --background: 248 250 252;
  --foreground: 15 23 42;
  --card: 255 255 255;
  --card-foreground: 15 23 42;
  --primary: 37 113 235;
  --primary-foreground: 255 255 255;
  --secondary: 241 245 249;
  --muted: 241 245 249;
  --muted-foreground: 100 116 139;
  --accent: 239 246 255;
  --accent-foreground: 29 91 216;
  --border: 226 232 240;
  --ring: 37 113 235;

  --brand-50: #eff8ff;
  --brand-100: #dbeefe;
  --brand-200: #bfe1fe;
  --brand-300: #93cefd;
  --brand-400: #60b0fa;
  --brand-500: #3b90f6;
  --brand-600: #2571eb;
  --brand-700: #1d5bd8;
  --brand-800: #1f4baf;
  --brand-900: #20418a;
  --brand-950: #182a54;

  --maple-500: #ef4444;
  --maple-600: #dc2626;
  --maple-700: #b91c1c;

  --radius: 0.75rem;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

[data-theme="dark"] {
  --background: 10 15 25;
  --foreground: 241 245 249;
  --card: 20 27 45;
  --card-foreground: 241 245 249;
  --primary: 96 176 250;
  --primary-foreground: 10 15 25;
  --secondary: 30 41 59;
  --muted: 30 41 59;
  --muted-foreground: 148 163 184;
  --accent: 29 78 216;
  --accent-foreground: 241 245 249;
  --border: 30 41 59;
  --ring: 96 176 250;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; border-color: rgb(var(--border)); }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background-color: rgb(var(--background));
  color: rgb(var(--foreground));
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'rlig' 1, 'calt' 1;
}
main { flex: 1; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.2;
}
ul, ol { list-style: none; }

/* ---------- Layout ---------- */
.container { max-width: 80rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

.max-w-xl { max-width: 36rem; margin-left: auto; margin-right: auto; }
.max-w-2xl { max-width: 42rem; margin-left: auto; margin-right: auto; }
.max-w-3xl { max-width: 48rem; margin-left: auto; margin-right: auto; }
.max-w-4xl { max-width: 56rem; margin-left: auto; margin-right: auto; }
.max-w-5xl { max-width: 64rem; margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--brand-600);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-primary:hover { background: var(--brand-700); }
[data-theme="dark"] .btn-primary { background: var(--brand-500); color: rgb(var(--background)); }
[data-theme="dark"] .btn-primary:hover { background: var(--brand-400); }

.btn-secondary {
  background: rgb(var(--card));
  border-color: rgb(var(--border));
  color: rgb(var(--foreground));
}
.btn-secondary:hover { background: rgb(var(--muted)); }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
.btn-danger {
  background: transparent;
  border-color: #fca5a5;
  color: var(--maple-600);
}
[data-theme="dark"] .btn-danger { color: #fca5a5; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: rgb(var(--card));
  border: 1px solid rgb(var(--border));
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-hover {
  transition: transform 0.3s, box-shadow 0.3s;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* ---------- Forms ---------- */
.input, input[type=text], input[type=password], input[type=number], input[type=email], input[type=url], select, textarea {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--card));
  color: rgb(var(--foreground));
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: border-color 0.15s;
}
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59, 144, 246, 0.15);
}
.input-sm { padding: 0.375rem 0.625rem; font-size: 0.8125rem; }
textarea { resize: vertical; min-height: 4rem; }
label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; }

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(248, 250, 252, 0.8);
  border-bottom: 1px solid rgb(var(--border));
}
[data-theme="dark"] .header { background: rgba(10, 15, 25, 0.85); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}
.brand-logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.125rem;
}
.brand-accent { color: var(--brand-600); }
[data-theme="dark"] .brand-accent { color: var(--brand-400); }
.nav { display: none; gap: 0.25rem; }
@media (min-width: 768px) { .nav { display: flex; align-items: center; } }
.nav a {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s;
}
.nav a:hover { background: rgb(var(--muted)); }

.icon-btn {
  height: 2.5rem;
  width: 2.5rem;
  border-radius: 9999px;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--card));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.icon-btn:hover { background: rgb(var(--muted)); }
.mobile-only { display: inline-flex; }
@media (min-width: 768px) { .mobile-only { display: none; } }

.mobile-nav { display: none; border-top: 1px solid rgb(var(--border)); padding: 0.75rem 0; flex-direction: column; }
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 0.75rem;
  border-radius: 0.375rem;
  font-weight: 500;
}
.mobile-nav a:hover { background: rgb(var(--muted)); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid rgb(var(--border));
  background: rgb(var(--card));
  margin-top: 5rem;
  padding: 3rem 0;
}
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer h3 { font-family: var(--font-sans); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.footer ul { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.875rem; }
.footer a { color: rgb(var(--muted-foreground)); transition: color 0.15s; }
.footer a:hover { color: var(--brand-600); }
.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(var(--border));
  display: flex; flex-direction: column; gap: 0.75rem;
  align-items: center; justify-content: space-between;
  font-size: 0.875rem; color: rgb(var(--muted-foreground));
}
@media (min-width: 768px) { .footer-bottom { flex-direction: row; } }

/* ---------- Hero (homepage) ---------- */
.hero { position: relative; overflow: hidden; padding: 4rem 0 5rem; text-align: center; }
@media (min-width: 768px) { .hero { padding: 6rem 0 7rem; } }
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-bg::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgb(239 246 255), transparent);
}
[data-theme="dark"] .hero-bg::before {
  background: linear-gradient(135deg, rgba(32, 65, 138, 0.2), transparent);
}
.hero-blob {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: 0.4;
}
.hero-blob-1 { top: 5rem; right: -8rem; width: 24rem; height: 24rem; background: rgba(191, 225, 254, 0.5); }
[data-theme="dark"] .hero-blob-1 { background: rgba(29, 91, 216, 0.3); }
.hero-blob-2 { top: -5rem; left: -5rem; width: 20rem; height: 20rem; background: rgba(254, 202, 202, 0.4); }
[data-theme="dark"] .hero-blob-2 { background: rgba(153, 27, 27, 0.25); }

.hero h1 {
  font-size: clamp(2.25rem, 5vw + 1rem, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero .highlight { color: var(--brand-600); }
[data-theme="dark"] .hero .highlight { color: var(--brand-400); }
.hero .lede {
  margin: 1.5rem auto 0;
  max-width: 40rem;
  font-size: clamp(1rem, 0.5vw + 0.95rem, 1.25rem);
  color: rgb(var(--muted-foreground));
  text-wrap: balance;
}
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 2.5rem; }

.badge-row {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.375rem 1rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--card));
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgb(var(--muted-foreground));
  margin-bottom: 1.5rem;
}

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  max-width: 32rem; margin: 3rem auto 0;
}
.stat-value { font-family: var(--font-display); font-size: clamp(1.75rem, 3vw + 0.5rem, 2.25rem); font-weight: 700; }
.stat-label { font-size: 0.75rem; color: rgb(var(--muted-foreground)); margin-top: 0.25rem; }

/* ---------- Section helpers ---------- */
.section { padding: 3rem 0; }
@media (min-width: 768px) { .section { padding: 4rem 0; } }
.section-title { font-size: clamp(1.5rem, 2vw + 1rem, 2.5rem); letter-spacing: -0.02em; }
.section-sub { color: rgb(var(--muted-foreground)); margin-top: 0.5rem; }

/* ---------- Test cards (featured grid) ---------- */
.tests-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; margin-top: 2rem; }
@media (min-width: 640px) { .tests-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tests-grid { grid-template-columns: repeat(3, 1fr); } }

.test-card { overflow: hidden; display: flex; flex-direction: column; }
.test-cover {
  position: relative; height: 12rem;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
  color: #fff;
  overflow: hidden;
}
.test-cover-pattern {
  position: absolute; inset: 0; opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23fff' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.test-cover-icon {
  width: 3.5rem; height: 3.5rem; border-radius: 1rem;
  background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(8px);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 0.75rem;
}
.test-cover-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; z-index: 1; position: relative; text-align: center; }

.cover-signs { background: linear-gradient(135deg, #15803d, #064e3b); }
.cover-rules { background: linear-gradient(135deg, #1d4ed8, #1e3a8a); }

.soon-badge {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: var(--maple-500); color: #fff;
  font-size: 0.75rem; font-weight: 600;
  padding: 0.25rem 0.625rem; border-radius: 9999px;
  z-index: 2;
}

.test-card-body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.test-meta { display: flex; gap: 0.5rem; font-size: 0.75rem; color: rgb(var(--muted-foreground)); margin-bottom: 0.5rem; }
.test-meta .num { font-weight: 600; color: var(--brand-600); }
[data-theme="dark"] .test-meta .num { color: var(--brand-400); }

.test-card-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.test-card-desc { font-size: 0.875rem; color: rgb(var(--muted-foreground)); margin-bottom: 1rem; flex: 1; }

.features-inline { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-size: 0.875rem; margin-bottom: 1.25rem; }
.feature-check { display: inline-flex; align-items: center; gap: 0.375rem; color: rgb(var(--muted-foreground)); }
.feature-check svg { color: var(--brand-500); width: 1rem; height: 1rem; flex-shrink: 0; }

/* ---------- Handbook icons (test detail page) ---------- */
.handbook-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin-top: 2rem; }
@media (min-width: 640px) { .handbook-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .handbook-grid { grid-template-columns: repeat(4, 1fr); } }

.handbook-card {
  padding: 1.5rem;
  display: flex; flex-direction: column;
  transition: box-shadow 0.2s;
}
.handbook-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.06); }
.handbook-icon {
  width: 3rem; height: 3rem; border-radius: 0.75rem;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.icon-pink { background: #fce7f3; color: #db2777; }
.icon-blue { background: #dbeafe; color: #2563eb; }
.icon-green { background: #d1fae5; color: #059669; }
.icon-purple { background: #ede9fe; color: #7c3aed; }
[data-theme="dark"] .icon-pink { background: rgba(157, 23, 77, 0.3); color: #f9a8d4; }
[data-theme="dark"] .icon-blue { background: rgba(30, 64, 175, 0.3); color: #93c5fd; }
[data-theme="dark"] .icon-green { background: rgba(6, 95, 70, 0.3); color: #6ee7b7; }
[data-theme="dark"] .icon-purple { background: rgba(91, 33, 182, 0.3); color: #c4b5fd; }

.handbook-card h3 { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.5rem; }
.handbook-card p { font-size: 0.875rem; color: rgb(var(--muted-foreground)); margin-bottom: 1rem; flex: 1; }
.link-arrow { color: var(--brand-600); font-weight: 600; font-size: 0.875rem; display: inline-flex; align-items: center; gap: 0.25rem; }
[data-theme="dark"] .link-arrow { color: var(--brand-400); }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Quiz preview cards ---------- */
.quizzes-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; margin-top: 2rem; }
@media (min-width: 640px) { .quizzes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .quizzes-grid { grid-template-columns: repeat(3, 1fr); } }

.quiz-card-cover { position: relative; height: 11rem; overflow: hidden; color: #fff; display: flex; align-items: center; justify-content: center; }
.quiz-card-cover.signs { background: linear-gradient(135deg, #059669, #047857 60%, #065f46); }
.quiz-card-cover.rules { background: linear-gradient(135deg, #1e40af, #1e3a8a, #172554); }
.quiz-card-body { padding: 1.25rem; }
.quiz-card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.quiz-card-title { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; }

.difficulty-badge {
  font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.125rem 0.5rem; border-radius: 9999px; border: 1px solid;
}
.diff-easy { border-color: var(--brand-300); color: var(--brand-700); }
.diff-medium { border-color: #fcd34d; color: #b45309; }
.diff-hard { border-color: #fca5a5; color: var(--maple-700); }
[data-theme="dark"] .diff-easy { color: var(--brand-300); }
[data-theme="dark"] .diff-medium { color: #fcd34d; }
[data-theme="dark"] .diff-hard { color: #fca5a5; }

.quiz-stats { display: flex; gap: 1rem; font-size: 0.875rem; color: rgb(var(--muted-foreground)); margin-bottom: 1.25rem; }
.quiz-stats span { display: inline-flex; align-items: center; gap: 0.375rem; }
.quiz-stats svg { width: 1rem; height: 1rem; color: var(--brand-500); }

.quiz-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.75rem; border-top: 1px solid rgb(var(--border));
}
.quiz-card-footer span { font-size: 0.875rem; color: rgb(var(--muted-foreground)); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: 0.875rem; color: rgb(var(--muted-foreground)); margin-bottom: 1rem; }
.breadcrumbs a:hover { color: var(--brand-600); }
.breadcrumbs .current { color: rgb(var(--foreground)); }

/* ---------- Test hero ---------- */
.test-hero { position: relative; padding: 3rem 0; border-bottom: 1px solid rgb(var(--border)); overflow: hidden; }
@media (min-width: 768px) { .test-hero { padding: 4rem 0; } }
.test-hero-bg { position: absolute; inset: 0; background: linear-gradient(135deg, rgb(239 246 255), transparent); z-index: -1; }
[data-theme="dark"] .test-hero-bg { background: linear-gradient(135deg, rgba(32, 65, 138, 0.15), transparent); }
.test-hero .province { display: inline-block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand-600); margin-bottom: 0.75rem; }
[data-theme="dark"] .test-hero .province { color: var(--brand-400); }
.test-hero h1 { font-size: clamp(1.875rem, 3vw + 1rem, 3rem); letter-spacing: -0.02em; text-wrap: balance; }
.test-hero p { margin-top: 1rem; font-size: 1.125rem; color: rgb(var(--muted-foreground)); text-wrap: balance; max-width: 48rem; }

/* ---------- Handbook page ---------- */
.handbook-page-title { text-align: center; margin-bottom: 1.5rem; }
.handbook-page-title h1 { font-size: clamp(1.25rem, 2vw + 1rem, 1.75rem); }
.handbook-page-title p { font-size: 0.875rem; color: rgb(var(--muted-foreground)); margin-top: 0.25rem; }

.handbook-content { padding: 1.5rem; }
@media (min-width: 768px) { .handbook-content { padding: 2.5rem; } }
.handbook-content p { font-size: 0.95rem; line-height: 1.7; margin: 1rem 0; }
.handbook-content h2 { font-size: 1.375rem; margin: 2rem 0 0.75rem; font-weight: 700; }
.handbook-content h3 { font-size: 1.125rem; margin: 1.5rem 0 0.5rem; font-weight: 700; }
.handbook-content img { max-width: 180px; border-radius: 0.375rem; margin: 0.5rem 0; }
.handbook-content ul { list-style: disc; margin: 1rem 0; padding-left: 1.5rem; }
.handbook-content ul li { margin: 0.5rem 0; }

.pagination-wrap { margin-top: 2rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.pagination {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem; border-radius: 9999px;
  border: 1px solid rgb(var(--border)); background: rgb(var(--card));
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2rem; min-width: 2rem; padding: 0 0.625rem;
  font-size: 0.875rem; border-radius: 9999px;
  color: rgb(var(--muted-foreground));
  transition: background 0.15s;
}
.pagination a:hover { background: rgb(var(--muted)); }
.pagination .active { background: var(--brand-600); color: #fff; }
.pagination .disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Quiz runner ---------- */
.quiz-progress { height: 6px; border-radius: 9999px; background: rgb(var(--muted)); overflow: hidden; margin-bottom: 1.5rem; }
.quiz-progress-bar { height: 100%; background: var(--brand-500); transition: width 0.3s; }

.quiz-shell { padding: 1.5rem; }
@media (min-width: 768px) { .quiz-shell { padding: 2rem; } }
.quiz-shell h1 { font-size: 1.375rem; }
.quiz-shell hr { border: 0; border-top: 1px solid rgb(var(--border)); margin: 1rem 0; }
.quiz-count { text-align: center; color: rgb(var(--muted-foreground)); font-size: 0.875rem; margin-bottom: 0.75rem; }
.quiz-image { max-width: 18rem; margin: 0 auto 1.25rem; border: 1px solid rgb(var(--border)); border-radius: 0.75rem; padding: 0.5rem; background: rgb(var(--card)); }
.quiz-question { font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; text-align: center; line-height: 1.5; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .quiz-question { font-size: 1.25rem; } }

.quiz-options { display: flex; flex-direction: column; gap: 0.625rem; }
.quiz-option {
  display: block; width: 100%; text-align: left;
  padding: 0.875rem 1rem; font-size: 0.95rem;
  border: 2px solid rgb(var(--border));
  background: rgb(var(--card));
  color: rgb(var(--foreground));
  border-radius: 0.75rem;
  transition: all 0.15s;
}
.quiz-option:hover:not(:disabled) { border-color: var(--brand-400); }
.quiz-option.correct { border-color: #10b981; background: #ecfdf5; color: #065f46; }
.quiz-option.wrong { border-color: var(--maple-500); background: #fef2f2; color: #991b1b; }
.quiz-option.dimmed { opacity: 0.6; }
[data-theme="dark"] .quiz-option.correct { background: rgba(6, 95, 70, 0.2); color: #a7f3d0; }
[data-theme="dark"] .quiz-option.wrong { background: rgba(153, 27, 27, 0.2); color: #fca5a5; }

.quiz-explanation {
  margin-top: 1.25rem; text-align: center;
  font-size: 0.95rem; color: rgb(var(--muted-foreground));
  line-height: 1.6;
}
.quiz-next-wrap { margin-top: 1.5rem; display: flex; justify-content: center; }

/* Quiz results */
.quiz-result {
  text-align: center; padding: 2rem 1.5rem;
}
@media (min-width: 768px) { .quiz-result { padding: 3rem 2rem; } }
.quiz-result-icon {
  width: 5rem; height: 5rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9999px; margin-bottom: 1.25rem;
}
.quiz-result-icon.pass { background: #d1fae5; color: #059669; }
.quiz-result-icon.fail { background: #fee2e2; color: var(--maple-600); }
[data-theme="dark"] .quiz-result-icon.pass { background: rgba(6, 95, 70, 0.3); color: #6ee7b7; }
[data-theme="dark"] .quiz-result-icon.fail { background: rgba(153, 27, 27, 0.3); color: #fca5a5; }
.quiz-result h1 { font-size: 2rem; margin-bottom: 0.5rem; }

.result-progress { height: 12px; border-radius: 9999px; background: rgb(var(--muted)); overflow: hidden; margin: 1.5rem 0; }
.result-progress-bar { height: 100%; }
.result-progress-bar.pass { background: #10b981; }
.result-progress-bar.fail { background: var(--maple-500); }

.review-list { text-align: left; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgb(var(--border)); }
.review-item { display: flex; gap: 0.75rem; padding: 0.5rem 0; font-size: 0.875rem; }
.review-item svg { flex-shrink: 0; margin-top: 0.125rem; }

/* ---------- Prose ---------- */
.prose { max-width: 65ch; }
.prose h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 0.75rem; }
.prose p { margin: 1rem 0; line-height: 1.7; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin: 1rem 0; }
.prose li { margin: 0.5rem 0; }
.prose strong { font-weight: 700; }
.prose a { color: var(--brand-600); text-decoration: underline; }
[data-theme="dark"] .prose a { color: var(--brand-400); }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 6rem 1rem; max-width: 32rem; margin: 0 auto; }
.not-found .code { font-family: var(--font-display); font-size: 6rem; font-weight: 700; color: var(--brand-600); margin-bottom: 1rem; line-height: 1; }
[data-theme="dark"] .not-found .code { color: var(--brand-400); }
.not-found h1 { font-size: 1.875rem; margin-bottom: 0.75rem; }

/* ---------- Utility classes ---------- */
.text-center { text-align: center; }
.text-muted { color: rgb(var(--muted-foreground)); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; } .mb-8 { margin-bottom: 2rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; }
.hidden { display: none; }

/* ---------- Alert / message ---------- */
.alert { padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; border: 1px solid; }
.alert-error { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.alert-success { border-color: #6ee7b7; background: #ecfdf5; color: #065f46; }
[data-theme="dark"] .alert-error { background: rgba(153, 27, 27, 0.2); color: #fca5a5; }
[data-theme="dark"] .alert-success { background: rgba(6, 95, 70, 0.2); color: #a7f3d0; }

/* ---------- Admin styles ---------- */
.admin-bar {
  border-bottom: 1px solid rgb(var(--border)); background: rgb(var(--card));
}
.admin-bar .container { display: flex; align-items: center; justify-content: space-between; padding: 0.625rem 1rem; }
.admin-crumb { font-size: 0.875rem; }
.admin-crumb strong { margin-right: 0.5rem; }
.admin-crumb .sep { color: rgb(var(--muted-foreground)); margin: 0 0.5rem; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table tr { border-bottom: 1px solid rgb(var(--border)); }
.admin-table tr:last-child { border-bottom: 0; }
.admin-table td { padding: 1rem 1.25rem; vertical-align: middle; }
.admin-table tr:hover { background: rgba(var(--muted), 0.5); }

.status-pill { display: inline-block; padding: 0.125rem 0.5rem; font-size: 0.75rem; font-weight: 600; border-radius: 9999px; }
.status-active { color: #059669; }
.status-soon { color: #d97706; }

.admin-section-card { border: 1px solid rgb(var(--border)); border-radius: 0.75rem; background: rgb(var(--card)); margin-bottom: 1rem; }
.admin-section-head {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem;
}
.admin-section-head input { flex: 1; border: none; background: transparent; font-weight: 600; padding: 0.25rem; }
.admin-section-head input:focus { outline: 1px solid var(--brand-400); border-radius: 0.25rem; }
.admin-section-icon {
  width: 2rem; height: 2rem; border-radius: 0.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.admin-section-body { border-top: 1px solid rgb(var(--border)); padding: 1rem; display: none; }
.admin-section-card.open .admin-section-body { display: block; }

.admin-nested {
  border: 1px solid rgb(var(--border)); border-radius: 0.5rem;
  padding: 0.75rem; margin: 0.5rem 0; background: rgba(var(--muted), 0.3);
}
.admin-nested-head { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }

.danger-zone {
  border: 1px solid #fca5a5;
  background: rgba(254, 226, 226, 0.3);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-top: 2.5rem;
}
[data-theme="dark"] .danger-zone { background: rgba(153, 27, 27, 0.1); }

/* ---------- Animations ---------- */
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.slide-up { animation: slideUp 0.5s ease-out; }

/* ---------- Print & reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
