/* =============================================================
   MOCK EXAM UI — polished, real-exam-feeling interface
   ============================================================= */

body.test-mode {
  background: var(--cream-100);
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-800);
}

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

/* ----- Top header bar on mock exam pages ----- */
.exam-header-bar {
  background: var(--ink-900);
  color: white;
  padding: var(--sp-3) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.exam-header-bar a.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.exam-header-bar a.brand img {
  height: 26px;
  filter: brightness(0) invert(1);
}
.exam-header-bar .exam-header-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}
.exam-header-bar .exam-header-meta a { color: white; text-decoration: none; }
.exam-header-bar .exam-header-meta a:hover { text-decoration: underline; }

/* ============================================================
   START SCREEN
   ============================================================ */
.test-start-screen {
  flex: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 4vw, 2rem);
  width: 100%;
  box-sizing: border-box;
}

.test-start-screen .eyebrow {
  display: inline-block;
  color: var(--coral-600);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}

.test-start-screen h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  color: var(--ink-900);
  margin: 0 0 var(--sp-5);
  font-weight: 700;
}

.test-start-screen .lead {
  font-size: clamp(1.0625rem, 2vw, 1.1875rem);
  line-height: 1.65;
  color: var(--ink-500);
  margin: 0 0 var(--sp-8);
}

.start-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin: 0 0 var(--sp-8);
}

@media (max-width: 560px) {
  .start-meta { grid-template-columns: 1fr; }
}

.start-meta-item {
  padding: var(--sp-4);
  background: white;
  border: 1px solid rgba(26, 46, 92, 0.08);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(26, 46, 92, 0.04);
}

.start-meta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.start-meta-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1;
}

.start-notes {
  background: var(--cream-200);
  border-left: 3px solid var(--coral-500);
  padding: var(--sp-5);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: 0 0 var(--sp-8);
}

.start-notes p {
  margin: 0 0 var(--sp-3);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-700);
}

.start-notes p:last-child { margin-bottom: 0; }
.start-notes strong { color: var(--ink-900); }
.start-notes a { color: var(--coral-600); text-decoration: underline; }

.start-cta-row {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  align-items: center;
}

/* ============================================================
   IN-EXAM UI
   ============================================================ */
.test-header {
  background: white;
  border-bottom: 1px solid rgba(26, 46, 92, 0.08);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 56px;
  z-index: 40;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.test-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.test-section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--ink-900);
  color: white;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.test-progress-label {
  font-size: 14px;
  color: var(--ink-500);
  font-weight: 500;
}

.test-timer {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 14px;
  color: var(--ink-500);
}

.test-timer-display {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
  background: var(--cream-200);
  padding: 6px 12px;
  border-radius: var(--r-md);
  min-width: 76px;
  text-align: center;
}

.test-timer.warning .test-timer-display {
  color: var(--coral-700);
  background: rgba(255, 107, 91, 0.08);
}

.test-exit {
  background: none;
  border: 1px solid rgba(26, 46, 92, 0.12);
  color: var(--ink-500);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--dur-base);
}

.test-exit:hover {
  background: var(--cream-200);
  color: var(--ink-800);
}

.test-progress-bar {
  background: rgba(26, 46, 92, 0.05);
  height: 4px;
  position: sticky;
  top: 116px;
  z-index: 39;
}

.test-progress-fill {
  background: linear-gradient(90deg, var(--coral-500), var(--coral-600));
  height: 100%;
  transition: width var(--dur-slow) var(--ease-out);
}

.test-question-area {
  flex: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 2rem);
  width: 100%;
  box-sizing: border-box;
}

.test-question-prompt {
  background: white;
  border: 1px solid rgba(26, 46, 92, 0.08);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: var(--sp-6);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-800);
  box-shadow: 0 1px 3px rgba(26, 46, 92, 0.04);
}

.test-question-prompt em {
  font-style: italic;
  color: var(--ink-900);
}

.test-choices {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.test-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: white;
  border: 1.5px solid rgba(26, 46, 92, 0.1);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-800);
  transition: all var(--dur-base);
  width: 100%;
}

.test-choice:hover {
  border-color: rgba(255, 107, 91, 0.5);
  background: rgba(255, 107, 91, 0.02);
}

.test-choice.selected {
  border-color: var(--coral-600);
  background: rgba(255, 107, 91, 0.06);
  box-shadow: 0 0 0 3px rgba(255, 107, 91, 0.1);
}

.test-choice-letter {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--ink-700);
  font-size: 15px;
  transition: all var(--dur-base);
}

.test-choice.selected .test-choice-letter {
  background: var(--coral-600);
  color: white;
}

