/* ============================================================
   NREMT CAT Simulator — style.css
   EEA Brand Theme | Emergency Education Associates
   ============================================================ */

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

/* ── CSS Variables ──────────────────────────────────────── */
:root {
  --navy-dark:    #0d1b2a;
  --navy-mid:     #1a3a5c;
  --navy-light:   #264d73;
  --orange:       #e07b2a;
  --orange-light: #f4a261;
  --orange-pale:  #fff4eb;
  --white:        #ffffff;
  --off-white:    #f4f6f9;
  --border:       #dde2ea;
  --text-dark:    #0d1b2a;
  --text-mid:     #3d4a5c;
  --text-light:   #7a8899;
  --pass:         #166534;
  --pass-bg:      #dcfce7;
  --pass-border:  #86efac;
  --fail:         #991b1b;
  --fail-bg:      #fee2e2;
  --fail-border:  #fca5a5;
  --shadow-sm:    0 1px 3px rgba(13,27,42,0.08), 0 1px 2px rgba(13,27,42,0.06);
  --shadow-md:    0 4px 12px rgba(13,27,42,0.10), 0 2px 6px rgba(13,27,42,0.06);
  --shadow-lg:    0 12px 32px rgba(13,27,42,0.14), 0 4px 12px rgba(13,27,42,0.08);
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --font:         'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;
  --transition:   0.18s ease;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--off-white);
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

input, button, select, textarea {
  font-family: var(--font);
  font-size: 1rem;
}

/* ── Utility ─────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.hidden { display: none !important; }

/* ── Page Layout ─────────────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   START SCREEN — index.html
   ============================================================ */

.start-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--navy-dark);
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Background pattern */
.start-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(224,123,42,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(26,58,92,0.6) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(255,255,255,0.02) 39px,
      rgba(255,255,255,0.02) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(255,255,255,0.02) 39px,
      rgba(255,255,255,0.02) 40px
    );
  pointer-events: none;
  z-index: 0;
}

.start-header {
  position: relative;
  z-index: 1;
  padding: 20px 32px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 14px;
}

.start-header-logo {
  width: 36px;
  height: 36px;
  background: var(--orange);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.start-header-logo svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.start-header-wordmark {
  display: flex;
  flex-direction: column;
}

.start-header-org {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--orange);
}

.start-header-app {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.3px;
}

.start-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.start-card {
  width: 100%;
  max-width: 480px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  animation: cardFadeIn 0.4s ease forwards;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.start-card-header {
  background: rgba(224,123,42,0.12);
  border-bottom: 1px solid rgba(224,123,42,0.2);
  padding: 28px 32px 24px;
}

.start-card-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 8px;
}

.start-card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.start-card-subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
}

.start-card-body {
  padding: 28px 32px 32px;
}

/* Form fields */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 7px;
}

.form-label .required-star {
  color: var(--orange);
  margin-left: 2px;
}

.form-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--white);
  transition: border-color var(--transition), background var(--transition);
  outline: none;
}

.form-input::placeholder { color: rgba(255,255,255,0.25); }

.form-input:focus {
  border-color: var(--orange);
  background: rgba(224,123,42,0.06);
  box-shadow: 0 0 0 3px rgba(224,123,42,0.15);
}

.form-select {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--white);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  outline: none;
  transition: border-color var(--transition);
}

.form-select option { background: var(--navy-dark); color: var(--white); }
.form-select:focus { border-color: var(--orange); }

.form-hint {
  margin-top: 5px;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}

.form-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 22px 0;
}

/* Cert level cards */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.cert-card {
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.cert-card:hover {
  border-color: rgba(224,123,42,0.4);
  background: rgba(224,123,42,0.06);
}

.cert-card.selected {
  border-color: var(--orange);
  background: rgba(224,123,42,0.12);
}

.cert-card input { display: none; }

.cert-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}

.cert-card-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

.cert-card.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.cert-card-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(224,123,42,0.2);
  color: var(--orange-light);
  margin-top: 4px;
}

