/* ============================================
   THEORY TEST PLATFORM — DESIGN SYSTEM
   GOV.UK-inspired light palette + blue accent
   Font: Plus Jakarta Sans
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  /* Dark surfaces — navbar only */
  --navy-950: #0b0c0c;
  /* Light theme backgrounds */
  --navy-900: #f8f8f8;     /* body background */
  --navy-800: #f3f2f1;     /* card / section surface */
  --navy-700: #ffffff;     /* input / elevated surface */
  --navy-600: #dee0e2;     /* subtle border / divider */
  --navy-500: #b1b4b6;     /* stronger border */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #0b0c0c;     /* primary text */
  --gray-400: #505a5f;     /* secondary text */
  --gray-500: #6f777b;     /* muted text */
  --gray-600: #b1b4b6;     /* disabled / very muted */
  --green-400: #4c89cc;    /* blue highlight */
  --green-500: #1d70b8;    /* GOV.UK blue — primary action */
  --green-600: #16548a;    /* darker blue */
  --green-700: #003078;    /* hover blue */
  --red-400: #d4351c;
  --red-500: #ca3535;      /* GOV.UK error red */
  --orange-400: #fb923c;
  --orange-500: #f97316;
  --yellow-400: #ffdd00;   /* GOV.UK focus yellow */

  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-green: 0 4px 24px rgba(29,112,184,0.2);
  --transition: 0.2s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--navy-900);
  color: var(--gray-300);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--green-500); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green-400); }

img { max-width: 100%; display: block; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-sm { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.container-xs { max-width: 540px; margin: 0 auto; padding: 0 16px; }

.section {
  padding: 80px 0;
}

.section-sm { padding: 48px 0; }

.grid {
  display: grid;
  gap: 24px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

.text-center { text-align: center; }
.text-left { text-align: left; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  color: var(--gray-300);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 3rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 2rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-green { color: var(--green-500); }
.text-white { color: var(--white); }
.text-gray { color: var(--gray-400); }
.text-red { color: var(--red-500); }
.text-orange { color: var(--orange-500); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-500);
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 12, 12, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 16px 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.02em;
  line-height: 1;
}

.nav-logo .logo-accent { color: var(--green-500); }

.nav-logo .logo-tld {
  color: var(--gray-500);
  font-weight: 500;
  font-size: 0.6em;
  letter-spacing: 0;
  vertical-align: middle;
  margin-left: 1px;
}

/* Light-background navbars — override white logo text */
.lp-header .nav-logo,
.navbar-minimal .nav-logo,
.auth-card .nav-logo,
.auth-page .nav-logo {
  color: var(--gray-300);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-links a:not(.btn) {
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color var(--transition);
}

.nav-links a:not(.btn):hover { color: var(--white); }

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

/* Hamburger lines */
.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  pointer-events: none;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0b0c0c;
    padding: 24px;
    border-bottom: 1px solid rgba(0,0,0,0.12);
  }
  .nav-mobile-toggle { display: flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--green-500);
  color: var(--white);
  box-shadow: var(--shadow-green);
}
.btn-primary:hover {
  background: var(--green-700);
  color: var(--white);
  box-shadow: 0 6px 28px rgba(29,112,184,0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--green-500);
  border: 1.5px solid var(--green-500);
}
.btn-secondary:hover {
  background: rgba(29,112,184,0.07);
  color: var(--green-400);
  border-color: var(--green-400);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-400);
  border: 1px solid var(--navy-500);
}
.btn-ghost:hover {
  background: var(--navy-800);
  color: var(--gray-300);
}

.btn-danger {
  background: var(--red-500);
  color: var(--white);
}
.btn-danger:hover { background: var(--red-400); }

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Cards ---------- */
.card {
  background: var(--navy-800);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition);
}

.card:hover {
  border-color: rgba(0,0,0,0.12);
}

.card-highlighted {
  border-color: var(--green-500);
  box-shadow: 0 0 0 1px var(--green-500), var(--shadow-green);
  position: relative;
}

.card-highlighted::before {
  content: 'RECOMMENDED';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green-500);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 16px;
  border-radius: 20px;
}

.card-header {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.card-body { flex: 1; }

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-300);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--navy-700);
  border: 1.5px solid var(--navy-500);
  border-radius: var(--radius);
  color: var(--gray-300);
  font-family: var(--font);
  font-size: 1rem; /* must be ≥16px to prevent iOS auto-zoom on focus */
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(29,112,184,0.12);
}

.form-input::placeholder { color: var(--gray-600); }