.test-choice-text {
  flex: 1;
  padding-top: 6px;
}

.test-footer {
  background: white;
  border-top: 1px solid rgba(26, 46, 92, 0.08);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}

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

/* ============================================================
   RESULTS SCREEN
   ============================================================ */
.test-results {
  flex: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 4vw, 2rem);
  width: 100%;
  box-sizing: border-box;
}

.results-header {
  text-align: center;
  margin-bottom: var(--sp-8);
}

.results-header .eyebrow {
  display: inline-block;
  color: var(--coral-600);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}

.results-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.2;
  color: var(--ink-900);
  margin: 0 0 var(--sp-3);
}

.results-composite {
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 700;
  color: var(--coral-600);
  display: inline-block;
  line-height: 1;
  margin-left: var(--sp-2);
}

.results-ci {
  font-size: 15px;
  color: var(--ink-500);
  margin: var(--sp-3) 0 0;
}

.results-ci strong { color: var(--ink-800); }

.results-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

@media (max-width: 480px) {
  .results-sections { grid-template-columns: 1fr; }
}

.results-section {
  background: white;
  border: 1px solid rgba(26, 46, 92, 0.08);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  text-align: center;
  box-shadow: 0 1px 3px rgba(26, 46, 92, 0.04);
}

.results-section-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: var(--sp-2);
}

.results-section-score {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1;
  margin-bottom: var(--sp-2);
}

.results-section-meta {
  font-size: 14px;
  color: var(--ink-500);
}

.results-schools {
  background: white;
  border: 1px solid rgba(26, 46, 92, 0.08);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
}

.results-schools h2 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink-900);
  margin: 0 0 var(--sp-4);
}

.results-schools h3 {
  font-size: 13px;
  font-weight: 700;
  margin: var(--sp-4) 0 var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.results-schools-cleared h3 { color: #16a34a; }
.results-schools-cleared ul,
.results-schools-near ul { margin: 0; padding: 0; list-style: none; }
.results-schools-cleared li,
.results-schools-near li {
  padding: var(--sp-2) 0;
  border-bottom: 1px solid rgba(26, 46, 92, 0.06);
  font-size: 15px;
  color: var(--ink-700);
}
.results-schools-cleared li:last-child,
.results-schools-near li:last-child { border: none; }
.results-schools-near h3 { color: var(--coral-700); }
.results-schools-near li { font-size: 14px; color: var(--ink-600); }

.results-disclaimer {
  background: var(--cream-200);
  border-left: 3px solid var(--coral-500);
  padding: var(--sp-4);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin-bottom: var(--sp-6);
}
.results-disclaimer p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-600);
  line-height: 1.6;
}
.results-disclaimer a { color: var(--coral-600); text-decoration: underline; }

.results-cta {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}

.results-review {
  background: white;
  border: 1px solid rgba(26, 46, 92, 0.08);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}

.results-review summary {
  font-weight: 600;
  color: var(--ink-800);
  cursor: pointer;
  font-size: 16px;
}

.results-review summary:hover { color: var(--coral-600); }

.results-review-items {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
}

.results-review-item {
  border-left: 3px solid rgba(26, 46, 92, 0.2);
  padding: var(--sp-3) 0 var(--sp-3) var(--sp-4);
}

.results-review-item.is-correct { border-left-color: #16a34a; }
.results-review-item.is-wrong { border-left-color: var(--coral-600); }

.review-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-500);
  margin-bottom: var(--sp-2);
}

.results-review-item.is-correct .review-item-header span:last-child { color: #16a34a; }
.results-review-item.is-wrong .review-item-header span:last-child { color: var(--coral-700); }

.review-item-prompt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-800);
  margin-bottom: var(--sp-2);
}

.review-item-answer {
  font-size: 14px;
  color: var(--ink-700);
  margin-bottom: var(--sp-2);
}

.review-item-explanation {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-600);
  padding: var(--sp-3);
  background: var(--cream-200);
  border-radius: var(--r-md);
  margin-top: var(--sp-2);
}

@media (max-width: 640px) {
  .exam-header-bar { padding: var(--sp-2) var(--sp-3); }
  .exam-header-bar .exam-header-meta { gap: var(--sp-3); font-size: 13px; }
  .test-header {
    flex-direction: column;
    gap: var(--sp-3);
    align-items: stretch;
    top: 48px;
  }
  .test-meta { justify-content: space-between; }
  .test-progress-bar { top: 152px; }
  .test-timer { justify-content: space-between; }
  .test-choice { padding: var(--sp-3); }
  .test-choice-letter { width: 32px; height: 32px; font-size: 14px; }
  .start-meta-value { font-size: 22px; }
}
