
/* ══════════════════════════════════════════════════════
   1. DASHBOARD (Start Screen) — Redesigned
   ══════════════════════════════════════════════════════ */

/* ── Dashboard Layout ─────────────────────────────────── */
.dash-content {
  padding: 48px 40px 0;
  background: #F6F7F9;
}
.dash-inner {
  max-width: 780px;
  margin: 0 auto;
}

/* ── Headline Area ────────────────────────────────────── */
.dash-headline {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.5px;
  text-align: center;
  margin: 0 0 10px;
  line-height: 1.2;
}
.dash-subtitle {
  font-size: 16px;
  color: #9CA3AF;
  text-align: center;
  margin: 0 auto 36px;
  line-height: 1.5;
}

/* ── Action Cards — dark navy ────────────────────────── */
.dash-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 720px;
  margin: 0 auto 32px;
}
.dash-action-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  background: #1a1f36;
  border: none;
  border-radius: 14px;
  padding: 26px 26px 24px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  font-family: inherit;
  width: 100%;
}
.dash-action-card:hover {
  box-shadow: 0 8px 28px rgba(26, 31, 54, 0.35);
  transform: translateY(-2px);
}
.dash-action-card:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(26, 31, 54, 0.2);
}
.dash-action-card.selected {
  box-shadow: 0 0 0 2px #4361ee, 0 4px 16px rgba(67, 97, 238, 0.2);
}
.dash-action-card.selected:hover {
  box-shadow: 0 0 0 2px #4361ee, 0 8px 28px rgba(67, 97, 238, 0.25);
}

.dash-action-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #8b93b0;
  margin-bottom: 12px;
}
.dash-action-meta svg {
  color: #8b93b0;
  flex-shrink: 0;
}
.dash-action-title {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: -0.2px;
}
.dash-action-desc {
  font-size: 13.5px;
  color: #8b93b0;
  line-height: 1.55;
  margin: 0 0 auto;
  padding-bottom: 20px;
}

.dash-action-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  width: 100%;
  background: #4361ee;
  border-radius: 10px;
  padding: 11px 0;
  transition: background 0.15s;
}
.dash-action-card:hover .dash-action-cta {
  background: #3a56d4;
}
.dash-action-cta-label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.1px;
}

/* ── Locked card (trial users) ──────────────────────────── */
.dash-action-card.locked {
  cursor: default;
  background: #1a1f36;
  opacity: 0.55;
}
.dash-action-card.locked:hover {
  box-shadow: none;
  transform: none;
}
.dash-action-card.locked:active {
  transform: none;
  box-shadow: none;
}
.dash-action-card.locked .dash-action-cta {
  background: #3a3f56;
}
.dash-action-card.locked:hover .dash-action-cta {
  background: #3a3f56;
}
.dash-locked-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.15);
  border-radius: 6px;
  padding: 3px 8px;
  margin-top: 6px;
}
.dash-locked-badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
@keyframes card-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-4px); }
  30% { transform: translateX(4px); }
  45% { transform: translateX(-3px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-1px); }
  90% { transform: translateX(1px); }
}
.dash-action-card.shake {
  animation: card-shake 0.4s ease-in-out;
}