.form-textarea { resize: vertical; min-height: 100px; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-error {
  font-size: 0.8rem;
  color: var(--red-400);
  margin-top: 4px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-green {
  background: rgba(29,112,184,0.1);
  color: var(--green-500);
}

.badge-orange {
  background: rgba(249,115,22,0.12);
  color: var(--orange-400);
}

.badge-red {
  background: rgba(239,68,68,0.12);
  color: var(--red-400);
}

.badge-blue {
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
}

.badge-gray {
  background: rgba(148,163,184,0.12);
  color: var(--gray-400);
}

/* ---------- Hero Section ---------- */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(29,112,184,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  max-width: 700px;
  margin: 0 auto 20px;
  position: relative;
}

.hero p {
  max-width: 560px;
  margin: 0 auto;
  font-size: 0.95rem;
  color: var(--gray-400);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 36px;
  flex-wrap: wrap;
}

.hero-trust {
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--gray-500);
}

.hero-trust strong { color: var(--gray-300); }

.hero-sub {
  font-size: 0.95rem;
  color: var(--gray-400);
  max-width: 540px;
  margin: 16px auto 0;
  line-height: 1.65;
}

.hero-signup-form {
  max-width: 560px;
  margin: 0 auto;
}

.hero-form-fields {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.hero-form-input {
  flex: 1;
  min-width: 0;
}

.hero-trust-item {
  font-size: 0.82rem;
  color: var(--gray-500);
}

@media (max-width: 768px) {
  .hero { padding: 60px 0 48px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; max-width: 320px; }
  .hero-form-fields { flex-direction: column; }
  .hero-form-input { width: 100%; }
}

/* ---------- Subscription UI ---------- */
.sub-warning-banner {
  background: rgba(245,158,11,0.1);
  border-bottom: 1px solid rgba(245,158,11,0.2);
  color: #f59e0b;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 12px 20px;
  text-align: center;
}

.subscription-info-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  flex-wrap: wrap;
}

.sub-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
}

.sub-active { background: rgba(29,112,184,0.1); color: var(--green-500); border: 1px solid rgba(29,112,184,0.2); }
.sub-pastdue { background: rgba(245,158,11,0.12); color: #f59e0b; border: 1px solid rgba(245,158,11,0.25); }
.sub-cancelling { background: rgba(148,163,184,0.1); color: var(--gray-400); border: 1px solid rgba(148,163,184,0.2); }

.sub-info-text {
  font-size: 0.82rem;
  color: var(--gray-500);
  flex: 1;
}

.sub-manage-btn {
  font-size: 0.82rem;
  color: var(--green-500);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  padding: 0;
  margin-left: auto;
  text-decoration: none;
}

.sub-manage-btn:hover { text-decoration: underline; }

.btn-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font);
  color: var(--green-500);
  font-size: 0.875rem;
  font-weight: 600;
}

/* ---------- Feature Cards ---------- */
.feature-card {
  text-align: center;
  padding: 36px 28px;
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: rgba(29,112,184,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.5rem;
}

.feature-card h3 { margin-bottom: 10px; font-size: 1.2rem; }
.feature-card p { font-size: 0.9rem; color: var(--gray-400); }

/* ---------- Steps ---------- */
.step-card {
  text-align: center;
  padding: 32px 24px;
  position: relative;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-500);
  color: var(--white);
  font-weight: 800;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.step-card h4 { margin-bottom: 8px; }
.step-card p { font-size: 0.9rem; color: var(--gray-400); }

/* ---------- Pricing Cards ---------- */
.pricing-card {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
}

.pricing-price {
  font-size: 3rem;
  font-weight: 800;
  color: var(--gray-300);
  line-height: 1;
  margin: 16px 0 8px;
}

.pricing-price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-400);
}

.pricing-features {
  list-style: none;
  margin: 24px 0;
  flex: 1;
}

.pricing-features li {
  padding: 8px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
}

.pricing-features li::before {
  content: '✓';
  color: var(--green-500);
  font-weight: 700;
  flex-shrink: 0;
}

.pricing-features li.disabled {
  color: var(--gray-500);
  text-decoration: line-through;
}

.pricing-features li.disabled::before {
  content: '—';
  color: var(--gray-600);
}

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: var(--gray-300);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--green-500);
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-item.open .faq-question::after {
  content: '−';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding-bottom: 20px;
}

.faq-answer p {
  font-size: 0.9rem;
  color: var(--gray-400);
  line-height: 1.7;
}

/* ---------- Guarantee Banner ---------- */
.guarantee-section {
  background: linear-gradient(135deg, rgba(29,112,184,0.07), rgba(29,112,184,0.04));
  border: 1px solid rgba(29,112,184,0.12);
  border-radius: var(--radius-xl);
  padding: 48px;
  text-align: center;
}

