/* ═══════════════════════════════════════════════════════════
   THE HSC ENGINE – styles.css
   Colour system: Deep navy nav · Clean white cards · Blue accents
   Built on the HSC Strategy prototype, refactored for The Engine
═══════════════════════════════════════════════════════════ */

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

/* ── DESIGN TOKENS ── */
:root {
  /* Blues */
  --navy:         #08142e;   /* Navbar, darkest */
  --navy-mid:     #0f2044;   /* Hero section */
  --blue-800:     #1d4289;   /* Primary brand blue */
  --blue-700:     #1a56db;   /* Primary CTA / buttons */
  --blue-600:     #2563eb;   /* Hover state */
  --blue-400:     #60a5fa;   /* Light accent */
  --blue-200:     #bfdbfe;   /* Chips, badges */
  --blue-100:     #dbeafe;   /* Light tint backgrounds */
  --blue-50:      #eff6ff;   /* Ghost backgrounds */

  /* Neutrals */
  --white:        #ffffff;
  --gray-50:      #f8fafc;
  --gray-100:     #f1f5f9;
  --gray-200:     #e2e8f0;
  --gray-300:     #cbd5e1;
  --gray-400:     #94a3b8;
  --gray-500:     #64748b;
  --gray-700:     #334155;
  --gray-900:     #0f172a;

  /* Semantic aliases */
  --bg:           var(--gray-50);
  --card:         var(--white);
  --text:         var(--gray-900);
  --text-muted:   var(--gray-500);
  --border:       var(--gray-200);
  --primary:      var(--blue-700);
  --primary-dark: var(--blue-800);
  --primary-hover:var(--blue-600);

  /* Spacing & shape */
  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    18px;
  --shadow:       0 2px 12px rgba(8,20,46,0.08);
  --shadow-md:    0 4px 24px rgba(8,20,46,0.12);
  --shadow-lg:    0 8px 40px rgba(8,20,46,0.16);

  /* Typography */
  --font-head:    'Montserrat', sans-serif;
  --font-body:    'Inter', sans-serif;
}

/* ── RESET / BASE ── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a, [role="button"] { cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════════════════════ */
#main-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 64px;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  gap: 16px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo-mark.sm { width: 30px; height: 30px; font-size: 0.9rem; border-radius: 7px; }

.logo-text { display: flex; flex-direction: column; }

.logo-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.logo-by {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1;
  margin-top: 2px;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 0.83rem;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  transition: all 0.18s;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }

.nav-cta {
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
}

.nav-cta:hover { background: var(--primary-hover); }

.nav-mobile-cta {
  display: none;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 600;
  padding: 9px 14px;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   VIEWS
═══════════════════════════════════════════════════════════ */
.view { display: none; }
.view.active { display: block; }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.18s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(29,86,219,0.35);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.25);
}

.btn-ghost:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.07);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  font-family: var(--font-body);
}

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

/* ═══════════════════════════════════════════════════════════
   SECTIONS / LAYOUT
═══════════════════════════════════════════════════════════ */
.section {
  padding: 72px 2rem;
}

.section-alt {
  background: var(--white);
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

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

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
  text-align: center;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--gray-900);
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.25;
}

.section-sub {
  font-size: 0.975rem;
  color: var(--text-muted);
  line-height: 1.7;
  text-align: center;
  max-width: 520px;
  margin: 0 auto 52px;
}

/* Page header (courses / topics / videos pages) */
.page-header {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 48px 2rem 44px;
  text-align: center;
}

.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  margin-bottom: 14px;
}

.breadcrumb span {
  cursor: pointer;
  transition: color 0.15s;
}

.breadcrumb span:hover { color: rgba(255,255,255,0.8); }

.bc-sep { color: rgba(255,255,255,0.25); }
.bc-current { color: rgba(255,255,255,0.6); cursor: default !important; }

.page-header h2 {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.page-header p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.6);
  max-width: 480px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════
   HOME – HERO
═══════════════════════════════════════════════════════════ */
.hero {
  background: linear-gradient(140deg, var(--navy) 0%, var(--navy-mid) 55%, #102555 100%);
  padding: 80px 2rem 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  min-height: 540px;
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 30%, rgba(29,86,219,0.14) 0%, transparent 55%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 540px;
  flex-shrink: 0;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--blue-400);
  margin-bottom: 20px;
  background: rgba(96,165,250,0.1);
  border: 1px solid rgba(96,165,250,0.25);
  padding: 5px 14px;
  border-radius: 20px;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.18;
  margin-bottom: 20px;
}

