/* ── Design tokens ─────────────────────────────────────── */
:root {
  --color-primary: #6F14F1;
  --color-primary-dark: #5A0FC8;
  --color-primary-light: #EDE5FF;
  --color-primary-muted: #C4B5FD;
  --color-bg: #F8F7FF;
  --color-bg-alt: #F3F4F9;
  --color-card: #FFFFFF;
  --color-border: #E5E7EB;
  --color-border-focus: #6F14F1;
  --color-text: #111827;
  --color-text-muted: #6B7280;
  --color-success: #059669;
  --color-success-bg: #ECFDF5;
  --color-success-border: #A7F3D0;
  --color-danger: #DC2626;
  --color-danger-bg: #FEF2F2;
  --color-warning: #D97706;
  --color-warning-bg: #FFFBEB;

  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --radius-card: 16px;
  --radius-input: 10px;
  --radius-btn: 12px;

  --shadow-card: 0 4px 24px rgba(111, 20, 241, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-btn: 0 2px 8px rgba(111, 20, 241, 0.25);
  --shadow-option: 0 1px 3px rgba(0, 0, 0, 0.04);

  --transition-fast: 180ms ease;
  --transition-med: 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.page-body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  background-image: radial-gradient(ellipse at 50% 0%, var(--color-bg-alt) 0%, var(--color-bg) 70%);
  display: flex;
  flex-direction: column;
}

/* ── Header ───────────────────────────────────────────── */
.site-header {
  background: var(--color-primary);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.01em;
}

/* ── Main layout ───────────────────────────────────────── */
.main-wrap {
  flex: 1;
  padding: 28px 16px 40px;
  display: flex;
  justify-content: center;
}

.card-shell {
  width: 100%;
  max-width: 560px;
  background: var(--color-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  padding: 28px 24px 32px;
  animation: card-enter 0.5s var(--transition-med) both;
}

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

/* ── Stepper ───────────────────────────────────────────── */
.stepper {
  margin-bottom: 24px;
}

.stepper-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.stepper-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.stepper-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  border: 2px solid var(--color-border);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.stepper-item.active .stepper-dot {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  transform: scale(1.05);
}

.stepper-item.done .stepper-dot {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary-muted);
}

.stepper-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.stepper-item.active .stepper-label {
  color: var(--color-primary);
  font-weight: 600;
}

.stepper-line {
  width: 48px;
  height: 2px;
  background: var(--color-border);
  margin: 0 4px;
  margin-bottom: 22px;
  transition: background var(--transition-med);
}

.stepper-line.done {
  background: var(--color-primary-muted);
}

/* ── Info banner ───────────────────────────────────────── */
.info-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, #8B3FF5 100%);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 28px;
  color: #fff;
  transition: opacity var(--transition-med), max-height var(--transition-med), margin var(--transition-med), padding var(--transition-med);
  overflow: hidden;
}

.info-banner.collapsed {
  opacity: 0;
  max-height: 0;
  padding: 0 20px;
  margin-bottom: 0;
  pointer-events: none;
}

.info-banner-eyebrow {
  margin: 0 0 2px;
  font-size: 0.75rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.info-banner-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.info-banner-meta {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.8;
}

/* ── Step panels ───────────────────────────────────────── */
.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
  animation: panel-in 0.35s var(--transition-med) both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.step-panel.slide-out-left {
  animation: slide-out-left 0.25s var(--transition-med) both;
}

.step-panel.slide-in-right {
  animation: slide-in-right 0.35s var(--transition-med) both;
}

@keyframes slide-out-left {
  to { opacity: 0; transform: translateX(-20px); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.panel-heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.panel-sub {
  margin: 0 0 24px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

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

.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.optional-tag {
  font-weight: 400;
  color: var(--color-text-muted);
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.field-input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-input);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

.field-input:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(111, 20, 241, 0.12);
}

.field-input::placeholder {
  color: #9CA3AF;
}

.field-select {
  padding-right: 40px;
  cursor: pointer;
}

.select-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.field-hint {
  margin: 5px 0 0;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.form-error {
  margin: 0 0 16px;
  padding: 10px 14px;
  background: var(--color-danger-bg);
  border: 1px solid #FECACA;
  border-radius: 8px;
  color: var(--color-danger);
  font-size: 0.85rem;
}

.form-error.hidden { display: none; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-btn);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.btn-primary:not(:disabled):hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

.btn-primary:not(:disabled):active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-border);
}

.btn-ghost:not(:disabled):hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary-muted);
}