.guarantee-section h2 { margin-bottom: 16px; }
.guarantee-section p { max-width: 640px; margin: 0 auto; font-size: 0.95rem; }

@media (max-width: 768px) {
  .guarantee-section { padding: 32px 20px; }
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 36px 0 28px;
  text-align: center;
  background: var(--navy-800);
}

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--gray-500);
  font-size: 0.82rem;
  text-decoration: none;
}
.footer-links a:hover { color: var(--gray-300); }

.footer-disclaimer {
  font-size: 0.78rem;
  color: var(--gray-500);
  max-width: 680px;
  margin: 0 auto 10px;
  line-height: 1.55;
  padding: 0 16px;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin: 0;
}

/* index.html uses footer-auth — align to same style */
.footer-auth {
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 36px 0 28px;
  text-align: center;
  background: var(--navy-800);
}

.footer-auth-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-auth-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 6px;
}

.footer-auth-links a {
  font-size: 0.82rem;
  color: var(--gray-500);
  text-decoration: none;
}
.footer-auth-links a:hover { color: var(--gray-300); }

.footer-auth-copy {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin: 0;
}

/* ---------- Progress Bar ---------- */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--navy-700);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-600), var(--green-400));
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ---------- Timer ---------- */
.timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--navy-800);
  border: 1px solid var(--navy-600);
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-300);
  font-variant-numeric: tabular-nums;
}

.timer.warning { color: var(--orange-400); }
.timer.danger { color: var(--red-400); animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ---------- Question Navigation ---------- */
.question-nav {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.question-nav-item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(0,0,0,0.12);
  background: var(--navy-700);
  color: var(--gray-400);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.question-nav-item:hover { border-color: var(--gray-400); }
.question-nav-item.current { border-color: var(--green-500); color: var(--green-500); }
.question-nav-item.answered { background: var(--green-600); border-color: var(--green-600); color: var(--white); }
.question-nav-item.flagged { border-color: var(--orange-400); color: var(--orange-400); }
.question-nav-item.flagged.answered { background: var(--orange-500); border-color: var(--orange-500); color: var(--white); }

@media (max-width: 768px) {
  .question-nav { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- Option Buttons ---------- */
.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  background: var(--navy-700);
  border: 1.5px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  color: var(--gray-300);
  font-family: var(--font);
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}

.option-btn:hover {
  border-color: var(--green-500);
  background: rgba(29,112,184,0.06);
  color: var(--green-700);
}

.option-btn.selected {
  border-color: var(--green-500);
  background: rgba(29,112,184,0.08);
  color: var(--gray-300);
}

.option-btn.correct {
  border-color: var(--green-500);
  background: rgba(29,112,184,0.1);
  color: var(--green-400);
}

.option-btn.incorrect {
  border-color: var(--red-500);
  background: rgba(239,68,68,0.1);
  color: var(--red-400);
}

.option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.option-btn.selected .option-letter {
  background: var(--green-500);
  color: var(--white);
}

/* ---------- Results Overlay ---------- */
.blur-overlay {
  position: relative;
  min-height: 620px;
}

.blur-overlay .blur-content {
  filter: blur(8px);
  user-select: none;
  pointer-events: none;
}

.blur-overlay .blur-cta {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 24px;
  z-index: 10;
  overflow-y: auto;
}

.blur-cta-card {
  background: var(--navy-800);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  text-align: center;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
}

/* ---------- Dashboard Stat Cards ---------- */
.stat-card {
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-300);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 4px;
  font-weight: 500;
}

/* ---------- Status Badge ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-pending { background: rgba(249,115,22,0.12); color: var(--orange-400); }
.status-searching { background: rgba(59,130,246,0.12); color: #60a5fa; }
.status-booked { background: rgba(29,112,184,0.1); color: var(--green-500); }
.status-confirmed { background: rgba(29,112,184,0.15); color: var(--green-400); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--navy-800);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(10px);
  transition: transform 0.25s ease;
}

.modal-backdrop.open .modal { transform: translateY(0); }

/* ---------- Auth Pages ---------- */
/* ---------- Success Steps ---------- */
.success-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.success-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(29,112,184,0.1);
  border: 1.5px solid rgba(29,112,184,0.25);
  color: var(--green-500);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.success-step-title {
  font-weight: 700;
  color: var(--gray-300);
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.success-step-desc {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin: 0;
  line-height: 1.5;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--navy-800);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
}

@media (max-width: 480px) {
  .auth-page { padding: 16px; align-items: flex-start; padding-top: 32px; }
  .auth-card { padding: 28px 20px; }
}

.auth-tabs {
  display: flex;
  background: var(--navy-800);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
  border: 1px solid var(--navy-600);
}

.auth-tab {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--gray-500);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.auth-tab.active {
  background: var(--white);
  color: var(--gray-300);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.auth-error {
  font-size: 0.85rem;
  color: #ca3535;
  background: rgba(202,53,53,0.06);
  border: 1px solid rgba(202,53,53,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  text-align: center;
}

.auth-success {
  font-size: 0.85rem;
  color: var(--green-500);
  background: rgba(29,112,184,0.08);
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  text-align: center;
}

/* ---------- Dashboard Layout ---------- */
.dashboard-page {
  min-height: 100vh;
  padding-top: 0;
}

.dashboard-header {
  background: var(--navy-800);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 20px 0;
}

/* ── Dashboard Hero ── */
.dashboard-hero {
  background: var(--navy-800);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 32px 0;
  margin-bottom: 0;
}

.dashboard-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.dashboard-greeting {
  font-size: 0.9rem;
  color: var(--green-500);
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

.dashboard-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gray-300);
  margin: 0;
}

.dashboard-stats-row {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--navy-700);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 28px;
  gap: 2px;
}

.dash-stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gray-300);
  line-height: 1;
}

