/* ==========================================================================
   MAJED STEP — Mock Test 1
   Design tokens
   Color: Navy Deep #0B1E3D · Navy Ink #142B52 · Gold #C9A227 · Gold Soft #E8CD7A
          Parchment #F7F5EF · Ink Gray #3D4658 · Success #2F7D5C · Error #B33A3A
   Type:  Display — 'Fraunces' (headers only, restrained)
          Body    — 'Source Sans 3'
          Utility — 'JetBrains Mono' (timer, question counters, scores)
   Signature: the logo's ascending step-bars, reused as the literal exam
              progress indicator (each bar = one section; fills as completed)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Source+Sans+3:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --navy-deep: #0B1E3D;
  --navy-ink: #142B52;
  --navy-soft: #24365C;
  --gold: #C9A227;
  --gold-soft: #E8CD7A;
  --parchment: #F7F5EF;
  --paper: #FFFFFF;
  --ink: #1B2333;
  --ink-gray: #57607A;
  --line: #DDD8CB;
  --success: #2F7D5C;
  --success-bg: #E8F3EE;
  --error: #B33A3A;
  --error-bg: #FBEAEA;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(11, 30, 61, 0.08);
  --shadow-lg: 0 12px 40px rgba(11, 30, 61, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--navy-deep);
  letter-spacing: -0.01em;
}

.mono {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
}

a { color: var(--navy-deep); }

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ==========================================================================
   Layout shells
   ========================================================================== */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* ==========================================================================
   Landing screen
   ========================================================================== */

.landing {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.landing-card {
  max-width: 720px;
  width: 100%;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 56px 48px;
  text-align: center;
}

.landing-logo {
  width: 96px;
  height: 96px;
  margin-bottom: 20px;
}

.landing-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 10px;
}

.landing h1 {
  font-size: 34px;
  margin: 0 0 8px;
}

.landing .subtitle {
  color: var(--ink-gray);
  font-size: 17px;
  margin-bottom: 36px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 36px;
  text-align: left;
}

.section-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  background: var(--parchment);
}

.section-tile .tile-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 6px;
}

.section-tile .tile-name {
  font-weight: 600;
  color: var(--navy-deep);
  font-size: 15px;
  margin-bottom: 4px;
}

.section-tile .tile-meta {
  font-size: 13px;
  color: var(--ink-gray);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 8px;
  padding: 14px 30px;
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--navy-deep);
  color: var(--paper);
}
.btn-primary:hover { background: var(--navy-ink); box-shadow: 0 6px 18px rgba(11,30,61,0.25); }

.btn-gold {
  background: var(--gold);
  color: var(--navy-deep);
}
.btn-gold:hover { background: var(--gold-soft); }

.btn-ghost {
  background: transparent;
  color: var(--navy-deep);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--navy-deep); }

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

.landing-note {
  margin-top: 22px;
  font-size: 13px;
  color: var(--ink-gray);
}

/* ==========================================================================
   Exam top bar — includes the signature step-progress element
   ========================================================================== */

.exam-topbar {
  background: var(--navy-deep);
  color: var(--paper);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.topbar-logo { width: 34px; height: 34px; flex-shrink: 0; }

.topbar-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
}
.topbar-title small {
  display: block;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: var(--gold-soft);
}

/* Step progress: ascending bars mirroring the logo mark */
.step-progress {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 30px;
  flex: 1;
  max-width: 420px;
  justify-content: center;
}

.step-bar {
  width: 30px;
  background: rgba(255,255,255,0.14);
  border-radius: 3px 3px 0 0;
  position: relative;
  transition: background 0.3s ease;
}
.step-bar:nth-child(1) { height: 40%; }
.step-bar:nth-child(2) { height: 60%; }
.step-bar:nth-child(3) { height: 80%; }
.step-bar:nth-child(4) { height: 100%; }

.step-bar.done { background: var(--gold); }
.step-bar.active { background: var(--gold-soft); }

.step-labels {
  display: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 220px;
  justify-content: flex-end;
}

.timer {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.timer.low { color: #F0A5A5; }

.timer-label {
  font-size: 11px;
  color: var(--gold-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  text-align: right;
}

/* ==========================================================================
   Exam body
   ========================================================================== */

.exam-body {
  flex: 1;
  display: flex;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 24px 100px;
  gap: 28px;
}

.exam-main {
  flex: 1;
  min-width: 0;
}

.section-header {
  margin-bottom: 20px;
}
.section-header .eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.section-header h2 {
  margin: 4px 0 2px;
  font-size: 26px;
}
.section-header p {
  color: var(--ink-gray);
  font-size: 14px;
  margin: 0;
}

.question-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.passage-panel {
  flex: 1.1;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow);
  max-height: 640px;
  overflow-y: auto;
  position: sticky;
  top: 100px;
}
.passage-panel h3 {
  font-size: 19px;
  margin: 0 0 14px;
}
.passage-panel p {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 15.5px;
}
.passage-panel p:last-child { margin-bottom: 0; }

.question-panel {
  flex: 1;
  min-width: 0;
}

.card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
}

.q-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 10px;
}