/* Start button */
.btn-start {
  width: 100%;
  margin-top: 24px;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-start:hover {
  background: var(--orange-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(224,123,42,0.35);
}

.btn-start:active { transform: translateY(0); }

.btn-start:disabled {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.3);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-start svg { width: 18px; height: 18px; }

/* Error message */
.form-error {
  background: rgba(153,27,27,0.2);
  border: 1px solid rgba(252,165,165,0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  color: #fca5a5;
  margin-top: 16px;
}

/* ============================================================
   EXAM INTERFACE — exam.html
   ============================================================ */

.exam-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--off-white);
  overflow: hidden;
}

/* Top navigation bar */
.exam-nav {
  background: var(--navy-dark);
  border-bottom: 3px solid var(--orange);
  padding: 0 20px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 100;
}

.exam-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.exam-nav-logo {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.exam-nav-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.12);
}

.exam-nav-counter {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  font-family: var(--font-mono);
}

.exam-nav-counter span {
  color: var(--orange);
}

.exam-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exam-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}

.exam-nav-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border-color: rgba(255,255,255,0.2);
}

.exam-nav-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.exam-nav-btn.active {
  background: rgba(224,123,42,0.2);
  border-color: rgba(224,123,42,0.4);
  color: var(--orange-light);
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--orange);
  font-weight: 600;
  min-width: 52px;
  text-align: right;
}

/* Progress bar */
.exam-progress {
  height: 3px;
  background: rgba(13,27,42,0.12);
  position: relative;
  flex-shrink: 0;
}

.exam-progress-fill {
  height: 100%;
  background: var(--orange);
  transition: width 0.4s ease;
}

/* Main exam area */
.exam-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Standard single-item layout */
.question-panel {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

/* Image exhibit */
.exhibit-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.exhibit-label {
  background: var(--navy-dark);
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
}

.exhibit-image {
  display: block;
  max-width: 100%;
  max-height: 280px;
  margin: 0 auto;
  padding: 16px;
  object-fit: contain;
}

/* Question stem */
.question-stem-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.question-stem {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-dark);
  font-weight: 400;
}

.question-instruction {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
  padding: 8px 12px;
  background: var(--orange-pale);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--orange);
}

/* Answer choices */
.answer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.answer-item {
  position: relative;
}

.answer-item input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.answer-label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.answer-label:hover {
  border-color: var(--orange-light);
  background: var(--orange-pale);
}

.answer-item input:checked + .answer-label {
  border-color: var(--orange);
  background: var(--orange-pale);
  box-shadow: 0 0 0 3px rgba(224,123,42,0.12);
}

.answer-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--off-white);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mid);
  flex-shrink: 0;
  transition: all var(--transition);
  font-family: var(--font-mono);
}

.answer-item input:checked + .answer-label .answer-letter {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

.answer-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dark);
  padding-top: 3px;
}

/* Multiple response: checkbox style */
.answer-item.checkbox .answer-letter {
  border-radius: var(--radius-sm);
}

/* ── Scenario split-screen layout ──────────────────────── */
.scenario-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 44% 56%;
  overflow: hidden;
}

.scenario-left {
  background: var(--navy-dark);
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scenario-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 16px;
  flex-shrink: 0;
}

.scenario-tab {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.scenario-tab.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.scenario-tab.accessible {
  color: rgba(255,255,255,0.6);
}

.scenario-tab.accessible:hover {
  color: rgba(255,255,255,0.85);
}

.scenario-tab.locked {
  opacity: 0.3;
  cursor: default;
}

.scenario-narrative {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 20px;
}

.scenario-narrative p {
  font-size: 13.5px;
  line-height: 1.7;
  color: rgba(255,255,255,0.72);
  margin-bottom: 14px;
}

.scenario-narrative p:last-child { margin-bottom: 0; }

.scenario-phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(224,123,42,0.15);
  border: 1px solid rgba(224,123,42,0.25);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 16px;
}

.scenario-right {
  background: var(--off-white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scenario-question-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 22px;
}

.scenario-phase-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--navy-mid);
  margin-bottom: 14px;
}

/* ── Complex item types ─────────────────────────────────── */

/* Drag and Drop */
.dnd-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: start;
}

.dnd-source-list,
.dnd-dest-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dnd-column-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 8px;
}

.dnd-item {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-dark);
  cursor: grab;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.dnd-item:hover {
  border-color: var(--orange-light);
  box-shadow: var(--shadow-md);
}

.dnd-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.dnd-item.placed {
  background: var(--orange-pale);
  border-color: var(--orange);
  color: var(--navy-dark);
  cursor: pointer;
}

.dnd-arrow {
  display: flex;
  align-items: center;
  padding-top: 32px;
  color: var(--text-light);
}

.dnd-arrow svg { width: 20px; height: 20px; }