.dash-stat-label {
  font-size: 0.7rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.dash-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(0,0,0,0.1);
}

/* ── Section labels ── */
.dash-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin: 0 0 14px;
}

/* ── Action Grid ── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.action-card {
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: var(--radius-lg);
  background: var(--navy-800);
  border: 1px solid rgba(0,0,0,0.08);
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0,0,0,0.15);
  background: var(--navy-700);
}

.action-card--disabled {
  opacity: 0.5;
  cursor: default;
}

.action-card--disabled:hover {
  transform: none;
  border-color: rgba(0,0,0,0.08);
  background: var(--navy-800);
}

.action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-icon--green { background: rgba(29,112,184,0.1); color: var(--green-500); }
.action-icon--blue  { background: rgba(99,179,237,0.12); color: #63b3ed; }
.action-icon--amber { background: rgba(245,158,11,0.12); color: #f59e0b; }
.action-icon--gray  { background: rgba(0,0,0,0.08); color: var(--gray-400); }

.action-body {
  flex: 1;
  min-width: 0;
}

.action-body h4 {
  margin: 0 0 3px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-300);
}

.action-body p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-arrow {
  font-size: 1rem;
  color: var(--gray-600);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.action-card:hover .action-arrow {
  transform: translateX(3px);
  color: var(--gray-400);
}

.coming-soon-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: 6px;
}

/* ── Results empty state ── */
.results-empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--navy-800);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-lg);
}

.results-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--gray-500);
}

@media (max-width: 640px) {
  .dashboard-hero-inner { flex-direction: column; align-items: flex-start; }
  .dashboard-stats-row { width: 100%; justify-content: space-around; }
  .dash-stat { padding: 12px 16px; }
  .action-grid { grid-template-columns: 1fr; }
  .action-body p { white-space: normal; }
}

.dashboard-content {
  padding: 32px 0;
}

/* ---------- Admin Table ---------- */
.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,0.08);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 900px;
}

.admin-table th {
  background: var(--navy-800);
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-400);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-bottom: 2px solid var(--navy-500);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  color: var(--gray-300);
  vertical-align: top;
}

.admin-table tr:hover td {
  background: rgba(0,0,0,0.02);
}

.admin-table .notes-input {
  width: 100%;
  min-width: 200px;
  padding: 8px 10px;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-sm);
  color: var(--gray-300);
  font-family: var(--font);
  font-size: 0.8rem;
  resize: vertical;
}

.admin-table select {
  padding: 6px 10px;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-sm);
  color: var(--gray-300);
  font-family: var(--font);
  font-size: 0.8rem;
  cursor: pointer;
}

/* ---------- Admin Summary Bar ---------- */
.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.admin-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--navy-700);
  border: 1px solid rgba(0,0,0,0.1);
  color: var(--gray-400);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover { border-color: var(--gray-400); color: var(--white); }
.filter-btn.active { background: var(--green-500); color: var(--white); border-color: var(--green-500); }

/* ---------- Guarantee Tracker ---------- */
.guarantee-tracker {
  padding: 28px;
}

.guarantee-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.guarantee-header h3 {
  margin: 0;
  font-size: 1rem;
}

.progress-bar-container {
  height: 8px;
  background: rgba(0,0,0,0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  background: var(--green-500);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.guarantee-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--gray-400);
  gap: 8px;
}

.guarantee-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.guarantee-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.guarantee-check.complete {
  background: var(--green-500);
  color: var(--white);
}