.btn-full {
  width: 100%;
}

.btn-arrow {
  width: 18px;
  height: 18px;
}

/* ── Test section ──────────────────────────────────────── */
.test-top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.question-meta {
  flex: 1;
}

.question-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.progress-bar-wrap {
  height: 4px;
  background: var(--color-bg-alt);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
  transition: width var(--transition-med);
  width: 0%;
}

/* Timer */
.timer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 24px;
  background: var(--color-bg-alt);
  border: 1.5px solid var(--color-border);
  flex-shrink: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.timer-icon {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.timer-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  min-width: 44px;
}

.timer.warning {
  background: var(--color-warning-bg);
  border-color: #FCD34D;
  color: var(--color-warning);
  animation: timer-pulse 1s ease infinite;
}

.timer.warning .timer-icon { color: var(--color-warning); }

.timer.danger {
  background: var(--color-danger-bg);
  border-color: #FECACA;
  color: var(--color-danger);
  animation: timer-pulse 0.6s ease infinite;
}

.timer.danger .timer-icon { color: var(--color-danger); }

@keyframes timer-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

/* Question */
.question-area {
  min-height: 280px;
  margin-bottom: 28px;
}

.question-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

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

.option-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-input);
  background: #fff;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--color-text);
  box-shadow: var(--shadow-option);
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  animation: option-in 0.3s var(--transition-med) both;
}

.option-card:nth-child(1) { animation-delay: 0.04s; }
.option-card:nth-child(2) { animation-delay: 0.08s; }
.option-card:nth-child(3) { animation-delay: 0.12s; }
.option-card:nth-child(4) { animation-delay: 0.16s; }

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

.option-card:hover:not(.selected) {
  border-color: var(--color-primary-muted);
  background: var(--color-bg);
  transform: translateX(3px);
}

.option-card.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(111, 20, 241, 0.1);
}

.option-letter {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.option-card.selected .option-letter {
  background: var(--color-primary);
  color: #fff;
}

.option-text {
  flex: 1;
  line-height: 1.4;
}

.test-actions {
  display: flex;
  gap: 12px;
}

.test-actions .btn-primary {
  flex: 1;
}

/* Test arena + watermark */
.test-arena {
  position: relative;
  overflow: hidden;
}

.test-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.test-watermark::before {
  content: attr(data-name);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-24deg);
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 12vw, 4rem);
  font-weight: 700;
  color: var(--color-primary);
  opacity: 0.045;
  white-space: nowrap;
  letter-spacing: 0.08em;
  user-select: none;
}

.test-arena > *:not(.test-watermark):not(.pause-overlay) {
  position: relative;
  z-index: 1;
}

.test-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.engagement-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(111, 20, 241, 0.08);
  border: 1px solid rgba(111, 20, 241, 0.15);
  padding: 3px 10px;
  border-radius: 20px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.engagement-chip.hidden { display: none; }

.engagement-chip.pulse {
  animation: chip-pulse 0.5s ease;
}

@keyframes chip-pulse {
  0%   { transform: scale(1); box-shadow: none; }
  50%  { transform: scale(1.06); box-shadow: 0 0 0 4px rgba(111, 20, 241, 0.12); }
  100% { transform: scale(1); box-shadow: none; }
}

.engagement-chip-icon {
  font-size: 0.65rem;
  opacity: 0.85;
}

.selection-hint {
  margin: -12px 0 16px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.option-card.locked-in {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.option-card.locked-in::after {
  content: 'Locked in';
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  background: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--color-primary-muted);
  flex-shrink: 0;
}

.option-card.selection-pulse {
  animation: selection-pulse 0.45s ease;
}

@keyframes selection-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(111, 20, 241, 0.25); }
  70%  { box-shadow: 0 0 0 8px rgba(111, 20, 241, 0); }
  100% { box-shadow: var(--shadow-option); }
}