.dnd-drop-zone {
  background: var(--white);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 52px;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}

.dnd-drop-zone.drag-over {
  border-color: var(--orange);
  background: var(--orange-pale);
}

.dnd-drop-zone.filled {
  border-style: solid;
  border-color: var(--orange);
}

.dnd-drop-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 8px;
}

.dnd-placeholder {
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
}

/* Build List */
.build-list-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: start;
}

.build-list-source,
.build-list-answer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.build-list-item {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-dark);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}

.build-list-item:hover { border-color: var(--orange-light); }
.build-list-item.selected {
  border-color: var(--orange);
  background: var(--orange-pale);
}

.build-list-rank {
  width: 22px;
  height: 22px;
  background: var(--navy-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.build-list-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 28px;
}

.build-list-btn {
  width: 32px;
  height: 32px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-mid);
}

.build-list-btn:hover {
  background: var(--navy-dark);
  color: var(--white);
  border-color: var(--navy-dark);
}

.build-list-btn svg { width: 14px; height: 14px; }

/* Options Box */
.options-box-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.options-box-table th {
  background: var(--navy-dark);
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  text-align: center;
}

.options-box-table th:first-child {
  text-align: left;
  width: 50%;
}

.options-box-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dark);
}

.options-box-table td:not(:first-child) {
  text-align: center;
}

.options-box-table tr:last-child td {
  border-bottom: none;
}

.options-box-table tr:nth-child(even) td {
  background: var(--off-white);
}

.options-box-radio {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--orange);
}

/* ── Bottom action bar ──────────────────────────────────── */
.exam-footer {
  background: var(--navy-dark);
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.exam-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exam-footer-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}

.exam-footer-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

.exam-footer-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-next {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--orange);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.5px;
}

.btn-next:hover {
  background: var(--orange-light);
  transform: translateX(2px);
}

.btn-next:disabled {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.3);
  cursor: not-allowed;
  transform: none;
}

.btn-next svg { width: 16px; height: 16px; }

/* ── Calculator overlay ─────────────────────────────────── */
.calculator-overlay {
  position: fixed;
  bottom: 64px;
  left: 20px;
  width: 240px;
  background: var(--navy-dark);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  animation: calcSlideIn 0.18s ease;
}

@keyframes calcSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.calc-display {
  background: rgba(0,0,0,0.3);
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.calc-expression {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  min-height: 16px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calc-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  color: var(--white);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.06);
  padding: 1px;
}

.calc-btn {
  background: rgba(255,255,255,0.04);
  border: none;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
  cursor: pointer;
  transition: background var(--transition);
  font-family: var(--font);
}

.calc-btn:hover { background: rgba(255,255,255,0.10); }
.calc-btn:active { background: rgba(255,255,255,0.16); }

.calc-btn.orange { color: var(--orange-light); }
.calc-btn.dark { background: rgba(0,0,0,0.2); color: rgba(255,255,255,0.6); }
.calc-btn.wide { grid-column: span 2; }

/* ── Loading state ──────────────────────────────────────── */
.loading-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: var(--text-mid);
}

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

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

.loading-text {
  font-size: 14px;
  color: var(--text-light);
}

/* ── Error banner ───────────────────────────────────────── */
.error-banner {
  background: var(--fail-bg);
  border: 1px solid var(--fail-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--fail);
  margin: 20px 24px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* ============================================================
   RESULTS PAGE — results.html
   ============================================================ */

.results-page {
  min-height: 100vh;
  background: var(--off-white);
}

.results-header {
  background: var(--navy-dark);
  border-bottom: 3px solid var(--orange);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.results-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.results-header-logo-box {
  width: 32px;
  height: 32px;
  background: var(--orange);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.results-header-logo-box svg {
  width: 18px; height: 18px; fill: white;
}

.results-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.3px;
}

.results-header-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 1px;
}

.results-print-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all var(--transition);
}

.results-print-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

.results-print-btn svg { width: 14px; height: 14px; }

.results-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* Verdict card */
.verdict-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.verdict-banner {
  padding: 32px;
  text-align: center;
  position: relative;
}

.verdict-banner.pass {
  background: var(--pass-bg);
  border: 2px solid var(--pass-border);
  border-bottom: none;
}

.verdict-banner.fail {
  background: var(--fail-bg);
  border: 2px solid var(--fail-border);
  border-bottom: none;
}