.guarantee-check.incomplete {
  background: var(--navy-700);
  color: var(--gray-500);
  border: 1.5px solid rgba(0,0,0,0.12);
}

/* ---------- Quick Action Grid ---------- */
.action-card {
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: block;
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: var(--green-500);
  box-shadow: var(--shadow-green);
}

.action-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: rgba(29,112,184,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}

.action-card h4 { margin-bottom: 6px; font-size: 1rem; }
.action-card p { font-size: 0.8rem; color: var(--gray-400); }

/* ---------- Test Results Detail ---------- */
.result-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.result-score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--green-500);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.result-score-circle.score-fail,
.result-score-circle.failed { border-color: var(--red-500); }

.result-score-circle .score,
.result-score-circle .score-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-300);
  line-height: 1;
}

.result-score-circle .out-of,
.result-score-circle .score-total {
  font-size: 0.8rem;
  color: var(--gray-400);
  line-height: 1.4;
}

.result-score-circle .score-percentage {
  font-size: 0.75rem;
  color: var(--gray-500);
  line-height: 1.4;
}

.result-score-circle .score-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--green-500);
  margin-top: 2px;
}

.result-score-circle.score-fail .score-label {
  color: var(--red-500);
}

.result-header {
  text-align: center;
  padding: 32px 0 24px;
}

/* ---------- Practice / Mock Results ---------- */
.category-breakdown {
  background: var(--navy-800);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.category-breakdown h3 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  margin: 0 0 16px;
}

.category-row {
  margin-bottom: 12px;
}

.category-row:last-child {
  margin-bottom: 0;
}

.category-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.category-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-300);
}

.category-score {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-400);
}

.category-bar-bg {
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.category-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ============================================================
   MOBILE-FIRST OVERRIDES — 375px target
   All rules below apply at ≤ 480px unless noted.
   ============================================================ */

/* ---------- Global container / layout ---------- */
@media (max-width: 480px) {
  .container,
  .container-sm,
  .container-xs {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Prevent any element from causing horizontal scroll */
  body { overflow-x: hidden; }

  /* Section vertical padding — 48px desktop → 32px mobile */
  .section    { padding: 32px 0; }
  .section-sm { padding: 24px 0; }
}

/* ---------- Typography ---------- */
@media (max-width: 480px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.15rem; }
  h4 { font-size: 1rem; }
}

/* ---------- Navbar (dark, used on dashboard / practice pages) ---------- */
@media (max-width: 480px) {
  .navbar {
    padding: 12px 0;
  }
  .nav-links.open {
    padding: 16px;
    gap: 4px;
  }
  .nav-links.open a {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 1rem;
  }
  .nav-mobile-toggle {
    padding: 8px;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
  }
  .nav-mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
  }
}

/* ---------- Buttons ---------- */
@media (max-width: 480px) {
  /* All large buttons go full-width */
  .btn-lg {
    width: 100%;
    min-height: 52px;
    font-size: 1rem;
  }
  /* Minimum tap target for all buttons */
  .btn {
    min-height: 44px;
  }
  .btn-sm {
    min-height: 40px;
  }
}

/* ---------- Cards ---------- */
@media (max-width: 480px) {
  .card {
    padding: 16px;
  }
  /* Remove hover transform on touch devices to avoid sticky states */
  .card:hover {
    transform: none;
  }
}

/* ---------- Forms ---------- */
@media (max-width: 480px) {
  /* CRITICAL: prevent iOS auto-zoom on focus */
  .form-input,
  .form-select,
  .form-textarea,
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .form-input,
  .form-select,
  .form-textarea {
    padding: 13px 14px;
    min-height: 48px;
  }
}