.hero-highlight { color: var(--blue-400); }

.hero-sub {
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.68);
  margin-bottom: 36px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.38);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Hero visual card */
.hero-visual {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.hero-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 300px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.hc-header {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.hc-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}

.hc-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.hc-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 20px;
}

.hc-chip {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.1);
}

.hc-chip.selected {
  background: rgba(29,86,219,0.3);
  color: var(--blue-200);
  border-color: rgba(29,86,219,0.5);
}

.hc-stat-row {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}

.hc-stat { flex: 1; text-align: center; }
.hc-stat-val { display: block; font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; color: #fff; }
.hc-stat-lbl { display: block; font-size: 0.63rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.8px; margin-top: 2px; }

.hc-btn {
  background: var(--primary);
  color: #fff;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 10px;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════
   HOME – HOW IT WORKS
═══════════════════════════════════════════════════════════ */
.steps-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
}

.step {
  flex: 1;
  padding: 0 24px;
  text-align: center;
}

.step-n {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--blue-200);
  line-height: 1;
  margin-bottom: 14px;
}

.step h3 {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 10px;
}

.step p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.step-divider {
  font-size: 1.4rem;
  color: var(--gray-300);
  padding-top: 14px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   HOME – FEATURES
═══════════════════════════════════════════════════════════ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}