/* Pause overlay */
.pause-overlay {
  position: absolute;
  inset: -28px -24px -32px;
  background: rgba(248, 247, 255, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 24px;
  animation: overlay-in 0.3s var(--transition-med) both;
}

.pause-overlay.hidden { display: none; }

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.pause-card {
  text-align: center;
  max-width: 320px;
  background: var(--color-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
}

.pause-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  color: var(--color-primary);
}

.pause-icon svg { width: 100%; height: 100%; }

.pause-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--color-text);
}

.pause-body {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.pause-meta {
  margin: 0 0 18px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.pause-meta strong {
  color: var(--color-primary);
  font-family: var(--font-display);
}

/* Toast stack */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-card);
  border: 1.5px solid var(--color-primary-muted);
  border-left: 4px solid var(--color-primary);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(111, 20, 241, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  pointer-events: auto;
  animation: toast-in 0.35s var(--transition-med) both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.toast-out {
  animation: toast-out 0.25s ease forwards;
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px); }
}

.toast-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--color-primary);
  margin-top: 1px;
}

.toast-content { flex: 1; min-width: 0; }

.toast-title {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

.toast-message {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

/* Modal (fullscreen prompt) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
  animation: overlay-in 0.25s ease both;
}

.modal-backdrop.hidden { display: none; }

.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 60px rgba(111, 20, 241, 0.15);
  padding: 28px 24px;
  text-align: center;
  animation: card-enter 0.4s var(--transition-med) both;
}

.modal-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  color: var(--color-primary);
}

.modal-icon svg { width: 100%; height: 100%; }

.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--color-text);
}

.modal-body {
  margin: 0 0 22px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

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

/* Integrity badge (results) */
.integrity-badge {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, #fff 100%);
  border: 1.5px solid var(--color-primary-muted);
  border-radius: var(--radius-input);
  padding: 16px;
  margin-bottom: 16px;
}

.integrity-badge-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.integrity-badge-icon {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.integrity-badge-title {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.integrity-badge-sub {
  margin: 0;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.integrity-stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.integrity-stat {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(111, 20, 241, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
}

.integrity-stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.integrity-stat-value {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-text);
}

.integrity-stat-value.good { color: var(--color-success); }
.integrity-stat-value.warn { color: var(--color-warning); }
.integrity-stat-value.neutral { color: var(--color-primary); }

/* Streak card (results) */
.streak-card {
  background: var(--color-primary-light);
  border: 1.5px solid var(--color-primary-muted);
  border-radius: var(--radius-input);
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
  animation: panel-in 0.4s var(--transition-med) both;
}

.streak-card.hidden { display: none; }

.streak-label {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
}

.streak-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
}

.streak-note {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* ── Results ───────────────────────────────────────────── */
.result-hero {
  text-align: center;
  margin-bottom: 24px;
}

.result-check {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  color: var(--color-success);
  animation: check-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes check-pop {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

.result-check svg {
  width: 100%;
  height: 100%;
}

.result-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  color: var(--color-success);
}

.result-greeting {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.score-card {
  background: var(--color-success-bg);
  border: 1.5px solid var(--color-success-border);
  border-radius: var(--radius-input);
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.score-label {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-success);
}

.score-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--color-success);
  line-height: 1.1;
}

.score-percent {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.result-callout {
  background: var(--color-primary-light);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 10px 10px 0;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.callout-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.5;
}

.result-details {
  background: var(--color-bg);
  border-radius: var(--radius-input);
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.result-details p {
  margin: 0 0 6px;
}

.result-details p:last-child { margin-bottom: 0; }

.result-details strong {
  color: var(--color-text);
}

#btn-restart { margin-bottom: 10px; }

/* Review panel */
.review-panel {
  animation: panel-in 0.35s var(--transition-med) both;
}

.review-panel.hidden { display: none; }

.review-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  padding: 12px 14px;
  border-radius: var(--radius-input);
  border: 1.5px solid var(--color-border);
  font-size: 0.85rem;
}

.review-item.correct {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
}

.review-item.incorrect {
  border-color: #FECACA;
  background: var(--color-danger-bg);
}

.review-q {
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--color-text);
}

.review-a {
  margin: 0;
  color: var(--color-text-muted);
}

.review-a span { color: var(--color-text); font-weight: 500; }

/* ── Footer ────────────────────────────────────────────── */
.site-footer {
  padding: 20px 16px 28px;
  text-align: center;
}

.footer-text {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.footer-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.footer-link:hover { opacity: 0.75; }

.footer-note {
  margin: 0;
  font-size: 0.75rem;
  color: #9CA3AF;
}

/* ── Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }

  .timer.warning,
  .timer.danger { animation: none; }

  .engagement-chip.pulse,
  .option-card.selection-pulse,
  .toast { animation: none; }
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 480px) {
  .card-shell {
    padding: 22px 16px 28px;
  }

  .stepper-line {
    width: 28px;
  }

  .test-top-bar {
    flex-direction: column;
  }

  .timer {
    align-self: flex-end;
  }

  .test-actions {
    flex-direction: column-reverse;
  }

  .test-actions .btn-ghost {
    width: 100%;
  }

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

  .toast-stack {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}

/* ── Admin Dashboard Layout ────────────────────────────── */
.admin-body {
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  font-family: var(--font-body);
  color: var(--color-text);
  overflow: hidden;
}

.admin-topbar {
  background: var(--color-primary);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 100;
}

.topbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

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

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.admin-brand {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-brand-icon {
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-display);
}

.admin-profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.admin-profile-name { font-size: 0.875rem; font-weight: 600; }
.admin-profile-role { font-size: 0.75rem; opacity: 0.8; }

.admin-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.topbar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: center;
}

.topbar-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  transition: all var(--transition-fast);
}

.topbar-nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.topbar-nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.admin-main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.admin-page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.admin-page-subtitle {
  margin: 4px 0 0 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.date-picker-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  padding: 10px 16px;
  border-radius: var(--radius-btn);
  font-weight: 500;
  color: var(--color-text);
  box-shadow: var(--shadow-option);
  cursor: pointer;
}

/* ── Admin Dashboard Specifics ─────────────────────────── */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.admin-metrics-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.admin-metrics-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--color-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-option);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
}

.metric-icon.purple { background: var(--color-primary-light); color: var(--color-primary); }
.metric-icon.blue { background: #E0F2FE; color: #0284C7; }
.metric-icon.green { background: #DCFCE7; color: #16A34A; }
.metric-icon.orange { background: #FFEDD5; color: #EA580C; }
.metric-icon.red { background: #FEE2E2; color: #DC2626; }
.metric-icon.teal { background: #CCFBF1; color: #0D9488; }

.metric-content {
  flex: 1;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
}

.metric-change {
  font-size: 0.75rem;
  font-weight: 600;
}
.metric-change.positive { color: var(--color-success); }
.metric-change.negative { color: var(--color-danger); }

.metric-vs {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.admin-charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--color-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-option);
  padding: 24px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.admin-table-card {
  background: var(--color-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-option);
  overflow: hidden;
}

.admin-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}

.admin-table-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 12px 24px;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}

.admin-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text);
}

.admin-table tbody tr:hover {
  background: var(--color-bg-alt);
}

.status-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-badge.completed {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

@media (max-width: 1024px) {
  .admin-metrics-grid,
  .admin-metrics-grid-5,
  .admin-metrics-grid-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-metrics-grid,
  .admin-metrics-grid-5,
  .admin-metrics-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .admin-topbar {
    height: auto;
    padding: 16px 24px;
  }
  
  .topbar-container {
    flex-direction: column;
    gap: 16px;
  }
  
  .topbar-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .admin-metrics-grid,
  .admin-metrics-grid-5,
  .admin-metrics-grid-6 {
    grid-template-columns: 1fr;
  }
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}