/* ---------- Hero (generic .hero class) ---------- */
@media (max-width: 480px) {
  .hero {
    padding: 48px 0 36px;
  }
  .hero h1 {
    font-size: 1.75rem;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn {
    width: 100%;
    max-width: 100%;
  }
  .hero-form-fields {
    flex-direction: column;
  }
}

/* ---------- FAQ ---------- */
@media (max-width: 480px) {
  .faq-question {
    padding: 18px 0;
    min-height: 56px;
    font-size: 0.95rem;
  }
  .faq-item.open .faq-answer {
    max-height: 600px; /* allow taller answers on mobile */
  }
}

/* ---------- Footer ---------- */
@media (max-width: 480px) {
  .footer {
    padding: 28px 0 20px;
  }
  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .footer-links a {
    font-size: 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  /* footer-auth (index.html) */
  .footer-auth {
    padding: 24px 0 20px;
  }
  .footer-auth-inner {
    text-align: center;
  }
  .footer-auth-links {
    flex-direction: column;
    gap: 12px;
  }
  .footer-auth-links a {
    font-size: 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ---------- index.html inline styles override ---------- */
@media (max-width: 480px) {
  /* Hero section */
  .hero-auth {
    padding: 40px 0 44px;
  }
  .hero-auth h1 {
    font-size: 1.75rem;
    margin-bottom: 16px;
  }
  .hero-cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .hero-cta-row .btn {
    width: 100%;
  }
  .hero-trust {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .hero-trust-chip {
    font-size: 0.88rem;
  }

  /* How it works steps — already collapses to 1 col via 480px rule in inline styles */

  /* What's included grid — already collapses via inline style */
  .included-card {
    padding: 16px;
  }

  /* Stats strip */
  .stats-inner h2 {
    font-size: 1.25rem;
  }
  .stat-num {
    font-size: 1.5rem;
    min-width: 56px;
  }
}

/* ---------- Booking progress bar (all booking pages) ---------- */
@media (max-width: 480px) {
  .booking-progress-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .bp-step {
    font-size: 0.72rem;
    padding-right: 10px;
    white-space: nowrap;
  }
  .bp-arrow {
    padding-right: 10px;
    flex-shrink: 0;
  }
}

/* ---------- centres.html ---------- */
@media (max-width: 480px) {
  .centres-hero {
    padding: 24px 0 20px;
  }
  .centres-hero h1 {
    font-size: 1.55rem;
  }
  .search-wrapper {
    margin-top: 20px;
    max-width: 100% !important;
  }
  .search-input {
    font-size: 16px !important;
    padding: 15px 52px 15px 16px;
  }
  /* Booking progress bar — hide labels on very small screens */
  .bp-step span:not(.bp-num) {
    display: none;
  }
  .bp-step.active span:not(.bp-num) {
    display: inline; /* keep active step label visible */
  }
  .centre-card {
    padding: 16px;
  }
}

/* ---------- book.html ---------- */
@media (max-width: 480px) {
  .booking-page {
    padding: 16px 0 48px;
  }
  .booking-card {
    padding: 16px;
    border-radius: 8px;
  }
  .summary-card {
    padding: 16px;
  }
  .summary-total-price {
    font-size: 1.6rem;
  }
  /* Date options — ensure full tap area */
  .date-option {
    padding: 14px 12px;
    min-height: 56px;
  }
  .date-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-top: 0;
  }
  /* Licence annotation — stack vertically, hide mini card on very small */
  .licence-annotation {
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
  }
  .licence-connector { display: none; }
  .licence-mini { min-width: 0; width: 100%; }
  .licence-zoom { align-self: flex-start; }
  /* Submit button */
  #submit-btn {
    min-height: 52px;
    font-size: 1rem;
  }
}

/* ---------- payment.html ---------- */
@media (max-width: 480px) {
  .payment-page {
    padding: 20px 0 80px;
  }
  /* Summary sidebar becomes a normal block, no sticky on mobile */
  .payment-summary {
    position: static;
    top: auto;
  }
  #checkout-container {
    padding: 16px;
  }
  .booking-recap {
    padding: 14px 16px;
  }
}

/* ---------- dashboard.html ---------- */
@media (max-width: 480px) {
  .dashboard-hero {
    padding: 20px 0;
  }
  .dashboard-title {
    font-size: 1.45rem;
  }
  .dashboard-hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .dashboard-stats-row {
    width: 100%;
  }
  .dash-stat {
    padding: 10px 12px;
    flex: 1;
  }
  .dash-stat-value {
    font-size: 1.1rem;
  }
  .dash-stat-label {
    font-size: 0.62rem;
  }
  .dashboard-content {
    padding: 20px 0;
  }
  /* Booking status card */
  #booking-card {
    padding: 16px !important;
  }
  /* Guarantee tracker */
  .guarantee-tracker {
    padding: 16px;
  }
  .guarantee-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .guarantee-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  /* Action grid already collapses to 1-col at 640px */
  .action-card {
    padding: 14px;
    min-height: 72px;
  }
}

/* ---------- practice-theory-test.html ---------- */
@media (max-width: 480px) {
  /* Email capture card */
  #email-capture .card {
    padding: 28px 16px;
  }
  /* Timer top bar */
  .timer {
    font-size: 0.95rem;
    padding: 6px 12px;
  }
  /* Option buttons — full width, good tap height */
  .option-btn {
    padding: 14px 14px;
    font-size: 0.9rem;
    min-height: 52px;
  }
  .option-letter {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    flex-shrink: 0;
  }
  /* Question nav — already 5 cols at 768px */
  .question-nav {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }
  .question-nav-item {
    min-height: 36px;
  }
  /* Blur CTA card */
  .blur-cta-card {
    padding: 28px 20px;
  }
  /* Modal buttons */
  #finish-modal > div {
    padding: 24px 16px;
  }
  #finish-modal > div > div {
    flex-direction: column;
  }
  #finish-modal .btn {
    width: 100%;
  }
}

