/* ═══════════════════════════════════════════════════════════
   SPR GROUND SCHOOL — Shared Stylesheet
   Design: Editorial aviation · Fraunces + Source Serif 4
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Brand */
  --navy:       #0a1628;
  --navy-mid:   #122040;
  --navy-light: #1e3460;
  --sky:        #2563c4;
  --sky-bright: #3b82f6;
  --amber:      #f59e0b;
  --amber-pale: #fffbeb;
  --white:      #ffffff;
  --off-white:  #f7f8fc;
  --muted:      #64748b;
  --muted-light:#94a3b8;
  --border:     #e2e8f0;
  --text:       #1a2540;
  --green:      #16a34a;
  --green-pale: #f0fdf4;
  --red:        #dc2626;
  --red-pale:   #fef2f2;

  /* Module accent colors */
  --m1: #2563c4; /* How Training Works — sky */
  --m2: #059669; /* How Planes Fly — emerald */
  --m3: #d97706; /* Aircraft Systems — amber */
  --m4: #7c3aed; /* Flight Instruments — violet */
  --m5: #0891b2; /* Airports & Airspace — cyan */
  --m6: #b45309; /* Navigation — brown */
  --m7: #1d4ed8; /* Weather — deep blue */
  --m8: #dc2626; /* Regulations — red */
  --m9: #16a34a; /* Radio Comms — green */
  --m10:#6d28d9; /* Maneuvers — purple */
  --m11:#be185d; /* Decision Making — pink */
  --m12:#ea580c; /* Written Test Prep — orange */

  /* Typography */
  --display: 'Fraunces', Georgia, serif;
  --serif:   'Source Serif 4', Georgia, serif;
  --mono:    'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--serif);
  color: var(--text);
  background: var(--white);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.2; }
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; margin: 2.5rem 0 0.875rem; scroll-margin-top: 80px; }
h3 { font-size: 1.15rem; font-weight: 700; margin: 2rem 0 0.5rem; color: var(--navy); }
p  { font-size: 1rem; color: #2d3a50; line-height: 1.85; margin-bottom: 1.1rem; }
ul, ol { margin: 0.75rem 0 1.25rem 1.4rem; }
li { font-size: 0.97rem; color: #2d3a50; line-height: 1.8; margin-bottom: 0.45rem; }
strong { color: var(--navy); font-weight: 600; }
a { color: var(--sky); text-decoration: underline; text-decoration-color: rgba(37,99,196,0.3); }
a:hover { text-decoration-color: var(--sky); }

/* ── COURSE NAV ── */
.course-topbar {
  background: var(--navy);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.topbar-logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.95rem;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-logo-mark {
  width: 28px; height: 28px;
  background: var(--sky);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem;
  font-family: var(--mono);
  color: white;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.topbar-course-name {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  border-left: 1px solid rgba(255,255,255,0.15);
  padding-left: 1rem;
  margin-left: 0.75rem;
}
.topbar-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar-progress-bar {
  width: 140px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.topbar-progress-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.topbar-progress-text {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
}
.topbar-back {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
}
.topbar-back:hover { color: white; text-decoration: none; }

/* ── COURSE LAYOUT ── */
.course-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 56px);
  align-items: start;
}

/* ── SIDEBAR ── */
.course-sidebar {
  background: var(--off-white);
  border-right: 1px solid var(--border);
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
  overflow-y: auto;
  padding: 1.5rem 0;
}
.sidebar-section-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-light);
  padding: 0 1.25rem;
  margin-bottom: 0.5rem;
  margin-top: 1.25rem;
}
.sidebar-section-label:first-child { margin-top: 0; }
.sidebar-module {
  display: block;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
}
.sidebar-module:hover {
  background: var(--white);
  text-decoration: none;
}
.sidebar-module.active {
  background: var(--white);
  border-left-color: var(--sky);
}
.sidebar-module.completed {
  opacity: 0.7;
}
.sm-number {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--muted-light);
  margin-bottom: 2px;
}
.sm-title {
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}
.sm-meta {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted-light);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sm-check {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.2s;
}
.sm-check.done {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

/* ── LESSON CONTENT ── */
.lesson-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 3rem 6rem;
}
.lesson-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.lesson-eyebrow {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lesson-objectives {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}
.lesson-objectives-title {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-light);
  margin-bottom: 0.75rem;
}
.lesson-objectives ul { margin: 0; list-style: none; }
.lesson-objectives li {
  font-size: 0.9rem;
  color: var(--text);
  padding: 4px 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.lesson-objectives li::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── CALLOUTS ── */
.callout {
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.callout.info    { background: #eff6ff; border-left: 3px solid var(--sky); }
.callout.tip     { background: var(--green-pale); border-left: 3px solid var(--green); }
.callout.warning { background: var(--amber-pale); border-left: 3px solid var(--amber); }
.callout.danger  { background: var(--red-pale); border-left: 3px solid var(--red); }
.callout p { font-size: 0.92rem; line-height: 1.7; margin: 0; }
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ── KEY TERM ── */
.key-term {
  background: linear-gradient(135deg, #f0f7ff, #e8f2ff);
  border: 1px solid rgba(37,99,196,0.2);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.kt-word {
  font-family: var(--display);
  font-weight: 800;
  color: var(--sky);
  font-size: 0.88rem;
  min-width: 120px;
  flex-shrink: 0;
}
.kt-def {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

/* ── COMPARISON TABLE ── */
.compare-wrap { overflow-x: auto; margin: 1.5rem 0; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 460px;
}
.compare-table th {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--navy);
  color: white;
  padding: 10px 14px;
  text-align: left;
}
.compare-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.55;
}
.compare-table tr:nth-child(even) td { background: var(--off-white); }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td:first-child { font-family: var(--display); font-weight: 700; color: var(--navy); }

/* ── LESSON NAV FOOTER ── */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  background: var(--off-white);
  gap: 1rem;
}
.lesson-nav-btn {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 11px 22px;
  border-radius: 10px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
  border: none;
  cursor: pointer;
}
.btn-prev {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--navy);
}
.btn-prev:hover { border-color: var(--navy); text-decoration: none; }
.btn-next {
  background: var(--sky);
  color: white;
}
.btn-next:hover { background: var(--sky-bright); text-decoration: none; color: white; }
.btn-complete {
  background: var(--green);
  color: white;
}
.btn-complete:hover { background: #15803d; }

/* ── QUIZ SECTION ── */
.quiz-section {
  background: var(--navy);
  border-radius: 16px;
  padding: 2.5rem;
  margin: 3rem 0 2rem;
  color: white;
}
.quiz-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.quiz-icon {
  width: 44px; height: 44px;
  background: var(--amber);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.quiz-title {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
}
.quiz-subtitle {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}
.quiz-question {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.25rem 0;
}
.qq-text {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  line-height: 1.4;
}
.qq-num {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: rgba(255,255,255,0.35);
  margin-bottom: 0.5rem;
}
.qq-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.qq-option {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 9px;
  padding: 0.875rem 1.1rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.8);
  text-align: left;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--serif);
  line-height: 1.5;
}
.qq-option:hover:not(.selected):not(.disabled) {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
  color: white;
}
.qq-option.correct {
  background: rgba(22,163,74,0.2);
  border-color: var(--green);
  color: white;
}
.qq-option.incorrect {
  background: rgba(220,38,38,0.2);
  border-color: var(--red);
  color: white;
}
.qq-option.show-correct {
  background: rgba(22,163,74,0.15);
  border-color: rgba(22,163,74,0.4);
  color: rgba(255,255,255,0.7);
}
.qq-option.disabled { cursor: default; }
.qq-letter {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  flex-shrink: 0;
}
.qq-explanation {
  margin-top: 0.875rem;
  padding: 0.875rem 1rem;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  display: none;
}
.qq-explanation.show { display: block; }
.qq-explanation strong { color: white; }
.quiz-score-panel {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  display: none;
}
.quiz-score-panel.show { display: block; }
.score-num {
  font-family: var(--display);
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.score-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1rem;
}
.score-msg {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.quiz-btn {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 11px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.quiz-btn-submit {
  background: var(--amber);
  color: var(--navy);
  width: 100%;
  margin-top: 1.25rem;
  font-size: 0.92rem;
  padding: 13px;
}
.quiz-btn-submit:hover { background: #fbbf24; }
.quiz-btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.quiz-btn-retry {
  background: rgba(255,255,255,0.1);
  color: white;
  margin-right: 0.75rem;
}
.quiz-btn-retry:hover { background: rgba(255,255,255,0.15); }
.quiz-btn-next {
  background: var(--sky);
  color: white;
}
.quiz-btn-next:hover { background: var(--sky-bright); }

/* ── GLOSSARY ── */
.glossary-section {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  margin: 2rem 0;
}
.glossary-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.glossary-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.875rem 1rem;
}
.gi-term {
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--navy);
  margin-bottom: 3px;
}
.gi-def {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ── SUMMARY BOX ── */
.lesson-summary {
  background: var(--navy);
  color: white;
  border-radius: 14px;
  padding: 2rem;
  margin: 2.5rem 0;
}
.ls-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--amber);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ls-list {
  list-style: none;
  margin: 0;
}
.ls-list li {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 0.75rem;
  line-height: 1.5;
}
.ls-list li:last-child { border-bottom: none; }
.ls-list li::before { content: '→'; color: var(--amber); flex-shrink: 0; }

/* ── PRINT STYLES ── */
@media print {
  .course-topbar, .course-sidebar, .lesson-nav, .quiz-section { display: none !important; }
  .course-layout { grid-template-columns: 1fr; }
  .lesson-content { padding: 1rem; max-width: 100%; }
}

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .course-layout { grid-template-columns: 1fr; }
  .course-sidebar {
    display: none;
    height: auto;
    position: static;
  }
  .course-sidebar.open { display: block; }
  .lesson-content { padding: 1.75rem 1.25rem 4rem; }
  .lesson-nav { padding: 1.5rem 1.25rem; }
  .quiz-section { padding: 1.5rem; }
  .topbar-progress { display: none; }
}