/* ── Countdown Overlay ───────────────────────────────── */
.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: all;
  transition: background 0.3s;
}
.countdown-overlay--white {
  background: #fff;
}
.countdown-card {
  position: fixed;
  background: #1a1f36;
  border-radius: 14px;
  transition: top 0.5s cubic-bezier(0.4,0,0.2,1),
              left 0.5s cubic-bezier(0.4,0,0.2,1),
              width 0.5s cubic-bezier(0.4,0,0.2,1),
              height 0.5s cubic-bezier(0.4,0,0.2,1),
              border-radius 0.5s cubic-bezier(0.4,0,0.2,1);
}
.countdown-card--expanded {
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0;
}
.countdown-center {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
}
.countdown-number {
  font-size: 96px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 20px;
}
@keyframes countdownPop {
  0%   { transform: scale(1.3); opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.countdown-pop {
  animation: countdownPop 0.5s cubic-bezier(0.2,0,0.2,1) forwards;
}
.countdown-label {
  font-size: 18px;
  font-weight: 600;
  color: #8b93b0;
  margin-bottom: 4px;
}
.countdown-detail {
  font-size: 14px;
  color: #6b7288;
}

/* ── Info Pills (above cards) ────────────────────────── */
.dash-info-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto 32px;
}
.dash-info-pills .dash-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dash-info-pills .dash-pill svg { flex-shrink: 0; }
.dash-pill--timed      { background: #E6F1FB; color: #0C447C; }
.dash-pill--navigate   { background: #EEEDFE; color: #3C3489; }
.dash-pill--no-penalty { background: #E1F5EE; color: #085041; }

/* ── Question Type Pills ─────────────────────────────── */
.dash-qtypes-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto 40px;
}
.dash-pill {
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
  padding: 5px 14px;
  white-space: nowrap;
  transition: transform 0.15s, filter 0.15s;
  cursor: default;
  user-select: none;
}
.dash-pill:hover {
  transform: scale(1.05);
  filter: brightness(0.93);
}
.dash-pill--number-series      { background: #EEEDFE; color: #3C3489; }
.dash-pill--word-problems      { background: #E6F1FB; color: #0C447C; }
.dash-pill--value-comparison   { background: #E1F5EE; color: #085041; }
.dash-pill--verbal-analogies   { background: #FBEAF0; color: #72243E; }
.dash-pill--antonyms           { background: #FAEEDA; color: #633806; }
.dash-pill--logical-conclusions { background: #FAECE7; color: #712B13; }
.dash-pill--figure-series      { background: #EAF3DE; color: #27500A; }
.dash-pill--odd-one-out        { background: #FCEBEB; color: #791F1F; }
.dash-pill--shape-analogies    { background: #F1EFE8; color: #444441; }

/* ── First-run hint ──────────────────────────────────── */
.dash-first-run-hint {
  font-size: 13px;
  color: #9CA3AF;
  text-align: center;
  margin: 0 auto 40px;
}

/* ── User-State Module ────────────────────────────────── */
#dash-user-state:empty { display: none; }

/* ── Training Summary (returning user) ────────────────── */
.dash-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  width: 80%;
  max-width: 580px;
  margin: 0 auto 8px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
}
.dash-summary-stat {
  padding: 24px 20px;
  text-align: center;
  border-right: 1px solid #F3F4F6;
}
.dash-summary-stat:last-child { border-right: none; }
.dash-summary-val {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 6px;
}
.dash-summary-label {
  font-size: 12px;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Dashboard Sections ───────────────────────────────── */
.dash-section {
  padding: 40px 40px;
  background: #F6F7F9;
}
.dash-section--alt {
  background: #fff;
}
.dash-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9CA3AF;
  margin-bottom: 20px;
  text-align: center;
}

/* ── History List ─────────────────────────────────────── */
.dash-history-list {
  width: 80%;
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
}
.dash-run {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #F3F4F6;
  transition: background 0.12s;
}
.dash-run:last-child { border-bottom: none; }
.dash-run:hover { background: #fff; }
.dash-run-date {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}
.dash-run-score {
  font-size: 13px;
  color: #6B7280;
  text-align: right;
}
.dash-run-percentile {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  text-align: right;
  min-width: 48px;
}
.dash-run-trend {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 12px;
  flex-shrink: 0;
}
.dash-run-trend--up {
  color: #059669;
  background: #ECFDF5;
}
.dash-run-trend--down {
  color: #DC2626;
  background: #FEF2F2;
}
.dash-run-trend--neutral {
  color: #9CA3AF;
  background: #F3F4F6;
}

/* ── Streak Flame Badge ──────────────────────────────── */
.streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: none;
  cursor: default;
  user-select: none;
}
.streak-count {
  font-size: 13px;
  font-weight: 700;
  color: #E8590C;
  line-height: 1;
}

/* Flame container */
.streak-flame {
  width: 20px;
  height: 26px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* Outer flame body */
.flame-body {
  width: 14px;
  height: 20px;
  background: linear-gradient(0deg, #FF6B1A 0%, #FF9500 40%, #FFD60A 85%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  position: relative;
  animation: flameDance 0.6s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 4px rgba(255, 107, 26, 0.5));
}

/* Inner core */
.flame-core {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 10px;
  background: linear-gradient(0deg, #FF4500 0%, #FF6B1A 60%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: coreFlicker 0.4s ease-in-out infinite alternate;
}

@keyframes flameDance {
  0% {
    transform: scaleX(1) scaleY(1) rotate(-1deg);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  }
  50% {
    transform: scaleX(0.92) scaleY(1.06) rotate(1deg);
  }
  100% {
    transform: scaleX(1.04) scaleY(0.95) rotate(-0.5deg);
    border-radius: 48% 52% 50% 50% / 58% 62% 42% 38%;
  }
}

@keyframes coreFlicker {
  0% {
    transform: translateX(-50%) scaleY(1) scaleX(1);
    opacity: 0.9;
  }
  100% {
    transform: translateX(-50%) scaleY(1.15) scaleX(0.85);
    opacity: 1;
  }
}

/* ── Goat Rain ──────────────────────────────────────── */
@keyframes goatFall {
  0%   { top: -60px; opacity: 0; transform: rotate(0deg); }
  8%   { opacity: 0.9; }
  85%  { opacity: 0.9; }
  100% { top: 110vh; opacity: 0; transform: rotate(var(--goat-rot, 180deg)); }
}
@keyframes goatSway {
  0%   { translate: calc(var(--sway-amp, 40px) * -1) 0; }
  100% { translate: var(--sway-amp, 40px) 0; }
}

/* ── Primary Button ──────────────────────────────────── */
.btn-primary {
  display: inline-block;
  padding: 13px 44px;
  background: #4361ee;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(67,97,238,0.15);
}
.btn-primary:hover { background: #3a56d4; box-shadow: 0 4px 12px rgba(67,97,238,0.2); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  background: #b0b0b0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Secondary Button ────────────────────────────────── */
.btn-secondary {
  display: inline-block;
  padding: 13px 32px;
  background: #fff;
  color: #4361ee;
  font-size: 15px;
  font-weight: 600;
  border: 1.5px solid #4361ee;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-secondary:hover { background: #F0F4FF; }

/* ── Session History Table (legacy, kept for compatibility) ─ */
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: 14px; }

/* ══════════════════════════════════════════════════════
   2. TEST-TAKING LAYOUT
   ══════════════════════════════════════════════════════ */
.test-container {
  width: 100%;
}
.test-container .app-grid {
  padding: 0 40px;
}

/* ── Test Top Bar ────────────────────────────────────── */
.test-top-bar {
  width: 100%;
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  position: sticky;
  top: 0;
  z-index: 50;
}
.test-top-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.test-top-left {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.2px;
}
.test-top-center {
  font-size: 13px;
  color: #6B7280;
  font-weight: 500;
}
.test-top-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── Timer ────────────────────────────────────────────── */
.timer {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 6px 14px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
}
.timer.warning { background: #f59e0b; color: #000; }
.timer.critical {
  background: #ef4444;
  color: #fff;
  animation: pulse 0.8s infinite alternate;
}
@keyframes pulse { from { opacity: 1; } to { opacity: 0.6; } }

/* ── Badge Toggle ────────────────────────────────────── */
.badge-toggle {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1.5px solid #E5E7EB;
  border-radius: 6px;
  background: #fff;
  color: #6B7280;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.badge-toggle:hover {
  background: #F0F4FF;
  border-color: #4361ee;
  color: #4361ee;
}
.test-container.hide-badges .domain-badge,
.test-container.hide-badges .family-badge { display: none; }

/* ── Progress Bar ────────────────────────────────────── */
.progress-bar-track {
  height: 3px;
  background: #E5E7EB;
  width: 100%;
}
.progress-bar-fill {
  height: 100%;
  background: #4361ee;
  transition: width 0.3s ease;
}

/* ── Questions Area ──────────────────────────────────── */
.questions-area {
  padding: 32px 0 16px;
}

.question-block {
  padding: 28px 0;
  border-bottom: 1px solid #F3F4F6;
}
.question-block:last-child { border-bottom: none; }

.question-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.question-number {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  min-width: 24px;
}
.domain-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.domain-badge.numerical { background: #dbeafe; color: #1d4ed8; }
.domain-badge.verbal { background: #fce7f3; color: #be185d; }
.domain-badge.figural { background: #d1fae5; color: #065f46; }
.family-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f3f4f6;
  color: #6B7280;
}
.question-answered-check {
  margin-left: auto;
  color: #059669;
  font-size: 16px;
  display: none;
}
.question-block.answered .question-answered-check { display: inline; }

.question-stem {
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 16px;
  padding-left: 34px;
  white-space: pre-line;
  color: #1F2937;
}

/* ── Answer Options ──────────────────────────────────── */
.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-left: 34px;
}
.opt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  flex: 0 1 auto;
}
.opt-btn:hover {
  border-color: #b0c4ee;
  background: #F8FAFF;
  box-shadow: 0 1px 4px rgba(67,97,238,0.06);
}
.opt-btn.selected {
  border-color: #4361ee;
  background: #EEF2FF;
  box-shadow: 0 0 0 2px rgba(67,97,238,0.1);
}
.opt-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F3F4F6;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.opt-btn.selected .opt-label {
  background: #4361ee;
  color: #fff;
}
.opt-text {
  white-space: nowrap;
}

/* Value comparison: keep same inline but slightly wider */
.options-row.vc-options .opt-btn {
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}
.options-row.vc-options .opt-text {
  white-space: normal;
  text-align: center;
}

/* ── Figural stem & options ──────────────────────────── */
.figural-stem { white-space: normal; }
.figure-sequence { display: flex; align-items: center; gap: 14px; padding: 20px 0; overflow-x: auto; }
.figure-cell { flex: 0 0 auto; width: 200px; height: 200px; }
.figure-cell svg { width: 100%; height: 100%; display: block; }
.options-row.figural-options { display: grid; grid-template-columns: repeat(4, auto); gap: 14px; justify-content: start; }
/* All figural option buttons: no extra card wrapper, just a clickable area */
.options-row.figural-options .opt-btn {
  flex-direction: column;
  align-items: center;
  padding: 4px;
  border: 1.5px solid transparent;
  background: none;
  box-shadow: none;
}
.options-row.figural-options .opt-btn:hover {
  border-color: #b0c4ee;
  background: #F8FAFF;
  box-shadow: 0 1px 4px rgba(67,97,238,0.06);
}
.options-row.figural-options .opt-btn.selected {
  border-color: #4361ee;
  background: #EEF2FF;
  box-shadow: 0 0 0 2px rgba(67,97,238,0.1);
}
.options-row.figural-options .opt-label { margin-bottom: 2px; }
/* SVG fills the button directly — no extra card/box */
.figural-opt-svg { white-space: normal; display: flex; justify-content: center; align-items: center; width: 200px; height: 200px; }
.figural-opt-svg svg { width: 100%; height: 100%; display: block; }
/* Odd-one-out options match standard figural size */
/* Remove the SVG internal background-rect border */
.figural-opt-svg svg > rect:first-child { stroke: none !important; }
.figure-reference-area {
  background: none;
  border: none;
  padding: 12px 0;
  margin-bottom: 16px;
}
.figure-reference-area .figure-cell {
  width: 200px; height: 200px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.figure-instruction { font-size: 14px; color: #6B7280; margin-top: 10px; line-height: 1.5; }
.figure-analogy-stem { display: flex; align-items: center; gap: 12px; padding: 16px 0; flex-wrap: wrap; }
.figure-analogy-sep { font-size: 15px; color: #4B5563; font-weight: 600; font-style: italic; white-space: nowrap; text-transform: lowercase; letter-spacing: 0.02em; }

/* ── Page Navigation ─────────────────────────────────── */
.page-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 0;
  border-top: 1px solid #F3F4F6;
}
.page-nav-btn {
  padding: 8px 16px;
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.page-nav-btn:hover:not(:disabled) { border-color: #4361ee; color: #4361ee; }
.page-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.page-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}
.page-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: #9CA3AF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.page-dot:hover { border-color: #4361ee; color: #4361ee; }
.page-dot.current {
  background: #4361ee;
  border-color: #4361ee;
  color: #fff;
}
.page-dot.complete {
  background: #d1fae5;
  border-color: #059669;
  color: #059669;
}
.page-dot.current.complete {
  background: #4361ee;
  border-color: #4361ee;
  color: #fff;
}

.test-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 32px;
}

/* ── Test layout responsive ─────────────────────────── */
@media (max-width: 900px) {
  .test-container .app-grid { padding: 0 24px; }
}
@media (max-width: 600px) {
  .test-container .app-grid { padding: 0 16px; }
}