/* ---------- Misc utilities ---------- */
@media (max-width: 480px) {
  /* Result summary 2-col → 1-col */
  .result-summary {
    grid-template-columns: 1fr;
  }
  /* Guarantee section padding */
  .guarantee-section {
    padding: 24px 16px;
  }
  /* Auth card */
  .auth-card {
    padding: 24px 16px;
  }
  /* Modal */
  .modal {
    padding: 24px 16px;
  }
}

.category-bar.bar-good { background: var(--green-500); }
.category-bar.bar-weak { background: #f59e0b; }

/* Wrong answers review */
.wrong-answers-review {
  margin-bottom: 24px;
}

.wrong-answers-review h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-300);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.wrong-answer-item {
  background: var(--navy-800);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
}

.wrong-q-text {
  font-size: 0.9rem;
  color: var(--gray-300);
  margin: 0 0 8px;
  line-height: 1.5;
}

.wrong-user-answer,
.wrong-correct-answer {
  font-size: 0.82rem;
  color: var(--gray-400);
  margin: 0 0 4px;
}

.answer-wrong {
  color: var(--red-500);
  font-weight: 600;
}

.answer-correct {
  color: var(--green-500);
  font-weight: 600;
}

.wrong-explanation {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.06);
  line-height: 1.55;
  font-style: italic;
}

.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 24px 0 8px;
}

.result-actions .btn {
  flex: 1;
  min-width: 160px;
  text-align: center;
  justify-content: center;
}

/* ---------- Hazard Results ---------- */
.hazard-score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 5px solid var(--green-500);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 0 32px rgba(29,112,184,0.15);
}

.hazard-score-circle.fail {
  border-color: #f59e0b;
  box-shadow: 0 0 32px rgba(245, 158, 11, 0.2);
}

.hazard-score-number {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--gray-300);
  line-height: 1;
}

.hazard-score-denom {
  font-size: 1rem;
  color: var(--gray-400);
  margin-top: 2px;
}

.hazard-result-badge {
  display: inline-block;
  margin-top: 20px;
  padding: 5px 18px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hazard-result-badge.pass {
  background: rgba(52, 211, 153, 0.15);
  color: var(--green-500);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.hazard-result-badge.fail {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.hazard-breakdown-card {
  padding: 24px;
  margin-top: 32px;
}

.hazard-breakdown-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: 16px;
}

.hazard-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  gap: 16px;
}

.hazard-breakdown-row:last-child {
  border-bottom: none;
}

.hazard-breakdown-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-300);
}

.hazard-breakdown-score {
  text-align: right;
  flex-shrink: 0;
}

.hazard-dots-row {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.hazard-dot {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(0,0,0,0.12);
  border: 1.5px solid rgba(0,0,0,0.15);
}

.hazard-dot.filled {
  background: var(--green-500);
  border-color: var(--green-500);
  box-shadow: 0 0 6px rgba(29,112,184,0.4);
}

/* ---------- Category Selector ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.category-btn {
  padding: 16px;
  background: var(--navy-700);
  border: 1.5px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  color: var(--gray-300);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}

.category-btn:hover {
  border-color: var(--green-500);
  background: rgba(29,112,184,0.04);
  color: var(--green-500);
}

.category-btn .count,
.category-btn .category-count {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.category-btn .category-name {
  display: block;
  font-weight: 600;
  color: var(--gray-300);
  margin-bottom: 2px;
}

/* ---------- Notification Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 2000;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--green-600); color: var(--white); }
.toast-error { background: var(--red-500); color: var(--white); }

/* ---------- Loading Spinner ---------- */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(0,0,0,0.15);
  border-top-color: var(--green-500);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  background: rgba(0,0,0,0.08);
  margin: 32px 0;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ---------- Hidden ---------- */
.hidden { display: none !important; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--navy-800); }
::-webkit-scrollbar-thumb { background: var(--navy-500); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* ---------- Centre Search ---------- */
.centre-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.centre-search input {
  width: 100%;
  padding: 16px 56px 16px 20px;
  background: var(--white);
  border: 2px solid var(--navy-500);
  border-radius: var(--radius-lg);
  color: var(--gray-300);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: border-color var(--transition);
}

.centre-search input:focus { border-color: var(--green-500); }
.centre-search input::placeholder { color: var(--gray-400); }

.centre-search .geo-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--green-500);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background var(--transition);
}