.verdict-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.verdict-banner.pass .verdict-eyebrow { color: var(--pass); }
.verdict-banner.fail .verdict-eyebrow { color: var(--fail); }

.verdict-word {
  font-size: 60px;
  font-weight: 800;
  letter-spacing: 8px;
  line-height: 1;
}

.verdict-banner.pass .verdict-word { color: var(--pass); }
.verdict-banner.fail .verdict-word { color: var(--fail); }

.verdict-sub {
  margin-top: 10px;
  font-size: 14px;
}

.verdict-banner.pass .verdict-sub { color: #15803d; }
.verdict-banner.fail .verdict-sub { color: #b91c1c; }

/* Stats strip */
.verdict-stats {
  background: var(--white);
  border: 2px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.verdict-stat {
  padding: 18px 16px;
  text-align: center;
  border-right: 1px solid var(--border);
}

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

.verdict-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
}

.verdict-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  font-family: var(--font-mono);
}

.verdict-stat-value.score-value {
  font-size: 26px;
}

/* Scaled score detail card (FAIL only) */
.score-detail-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.5s ease 0.1s both;
}

.score-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.score-detail-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-dark);
  letter-spacing: 0.3px;
}

.score-detail-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--fail);
  font-family: var(--font-mono);
}

.score-bar-wrap {
  position: relative;
  margin-bottom: 10px;
}

.score-bar-track {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: visible;
  position: relative;
}

.score-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: var(--fail);
  transition: width 1s ease;
}

.score-bar-marker {
  position: absolute;
  top: -5px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.score-bar-marker-line {
  width: 2px;
  height: 20px;
  background: var(--orange);
}

.score-bar-marker-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
  background: white;
  padding: 0 3px;
}

.score-bar-endpoints {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.score-bar-endpoint {
  font-size: 11px;
  color: var(--text-light);
  font-family: var(--font-mono);
}

/* Content area breakdown */
.breakdown-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.5s ease 0.15s both;
}

.breakdown-header {
  background: var(--navy-dark);
  padding: 13px 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

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

.breakdown-area {
  flex: 1;
  font-size: 13px;
  color: var(--text-dark);
  font-weight: 500;
}

.breakdown-bar-wrap {
  width: 120px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

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

.breakdown-pct {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  width: 38px;
  text-align: right;
  flex-shrink: 0;
}

/* Rationale section */
.rationale-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.5s ease 0.2s both;
}

.rationale-header {
  background: var(--navy-dark);
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rationale-header-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

.rationale-locked-msg {
  padding: 28px 20px;
  text-align: center;
}

.rationale-lock-icon {
  width: 44px;
  height: 44px;
  background: var(--off-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  border: 1px solid var(--border);
}

.rationale-lock-icon svg {
  width: 20px; height: 20px; color: var(--text-light);
}

.rationale-lock-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.rationale-lock-sub {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
  max-width: 360px;
  margin: 0 auto;
}

.rationale-lock-sub strong {
  color: var(--orange);
}

/* Rationale accordion */
.rationale-item {
  border-bottom: 1px solid var(--border);
}

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

.rationale-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background var(--transition);
}

.rationale-item-header:hover { background: var(--off-white); }

.rationale-item-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.rationale-item-num.correct {
  background: var(--pass-bg);
  color: var(--pass);
  border: 1px solid var(--pass-border);
}

.rationale-item-num.incorrect {
  background: var(--fail-bg);
  color: var(--fail);
  border: 1px solid var(--fail-border);
}

.rationale-item-stem {
  flex: 1;
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rationale-item-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-light);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.rationale-item.open .rationale-item-chevron {
  transform: rotate(180deg);
}

.rationale-item-body {
  display: none;
  padding: 0 20px 18px 60px;
  animation: expandIn 0.15s ease;
}

.rationale-item.open .rationale-item-body { display: block; }

@keyframes expandIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.rationale-text {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-mid);
  background: var(--off-white);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border-left: 3px solid var(--orange);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .scenario-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .scenario-left {
    max-height: 220px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }

  .dnd-container,
  .build-list-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .dnd-arrow { display: none; }

  .verdict-stats {
    grid-template-columns: 1fr;
  }

  .verdict-stat {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .start-card { margin: 0; }
  .start-card-header,
  .start-card-body { padding: 20px; }
}

@media print {
  .results-print-btn,
  .rationale-card { display: none; }

  .results-header { print-color-adjust: exact; }
}