.q-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--navy-deep);
  margin-bottom: 20px;
  line-height: 1.5;
}

.q-sentence {
  font-size: 16.5px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--parchment);
  border-radius: 8px;
  border-left: 3px solid var(--gold);
}

.underline-choice {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 3px;
  transition: background 0.15s ease;
}
.underline-choice.picked { background: rgba(201,162,39,0.22); }

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-size: 15.5px;
}
.option:hover { border-color: var(--gold); background: #FEFCF5; }
.option.selected { border-color: var(--navy-deep); background: #EEF2F8; }

.option .opt-letter {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-gray);
  flex-shrink: 0;
}
.option.selected .opt-letter {
  background: var(--navy-deep);
  color: var(--paper);
  border-color: var(--navy-deep);
}

/* Audio player for listening section */
.audio-block {
  background: var(--navy-deep);
  border-radius: var(--radius);
  padding: 22px 24px;
  color: var(--paper);
  margin-bottom: 22px;
}
.audio-block .audio-meta {
  font-size: 13px;
  color: var(--gold-soft);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}
.audio-block audio {
  width: 100%;
  height: 40px;
}
.audio-note {
  font-size: 12.5px;
  color: rgba(255,255,255,0.65);
  margin-top: 10px;
}

/* Question palette (jump nav) */
.palette {
  width: 220px;
  flex-shrink: 0;
}
.palette-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 100px;
}
.palette-card h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-gray);
  margin: 0 0 12px;
  font-weight: 700;
}
.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.palette-item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: var(--parchment);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}
.palette-item.answered { background: var(--navy-deep); color: var(--paper); border-color: var(--navy-deep); }
.palette-item.current { border-color: var(--gold); border-width: 2px; }

/* Bottom nav */
.exam-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 15;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
.exam-footer .progress-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-gray);
}

/* ==========================================================================
   Results screen
   ========================================================================== */

.results {
  flex: 1;
  padding: 48px 24px 80px;
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
}

.results-hero {
  background: var(--navy-deep);
  border-radius: var(--radius);
  padding: 40px 44px;
  color: var(--paper);
  text-align: center;
  margin-bottom: 28px;
}
.results-hero .score-big {
  font-family: 'JetBrains Mono', monospace;
  font-size: 56px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.results-hero .score-sub {
  color: rgba(255,255,255,0.75);
  margin-top: 6px;
  font-size: 15px;
}
.results-hero .band {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(201,162,39,0.18);
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.results-tile {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.results-tile .rt-name {
  font-size: 13px;
  color: var(--ink-gray);
  font-weight: 600;
  margin-bottom: 8px;
}
.results-tile .rt-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy-deep);
}
.results-tile .rt-bar {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}
.results-tile .rt-bar-fill { height: 100%; background: var(--gold); }

.review-toggle {
  text-align: center;
  margin-bottom: 24px;
}

.review-list { display: flex; flex-direction: column; gap: 10px; }

.review-item {
  background: var(--paper);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--line);
}
.review-item.correct { border-left-color: var(--success); }
.review-item.incorrect { border-left-color: var(--error); }
.review-item .ri-q { font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.review-item .ri-a { font-size: 13.5px; color: var(--ink-gray); }
.review-item .ri-a.correct-answer { color: var(--success); font-weight: 600; }
.review-item .ri-a.wrong-answer { color: var(--error); font-weight: 600; }
.review-section-title {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  color: var(--navy-deep);
  margin: 26px 0 10px;
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .section-grid { grid-template-columns: repeat(2, 1fr); }
  .exam-body { flex-direction: column; padding-bottom: 140px; }
  .question-layout { flex-direction: column; }
  .passage-panel { position: static; max-height: none; }
  .palette { width: 100%; }
  .palette-card { position: static; }
  .palette-grid { grid-template-columns: repeat(10, 1fr); }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-left { min-width: 0; }
  .topbar-title small { display: none; }
}

@media (max-width: 560px) {
  .landing-card { padding: 40px 24px; }
  .section-grid { grid-template-columns: 1fr; }
  .exam-topbar { padding: 12px 16px; flex-wrap: wrap; }
  .step-progress { order: 3; width: 100%; max-width: none; margin-top: 8px; }
  .results-grid { grid-template-columns: 1fr; }
  .palette-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