.feature {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.feature:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon { font-size: 1.6rem; margin-bottom: 14px; }

.feature h4 {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.feature p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════
   HOME – CTA BANNER
═══════════════════════════════════════════════════════════ */
.cta-banner {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  padding: 72px 2rem;
}

.cta-banner h2 {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.cta-banner p {
  color: rgba(255,255,255,0.65);
  font-size: 1rem;
  margin-bottom: 32px;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--navy);
  padding: 32px 2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-name {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.footer-by {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.footer-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  max-width: 420px;
  line-height: 1.6;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════
   COURSE SELECTION
═══════════════════════════════════════════════════════════ */
.courses-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 2rem 64px;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.course-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s;
  box-shadow: var(--shadow);
}

.course-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(29,86,219,0.1);
  transform: translateY(-3px);
}

.course-emoji { font-size: 2.2rem; margin-bottom: 16px; display: block; }

.course-card h3 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.course-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.tag-std { background: var(--blue-100); color: var(--blue-800); }
.tag-adv { background: #e0f2fe; color: #075985; }
.tag-e1  { background: #f3e8ff; color: #6d28d9; }
.tag-e2  { background: #fce7f3; color: #9d174d; }

.course-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   TOPIC SELECTION
═══════════════════════════════════════════════════════════ */
.topics-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 36px 2rem 64px;
}

.topics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.toolbar-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.topic-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topic-card:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
}

.topic-card.selected {
  border-color: var(--primary);
  background: var(--blue-50);
  box-shadow: 0 0 0 3px rgba(29,86,219,0.1);
}

.topic-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 5px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: transparent;
  transition: all 0.15s;
}

.topic-card.selected .topic-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.topic-info { min-width: 0; }

.topic-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.3;
}

.topic-q-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Generate bar */
.generate-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.gb-title {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.gb-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 6px;
}

.gb-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   PAPER VIEW
═══════════════════════════════════════════════════════════ */
.paper-toolbar {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.paper-toolbar-left {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.paper-wrapper {
  max-width: 860px;
  margin: 0 auto 64px;
  padding: 0 2rem;
}

/* The Paper itself */
.paper {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.paper-head {
  background: var(--navy);
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.paper-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.paper-logo-mark {
  width: 42px;
  height: 42px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
}

.paper-logo-text .logo-name { font-size: 1rem; }
.paper-logo-text .logo-by { font-size: 0.58rem; }

.paper-meta-block { text-align: right; }

.paper-meta-block h3 {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.paper-meta-block p {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
}

.paper-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--gray-200);
}

.stat-cell {
  padding: 16px 20px;
  text-align: center;
  border-right: 1px solid var(--gray-200);
}

.stat-cell:last-child { border-right: none; }

.stat-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gray-900);
  display: block;
}

.paper-instructions {
  padding: 16px 40px;
  background: var(--blue-50);
  border-bottom: 1px solid var(--blue-100);
  font-size: 0.8rem;
  color: var(--blue-800);
  line-height: 1.7;
}

.paper-student-row {
  padding: 18px 40px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.student-field { flex: 1; min-width: 160px; }

.student-field label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field-line {
  border-bottom: 1.5px solid var(--gray-300);
  height: 26px;
}

.paper-body { padding: 32px 40px; }

.paper-topic-section { margin-bottom: 36px; }

.paper-topic-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--gray-200);
  margin-bottom: 20px;
}

.q-item {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  break-inside: avoid;
}

.q-num-badge {
  width: 26px;
  height: 26px;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

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

/* Question image */
.q-image {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

/* Text fallback (shown when image missing) */
.q-text-fallback {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 8px;
  padding: 14px 16px;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.q-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.q-marks {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  padding: 2px 8px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.q-difficulty {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 5px;
  text-transform: capitalize;
}

.q-source {
  font-size: 0.65rem;
  color: var(--gray-400);
  margin-left: auto;
}

.q-answer-space {
  height: 72px;
  margin-top: 12px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 23px,
    var(--gray-300) 23px,
    var(--gray-300) 24px
  );
  background-size: 100% 24px;
}

.q-answer-space.lg { height: 96px; }
.q-answer-space.xl { height: 144px; }

.paper-foot {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 14px 40px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--gray-400);
}

/* ═══════════════════════════════════════════════════════════
   VIDEOS / COMING SOON
═══════════════════════════════════════════════════════════ */
.coming-soon-wrap {
  max-width: 620px;
  margin: 64px auto;
  padding: 0 2rem;
  text-align: center;
}

.coming-soon-card {
  background: var(--white);
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 56px 40px;
}

.cs-icon { font-size: 3.2rem; margin-bottom: 18px; }

.coming-soon-card h3 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.coming-soon-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 10px;
}

/* ═══════════════════════════════════════════════════════════
   LOADING OVERLAY
═══════════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,20,46,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 999;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ═══════════════════════════════════════════════════════════
   PRINT STYLES
═══════════════════════════════════════════════════════════ */
@media print {
  #main-nav,
  .paper-toolbar,
  .no-print,
  #loading-overlay {
    display: none !important;
  }

  body { background: white; }

  #view-paper { display: block !important; }

  .paper-wrapper {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .paper {
    border: none;
    box-shadow: none;
    border-radius: 0;
  }

  .paper-head,
  .paper-stats-bar,
  .paper-instructions,
  .paper-foot {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .q-item { break-inside: avoid; }

  .q-answer-space {
    break-inside: avoid;
    background-image: repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 23px,
      #ccc 23px,
      #ccc 24px
    );
    background-size: 100% 24px;
  }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 60px 1.5rem;
    min-height: auto;
  }

  .hero-actions { justify-content: center; }
  .hero-trust { justify-content: center; }
  .hero-visual { display: none; }

  .steps-row { flex-direction: column; gap: 28px; }
  .step-divider { display: none; }
  .step { padding: 0; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-mobile-cta { display: flex; }

  .paper-head { padding: 20px; }
  .paper-body { padding: 20px; }
  .paper-student-row { padding: 16px 20px; }
  .paper-instructions { padding: 14px 20px; }
  .paper-stats-bar { grid-template-columns: repeat(2, 1fr); }

  .footer-note { text-align: left; }
}

/* ═══════════════════════════════════════════════════════════
   EMAIL GATE MODAL
═══════════════════════════════════════════════════════════ */
#email-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 46, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.email-gate-modal {
  background: var(--white);
  border-radius: 20px;
  padding: 48px 44px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,0.28);
  animation: emailModalIn 0.22s ease;
}

@keyframes emailModalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.email-gate-logo {
  font-size: 1.8rem;
  color: var(--blue-700);
  margin-bottom: 16px;
}

.email-gate-modal h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 10px;
  line-height: 1.25;
}

.email-gate-modal p {
  font-size: 0.88rem;
  color: var(--gray-500);
  line-height: 1.65;
  margin-bottom: 24px;
}

.email-gate-input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--navy);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
}

.email-gate-input:focus {
  border-color: var(--blue-700);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.email-gate-error {
  font-size: 0.8rem;
  color: #dc2626;
  margin-top: 6px;
  min-height: 18px;
  text-align: left;
}

.email-gate-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  background: var(--blue-700);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s;
}

.email-gate-btn:hover { background: var(--blue-800, #1e40af); }

.email-gate-note {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 14px;
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .email-gate-modal { padding: 36px 24px; }
}