.centre-search .geo-btn:hover { background: var(--green-400); }

/* ---------- Centre Cards ---------- */
.centre-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
}

.centre-card:hover {
  border-color: var(--green-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-green);
}

.centre-card h4 { margin: 0; font-size: 1.05rem; }
.centre-card .centre-address { font-size: 0.8rem; color: var(--gray-400); line-height: 1.5; flex: 1; }
.centre-card .centre-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.centre-card .centre-link { font-size: 0.85rem; font-weight: 600; color: var(--green-500); }

.centre-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) { .centre-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .centre-grid { grid-template-columns: 1fr; } }

.region-group { margin-bottom: 32px; }
.region-group h3 { margin-bottom: 16px; font-size: 1.1rem; color: var(--gray-400); }

/* ---------- Booking Layout ---------- */
.booking-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .booking-layout {
    grid-template-columns: 1fr;
  }
  .booking-layout .order-summary-col { order: -1; }
}

/* ---------- Order Summary ---------- */
.order-summary {
  position: sticky;
  top: 100px;
}

.order-summary .summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.9rem;
}

.order-summary .summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 0;
  border-top: 1px solid rgba(0,0,0,0.12);
  margin-top: 8px;
}

.order-summary .summary-total .price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gray-300);
}

.order-summary .includes-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
}

.order-summary .includes-list li {
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--gray-300);
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-summary .includes-list li::before {
  content: '✓';
  color: var(--green-500);
  font-weight: 700;
}

/* ---------- Trust Signals ---------- */
.trust-signals {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.trust-signal {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--gray-400);
  font-weight: 500;
}

.trust-signal-icon {
  font-size: 0.9rem;
}

/* ---------- Licence Annotation ---------- */
.licence-card {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 8px 0 16px;
  position: relative;
  max-width: 340px;
}

.licence-header {
  font-size: 0.6rem;
  font-weight: 700;
  color: #2e7d32;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.licence-header::before {
  content: 'L';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #c62828;
  color: white;
  font-size: 0.55rem;
  font-weight: 800;
  border-radius: 2px;
}

.licence-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.licence-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: #37474f;
  padding: 3px 0;
}

.licence-field .section-num {
  font-weight: 700;
  color: #546e7a;
  width: 16px;
}

.licence-field .field-value {
  font-weight: 600;
  color: #1b5e20;
}

.licence-field.highlighted {
  background: rgba(29,112,184,0.15);
  border-radius: 4px;
  padding: 4px 8px;
  margin: 2px -8px;
}

.licence-field.highlighted .field-value {
  color: var(--navy-900);
  font-weight: 700;
}

.licence-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--green-500);
  margin-top: 4px;
  font-weight: 500;
}

.licence-hint::before {
  content: '↑';
  font-weight: 700;
}

/* ---------- Value Stack ---------- */
.value-stack {
  padding: 36px 32px;
}

.value-stack-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.value-stack-item:last-child { border-bottom: none; }

.value-stack-item .check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(29,112,184,0.1);
  color: var(--green-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.value-stack-item .item-text {
  font-size: 0.95rem;
  color: var(--gray-300);
}

.value-stack-item .item-text strong { color: var(--gray-300); }

/* ---------- Section Divider (small) ---------- */
.divider-sm {
  height: 1px;
  background: rgba(0,0,0,0.08);
  margin: 16px 0;
}

/* ---------- Print ---------- */
@media print {
  .navbar, .footer, .btn { display: none; }
  body { background: white; color: black; }
}

/* ---------- Hazard Perception ---------- */
.hazard-video-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.clip-card {
  padding: 16px;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
}

.clip-card:hover {
  transform: translateY(-2px);
  border-color: rgba(29,112,184,0.25);
}

.clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

/* ---------- iOS auto-zoom prevention ---------- */
/* iOS zooms in on any input with font-size < 16px. */
/* This overrides any inline styles site-wide on mobile. */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ---------- Date input overflow fix ---------- */
/* iOS renders input[type=date] wider than its container by default */
input[type="date"] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

/* ── Question Image ── */
.question-image-hint {
  display: none;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 6px;
  margin-bottom: 0;
}

@media (max-width: 640px) {
  /* Full-bleed image on mobile — break out of container padding */
  #question-image-wrap {
    margin-left: calc(-1 * var(--container-px, 16px));
    margin-right: calc(-1 * var(--container-px, 16px));
    border-radius: 0;
  }

  #question-image-wrap img {
    max-height: none !important;
    width: 100%;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  .question-image-hint {
    display: block;
    padding: 0 16px;
  }
}
