/* ============================================
   HP-akuten — Scandinavian Design System
   ============================================ */

/* --- Custom Properties --- */
:root {
  /* Colors */
  --bg: #F7F8FA;
  --card: #FFFFFF;
  --primary: #1A1D26;
  --accent: #6B8ABF;
  --accent-hover: #5A7AB0;
  --accent-rgb: 107, 138, 191;
  --muted: #9CA3AF;
  --border: #E5E7EB;
  --success: #4B9B6B;
  --success-bg: #F2F8F5;
  --error: #C45555;
  --error-bg: #FDF5F5;
  --warning: #C49A3C;
  --warning-bg: #FAF7F0;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Radii */
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.02);

  /* Transitions */
  --transition: 150ms ease;
  --transition-slow: 300ms ease;
}

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

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

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--primary);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Navigation --- */
.nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.nav__logo-icon {
  color: var(--accent);
  font-size: var(--text-xl);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav__link {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}

.nav__link:hover {
  color: var(--primary);
  background: var(--bg);
}

.nav__link.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.06);
}

.nav__mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-2);
}

.nav__mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: transform var(--transition);
}

/* --- App Container --- */
.app-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-16);
  min-height: calc(100vh - 64px);
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: var(--space-12) 0 var(--space-10);
}

.hero__title {
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* --- Hero Gradient (Dashboard) --- */
.hero--gradient {
  text-align: center;
  padding: var(--space-12) var(--space-6) var(--space-10);
  margin: calc(-1 * var(--space-8)) calc(-50vw + 50%) var(--space-8);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.06) 0%, rgba(var(--accent-rgb), 0.02) 50%, transparent 100%);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.06);
}

.hero--gradient__title {
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: var(--space-3);
}

.hero--gradient__subtitle {
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto var(--space-8);
  line-height: 1.6;
}

.hero--gradient__cta {
  display: inline-flex;
}

/* --- Quick Actions (3-col grid) --- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.quick-actions__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-6) var(--space-4);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}

.quick-actions__card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.quick-actions__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.quick-actions__icon--accent {
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.quick-actions__icon--success {
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
}

.quick-actions__icon--warning {
  background: rgba(245, 158, 11, 0.08);
  color: var(--warning);
}

.quick-actions__title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.quick-actions__text {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.5;
}

/* --- Dashboard Stats Row --- */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.dash-stats__card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-4);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.dash-stats__value {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.dash-stats__value--accent {
  color: var(--accent);
}

.dash-stats__value--success {
  color: var(--success);
}

.dash-stats__label {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Category List (horizontal rows) --- */
.category-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-10);
}

.category-row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-8);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.category-row:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.category-row__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
}

.category-row__icon--accent {
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.category-row__icon--success {
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
}

.category-row__icon--warning {
  background: rgba(245, 158, 11, 0.08);
  color: var(--warning);
}

.category-row__icon--nog {
  background: rgba(90, 158, 150, 0.08);
  color: #5A9E96;
}

.category-row__info {
  flex: 0 0 200px;
}

.category-row__title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.category-row__desc {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.4;
}

.category-row__progress-wrap {
  flex: 1;
  min-width: 120px;
}

.category-row__btn {
  flex-shrink: 0;
}

/* --- Nav Logo SVG --- */
.nav__logo-svg {
  flex-shrink: 0;
}

.nav__logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.nav__logo-text {
  white-space: nowrap;
}

/* --- Login Screen Logo --- */
.login-screen__logo {
  margin-bottom: var(--space-6);
}

.login-screen__logo-img {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

/* --- Cards --- */
.card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card--clickable {
  cursor: pointer;
}

.card--clickable:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.card__header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: 700;
  flex-shrink: 0;
}

.card__icon--xyz {
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.card__icon--kva {
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
}

.card__icon--ord {
  background: rgba(245, 158, 11, 0.08);
  color: var(--warning);
}

.card__icon--nog {
  background: rgba(90, 158, 150, 0.08);
  color: #5A9E96;
}

.card__title {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card__description {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
  color: var(--muted);
}

.card__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* --- Grid Layouts --- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: var(--primary);
  color: white;
}

.btn--primary:hover {
  background: #2A2D38;
}

.btn--accent {
  background: var(--accent);
  color: white;
}

.btn--accent:hover {
  background: var(--accent-hover);
}

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

.btn--outline:hover {
  background: var(--bg);
  border-color: var(--accent);
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  padding: var(--space-2) var(--space-4);
}

.btn--ghost:hover {
  background: rgba(var(--accent-rgb), 0.06);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn--full {
  width: 100%;
}

.btn--success {
  background: var(--success);
  color: white;
}

.btn--success:hover {
  background: #3F8A5C;
}

.btn--warning {
  background: var(--warning);
  color: white;
}

.btn--warning:hover {
  background: #B08A34;
}

.btn--nog {
  background: #5A9E96;
  color: white;
}

.btn--nog:hover {
  background: #4D8B84;
}

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

/* --- Progress Bar --- */
.progress {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress--lg {
  height: 8px;
  border-radius: 4px;
}

.progress__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width var(--transition-slow);
}

.progress__fill--success {
  background: var(--success);
}

.progress__fill--warning {
  background: var(--warning);
}

.progress__fill--nog {
  background: #5A9E96;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  color: var(--muted);
}

/* --- Question View --- */
.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.question-header__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
}

.question-header__progress {
  font-size: var(--text-sm);
  color: var(--muted);
}

.question-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: var(--space-6);
}

.question-card__text {
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.7;
  margin-bottom: var(--space-2);
}

.question-card__premise {
  font-size: var(--text-base);
  color: var(--muted);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

/* KVA Quantities */
.kva-quantities {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-6);
  align-items: center;
  margin: var(--space-8) 0;
}

.kva-quantity {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
}

.kva-quantity__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.kva-quantity__value {
  font-size: var(--text-2xl);
  font-weight: 600;
}

.kva-vs {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* NOG statements */
.nog-statements {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.nog-statement {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-2, var(--bg));
  border-radius: var(--radius-md, var(--radius));
  border-left: 2px solid var(--accent);
}

.nog-statement__label {
  font-weight: 700;
  color: var(--accent);
  min-width: 2rem;
}

.nog-statement__text {
  flex: 1;
}

/* --- Options --- */
.options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  font-size: var(--text-base);
}

.option:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.02);
}

.option.selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.04);
}

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

.option.incorrect {
  border-color: var(--error);
  background: var(--error-bg);
}

.option.correct-answer {
  border-color: var(--success);
  background: var(--success-bg);
}

.option__letter {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
  background: var(--bg);
  color: var(--primary);
  flex-shrink: 0;
  transition: all var(--transition);
}

.option.selected .option__letter {
  background: var(--accent);
  color: white;
}

.option.correct .option__letter {
  background: var(--success);
  color: white;
}

.option.incorrect .option__letter {
  background: var(--error);
  color: white;
}

.option.correct-answer .option__letter {
  background: var(--success);
  color: white;
}

.option__text {
  flex: 1;
  line-height: 1.5;
}

.option__icon {
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.option[disabled] {
  cursor: default;
  pointer-events: none;
}

/* --- Feedback --- */
.feedback {
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  animation: slideIn 0.3s ease;
}

.feedback--correct {
  background: var(--success-bg);
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.feedback--incorrect {
  background: var(--error-bg);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.feedback__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.feedback--correct .feedback__title {
  color: var(--success);
}

.feedback--incorrect .feedback__title {
  color: var(--error);
}

.feedback__text {
  color: var(--primary);
  line-height: 1.6;
}

/* --- Solution Steps --- */
.solution {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  animation: slideIn 0.3s ease;
}

.solution__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.solution__steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.solution__step {
  display: flex;
  gap: var(--space-4);
}

.solution__step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}

.solution__step-text {
  flex: 1;
  line-height: 1.7;
  font-size: var(--text-base);
}

.solution__insight {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: rgba(var(--accent-rgb), 0.04);
  border-radius: var(--radius-lg);
  border-left: 2px solid var(--accent);
}

.solution__insight-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.solution__insight-text {
  line-height: 1.6;
}

.solution__mistakes {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: rgba(245, 158, 11, 0.04);
  border-radius: var(--radius-lg);
  border-left: 2px solid var(--warning);
}

.solution__mistakes-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--warning);
  margin-bottom: var(--space-2);
}

.solution__mistakes-list {
  list-style: none;
}

.solution__mistakes-list li {
  padding: var(--space-1) 0;
  padding-left: var(--space-4);
  position: relative;
  line-height: 1.6;
}

.solution__mistakes-list li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--warning);
}

/* --- Stats --- */
.stat-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
}

.stat-card__value {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}

.stat-card__value--accent {
  color: var(--accent);
}

.stat-card__value--success {
  color: var(--success);
}

.stat-card__label {
  font-size: var(--text-sm);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Quick Stats Row --- */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-10);
}

/* --- Section Titles --- */
.section-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
}

.section-title--spaced {
  margin-top: var(--space-10);
}

.section-subtitle {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: calc(-1 * var(--space-4));
  margin-bottom: var(--space-6);
}

/* --- Action Row --- */
.action-row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.action-row--between {
  justify-content: space-between;
}

.action-row--end {
  justify-content: flex-end;
}

/* --- Exam Mode --- */
.exam-intro {
  text-align: center;
  padding: var(--space-12) 0;
}

.exam-intro__icon {
  font-size: 48px;
  margin-bottom: var(--space-6);
}

.exam-intro__title {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.exam-intro__description {
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto var(--space-8);
  line-height: 1.6;
}

.exam-info {
  display: flex;
  gap: var(--space-8);
  justify-content: center;
  margin-bottom: var(--space-8);
  font-size: var(--text-sm);
  color: var(--muted);
}

.exam-timer {
  font-size: var(--text-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  text-align: center;
  margin-bottom: var(--space-4);
}

/* --- Difficulty Badge --- */
.difficulty {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.difficulty__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.difficulty__dot--filled {
  background: var(--accent);
}

/* --- Results Screen --- */
.results {
  text-align: center;
  padding: var(--space-12) 0;
}

.results__score {
  font-size: 64px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.results__label {
  font-size: var(--text-lg);
  color: var(--muted);
  margin-bottom: var(--space-8);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--space-16) 0;
  color: var(--muted);
}

.empty-state__icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
}

.empty-state__text {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.empty-state__subtext {
  font-size: var(--text-sm);
}

/* --- Animations --- */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* --- Login Screen --- */
.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  text-align: center;
  padding: var(--space-6) var(--space-6) var(--space-10);
  margin: calc(-1 * var(--space-8)) calc(-50vw + 50%) calc(-1 * var(--space-16));
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.08) 0%, rgba(var(--accent-rgb), 0.04) 40%, var(--bg) 100%);
  overflow-x: hidden;
}

.login-screen__hero {
  margin-bottom: var(--space-6);
}

.login-screen__logo {
  margin-bottom: var(--space-3);
}

.login-screen__title {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-3);
  background: linear-gradient(135deg, #6B8ABF, #8FADD4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-screen__tagline {
  font-size: var(--text-lg);
  color: var(--muted);
  line-height: 1.6;
}

.login-screen__features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  max-width: 520px;
  width: 100%;
  margin-bottom: var(--space-8);
  text-align: left;
}

.login-screen__feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.login-screen__feature-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-screen__feature-icon--accent {
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.login-screen__feature-icon--success {
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
}

.login-screen__feature-icon--warning {
  background: rgba(245, 158, 11, 0.08);
  color: var(--warning);
}

.login-screen__feature-icon--nog {
  background: rgba(90, 158, 150, 0.08);
  color: #5A9E96;
}

.login-screen__feature-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 2px;
}

.login-screen__feature-text {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.4;
}

.login-screen__google-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-8);
  background: white;
  color: var(--primary);
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  margin-bottom: var(--space-4);
}

.login-screen__google-btn:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--muted);
}

.login-screen__google-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-screen__footnote {
  font-size: var(--text-sm);
  color: var(--muted);
}

/* --- User Nav --- */
.nav__user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: var(--space-4);
}

.nav__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.btn--sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

/* --- Hints --- */
.hints {
  background: rgba(var(--accent-rgb), 0.03);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  animation: slideIn 0.3s ease;
}

.hints__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

.hints__step {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.hints__step + .hints__step {
  border-top: 1px solid rgba(var(--accent-rgb), 0.08);
  padding-top: var(--space-3);
  margin-top: var(--space-2);
}

.hints__step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}

.hints__step-text {
  flex: 1;
  line-height: 1.6;
  color: var(--muted);
  font-size: var(--text-sm);
}

.btn--hint {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.btn--hint:hover:not(:disabled) {
  background: rgba(var(--accent-rgb), 0.06);
  border-color: var(--accent);
}

.btn--hint:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--muted);
  border-color: var(--border);
}

/* --- AI Tutor --- */
.tutor {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  animation: slideIn 0.3s ease;
}

.tutor__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.tutor__messages {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  max-height: 70vh;
  overflow-y: auto;
}

.tutor__message {
  max-width: 85%;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  line-height: 1.7;
  font-size: var(--text-base);
  animation: slideIn 0.2s ease;
}

.tutor__message--ai {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
}

.tutor__message--ai p {
  margin-bottom: var(--space-3);
}

.tutor__message--ai p:last-child {
  margin-bottom: 0;
}

.tutor__message--ai ol,
.tutor__message--ai ul {
  margin: var(--space-3) 0;
  padding-left: var(--space-6);
}

.tutor__message--ai ul {
  list-style: none;
}

.tutor__message--ai ul li {
  position: relative;
  padding-left: var(--space-4);
}

.tutor__message--ai ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.tutor__message--ai ol li,
.tutor__message--ai ul li {
  margin-bottom: var(--space-2);
  line-height: 1.7;
}

.tutor__message--ai strong {
  color: var(--accent);
  font-weight: 600;
}

.tutor__message--user {
  align-self: flex-end;
  background: var(--accent);
  color: white;
}

.tutor__message--user .katex {
  color: white;
}

.tutor__input {
  display: flex;
  gap: var(--space-3);
}

.tutor__input input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--primary);
  outline: none;
  transition: border-color var(--transition);
}

.tutor__input input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
  outline: 2px solid transparent;
}

.tutor__input input::placeholder {
  color: var(--muted);
}

.tutor__loading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  color: var(--muted);
  font-size: var(--text-sm);
  animation: fadeIn 0.3s ease;
}

.tutor__loading-dots {
  display: flex;
  gap: 4px;
}

.tutor__loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: tutorPulse 1.4s ease-in-out infinite;
}

.tutor__loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.tutor__loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes tutorPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.btn--tutor {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.btn--tutor:hover {
  background: rgba(var(--accent-rgb), 0.06);
  border-color: var(--accent);
}

@media (max-width: 768px) {
  .tutor {
    padding: var(--space-5);
  }

  .tutor__message {
    max-width: 92%;
  }

  .tutor__messages {
  }
}

/* --- Login Error --- */
.login-screen__error {
  color: var(--error);
  font-size: var(--text-sm);
  margin-top: var(--space-4);
  animation: fadeIn 0.3s ease;
}

@media (max-width: 540px) {
  .login-screen__features {
    grid-template-columns: 1fr;
    max-width: 340px;
  }

  .login-screen__title {
    font-size: var(--text-3xl);
  }

  .login-screen__logo-img {
    width: 72px;
    height: 72px;
  }

  .login-screen__cta {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-sm);
  }
}

/* --- KaTeX overrides --- */
.katex {
  font-size: 1.1em;
}

.question-card__text .katex {
  font-size: 1.2em;
}

.kva-quantity__value .katex {
  font-size: 1.3em;
}

/* --- Practice Selection --- */
.practice-selection {
  padding: var(--space-8) 0;
}

.practice-selection__title {
  font-size: var(--text-3xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-2);
}

.practice-selection__subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: var(--space-10);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--card);
    flex-direction: column;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav__links.open {
    display: flex;
  }

  .nav__mobile-toggle {
    display: flex;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }

  .hero__title,
  .hero--gradient__title {
    font-size: var(--text-3xl);
  }

  .quick-actions {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .quick-actions__card {
    flex-direction: row;
    text-align: left;
    padding: var(--space-4) var(--space-5);
    gap: var(--space-4);
  }

  .quick-actions__icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0;
  }

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

  .category-row {
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
  }

  .category-row__info {
    flex: 1;
    min-width: 0;
  }

  .category-row__progress-wrap {
    flex-basis: 100%;
    order: 4;
  }

  .category-row__btn {
    order: 3;
  }

  .question-card {
    padding: var(--space-6);
  }

  .kva-quantities {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .kva-vs {
    text-align: center;
  }

  .app-container {
    padding: var(--space-6) var(--space-4) var(--space-12);
  }

  .action-row {
    flex-direction: column;
  }

  .action-row .btn {
    width: 100%;
  }

  .nav__user {
    margin-left: auto;
  }

  .nav__user #btn-logout {
    display: none;
  }

  .hints {
    padding: var(--space-4);
  }
}

/* --- Admin Panel --- */
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.admin-table__header {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}

.admin-table__header--right {
  text-align: right;
}

.admin-table__row {
  transition: background var(--transition);
}

.admin-table__row:hover {
  background: var(--bg);
}

.admin-table__row + .admin-table__row {
  border-top: 1px solid var(--border);
}

.admin-table__cell {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.admin-table__cell--right {
  text-align: right;
}

.admin-table__user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.admin-table__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.admin-table__name {
  font-weight: 600;
  color: var(--primary);
}

.admin-table__email {
  font-size: var(--text-xs);
  color: var(--muted);
}

.admin-table__good {
  color: var(--success);
  font-weight: 600;
}

.admin-table__bad {
  color: var(--error);
  font-weight: 600;
}

@media (max-width: 768px) {
  .admin-table__cell,
  .admin-table__header {
    padding: var(--space-3) var(--space-3);
  }

  .admin-table__avatar {
    width: 28px;
    height: 28px;
  }

  .admin-table__email {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero__title,
  .hero--gradient__title {
    font-size: var(--text-2xl);
  }

  .hero--gradient__subtitle {
    font-size: var(--text-base);
  }

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

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

  .exam-info {
    flex-direction: column;
    gap: var(--space-2);
    align-items: center;
  }
}

/* ============================================
   Past Exams — Listing
   ============================================ */
.past-exams__header {
  text-align: center;
  padding: var(--space-8) 0 var(--space-10);
}

.past-exams__title {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-2);
}

.past-exams__subtitle {
  color: var(--muted);
  font-size: var(--text-base);
}

.past-exams__year-group {
  margin-bottom: var(--space-8);
}

.past-exams__year-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.past-exams__exam {
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-3);
}

.past-exams__exam-header {
  margin-bottom: var(--space-4);
}

.past-exams__exam-name {
  font-size: var(--text-lg);
  font-weight: 600;
}

.past-exams__passes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.past-exams__pass-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--primary);
  transition: all var(--transition);
  text-decoration: none;
}

.past-exams__pass-btn:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.03);
}

.past-exams__pass-btn--done {
  border-color: var(--success);
  background: var(--success-bg);
}

.past-exams__pass-label {
  font-weight: 600;
}

.past-exams__result {
  font-size: var(--text-xs);
  color: var(--success);
  font-weight: 600;
}

/* ============================================
   Past Exam Session — PDF + Answer Grid
   ============================================ */
.pe-session {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-4);
  height: calc(100vh - 96px);
  margin: calc(-1 * var(--space-8)) calc(-1 * var(--space-6)) calc(-1 * var(--space-16));
  padding: var(--space-4);
}

.pe-session__pdf {
  min-height: 0;
}

.pe-session__pdf-viewer {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.pe-session__sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
}

.pe-session__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pe-session__title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.pe-session__timer {
  font-size: var(--text-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.pe-session__progress {
  font-size: var(--text-sm);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pe-grid {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-right: var(--space-2);
}

.pe-grid__section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-3) 0 var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-1);
}

.pe-grid__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.pe-grid__num {
  width: 24px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  text-align: right;
  flex-shrink: 0;
}

.pe-grid__opts {
  display: flex;
  gap: 4px;
  flex: 1;
}

.pe-grid__opt {
  flex: 1;
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font);
  color: var(--primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.pe-grid__opt:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.04);
}

.pe-grid__opt--selected {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.pe-session__actions {
  padding-top: var(--space-2);
}

/* ============================================
   Past Exam — Results
   ============================================ */
.pe-results {
  max-width: 720px;
  margin: 0 auto;
}

.pe-results__header {
  text-align: center;
  padding: var(--space-8) 0 var(--space-4);
}

.pe-results__title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.pe-results__score {
  font-size: 64px;
  font-weight: 700;
  color: var(--accent);
}

.pe-results__pct {
  font-size: var(--text-lg);
  color: var(--muted);
  margin-bottom: var(--space-4);
}

.pe-results__sections {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.pe-results__section-stat {
  padding: var(--space-2) var(--space-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
}

.pe-results__table-wrap {
  overflow-x: auto;
  margin: var(--space-8) 0;
}

.pe-results__table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.pe-results__table th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.pe-results__table td {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border);
}

.pe-results__section-row td {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg);
  padding: var(--space-2) var(--space-4);
}

.pe-results__correct td:nth-child(4) {
  color: var(--success);
  font-weight: 600;
}

.pe-results__wrong td:nth-child(4) {
  color: var(--error);
  font-weight: 600;
}

.pe-results__skip td {
  color: var(--muted);
}

/* ============================================
   Past Exam — Responsive
   ============================================ */
@media (max-width: 768px) {
  .past-exams__passes {
    grid-template-columns: 1fr 1fr;
  }

  .pe-session {
    grid-template-columns: 1fr;
    height: auto;
    margin: 0;
    padding: 0;
  }

  .pe-session__pdf {
    height: 50vh;
  }

  .pe-session__sidebar {
    max-height: 50vh;
  }

  .pe-grid {
    max-height: 300px;
  }
}

@media (max-width: 480px) {
  .past-exams__passes {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

  .pe-results__sections {
    flex-direction: column;
    align-items: center;
  }
}

/* ============================================
   Exam Selection — Test Type Cards
   ============================================ */
.exam-selection__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
  max-width: 720px;
  margin: 0 auto;
}

.exam-selection__card {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-6);
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.exam-selection__card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.exam-selection__card--accent:hover { border-color: var(--accent); }
.exam-selection__card--success:hover { border-color: var(--success); }
.exam-selection__card--warning:hover { border-color: var(--warning); }
.exam-selection__card--nog:hover { border-color: #5A9E96; }

.exam-selection__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
}

.exam-selection__icon--accent { background: rgba(var(--accent-rgb), 0.08); color: var(--accent); }
.exam-selection__icon--success { background: rgba(22, 163, 74, 0.08); color: var(--success); }
.exam-selection__icon--warning { background: rgba(245, 158, 11, 0.08); color: var(--warning); }
.exam-selection__icon--nog { background: rgba(90, 158, 150, 0.08); color: #5A9E96; }

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

.exam-selection__label {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: 2px;
}

.exam-selection__desc {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.4;
}

.exam-selection__meta {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: var(--space-1);
}

/* ============================================
   Test Session History — Collapsible Items
   ============================================ */
.test-session__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.test-session {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.test-session__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: background var(--transition);
  gap: var(--space-3);
}

.test-session__header:hover {
  background: var(--bg);
}

.test-session__header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.test-session__header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
}

.test-session__date {
  font-size: var(--text-sm);
  color: var(--muted);
}

.test-session__score {
  font-weight: 600;
}

.test-session__time {
  color: var(--muted);
}

.test-session__chevron {
  color: var(--muted);
  font-size: var(--text-xs);
  transition: transform var(--transition);
}

.test-session__detail {
  padding: var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--bg);
  animation: slideIn 0.2s ease;
}

/* ============================================
   AI Summary Card
   ============================================ */
.ai-summary {
}

.ai-summary__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.ai-summary__content {
  line-height: 1.7;
}

.ai-summary__content p {
  margin-bottom: var(--space-3);
}

.ai-summary__content p:last-child {
  margin-bottom: 0;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
  display: none !important;
}

/* ============================================
   Responsive — Exam Selection + Test Sessions
   ============================================ */
@media (max-width: 768px) {
  .exam-selection__grid {
    grid-template-columns: 1fr;
  }

  .test-session__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .test-session__header-right {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
}

@media (max-width: 480px) {
  .exam-selection__card {
    padding: var(--space-4);
    gap: var(--space-3);
  }

  .exam-selection__icon {
    width: 42px;
    height: 42px;
  }
}

/* ============================================
   Gamification — Confetti
   ============================================ */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -10px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 2s ease-out forwards, confettiSway 1s ease-in-out infinite;
}

@keyframes confettiFall {
  0% { top: -10px; opacity: 1; }
  100% { top: 100vh; opacity: 0; }
}

@keyframes confettiSway {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(15px) rotate(90deg); }
  75% { transform: translateX(-15px) rotate(270deg); }
}

/* ============================================
   Gamification — XP Popup
   ============================================ */
.xp-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  pointer-events: none;
  z-index: 1001;
  animation: xpFloat 1.5s ease-out forwards;
}

.xp-popup__bonus {
  display: block;
  font-size: var(--text-sm);
  color: var(--warning);
  font-weight: 600;
}

@keyframes xpFloat {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  20% { opacity: 1; transform: translate(-50%, -70%) scale(1.2); }
  40% { opacity: 1; transform: translate(-50%, -80%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(0.8); }
}

/* ============================================
   Gamification — Streak Milestone
   ============================================ */
.streak-milestone {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
  border: 2px solid var(--warning);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-12);
  font-size: var(--text-2xl);
  font-weight: 700;
  text-align: center;
  z-index: 1002;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(196, 154, 60, 0.2);
  pointer-events: none;
  animation: streakBounce 2.5s ease-out forwards;
}

@keyframes streakBounce {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  30% { transform: translate(-50%, -50%) scale(0.95); }
  45% { transform: translate(-50%, -50%) scale(1.02); }
  60% { transform: translate(-50%, -50%) scale(1); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* ============================================
   Gamification — Celebration Pulse
   ============================================ */
.celebration-pulse {
  animation: celebrationPulse 0.6s ease;
}

@keyframes celebrationPulse {
  0% { box-shadow: 0 0 0 0 rgba(75, 155, 107, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(75, 155, 107, 0); }
  100% { box-shadow: none; }
}

/* ============================================
   Gamification — Streak Counter
   ============================================ */
.streak-counter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--warning-bg);
  color: var(--warning);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all var(--transition);
}

.streak-counter--active {
  animation: streakPulse 1s ease infinite;
}

@keyframes streakPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ============================================
   Gamification — XP Bar Widget
   ============================================ */
.xp-bar-widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.xp-bar-widget__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.xp-bar-widget__level {
  font-size: var(--text-base);
  font-weight: 600;
}

.xp-bar-widget__xp {
  font-size: var(--text-sm);
  color: var(--muted);
}

.xp-bar {
  width: 100%;
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}

.xp-bar__fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), #8FADD4);
  transition: width var(--transition-slow);
}

.xp-bar__fill--glow {
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.5);
}

/* ============================================
   Gamification — Daily Goal
   ============================================ */
.daily-goal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.daily-goal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.daily-goal__title {
  font-size: var(--text-base);
  font-weight: 600;
}

.daily-goal__streak {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--warning);
}

.daily-goal__bar {
  width: 100%;
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.daily-goal__fill {
  height: 100%;
  border-radius: 5px;
  background: var(--success);
  transition: width var(--transition-slow);
}

.daily-goal__text {
  font-size: var(--text-sm);
  color: var(--muted);
}

/* ============================================
   Gamification — Heatmap Calendar
   ============================================ */
.heatmap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.heatmap__title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.heatmap__grid {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: 14px;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.heatmap__cell {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--border);
}

.heatmap__cell--level-0 { background: var(--border); }
.heatmap__cell--level-1 { background: rgba(75, 155, 107, 0.25); }
.heatmap__cell--level-2 { background: rgba(75, 155, 107, 0.5); }
.heatmap__cell--level-3 { background: rgba(75, 155, 107, 0.75); }
.heatmap__cell--level-4 { background: var(--success); }

.heatmap__legend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--muted);
}

.heatmap__legend-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* ============================================
   Gamification — Weak Topics
   ============================================ */
.weak-topics {
  margin-bottom: var(--space-6);
}

.weak-topics__title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.weak-topic-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-sm);
}

.weak-topic-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.weak-topic-card__info {
  flex: 1;
  min-width: 0;
}

.weak-topic-card__type {
  font-weight: 600;
  font-size: var(--text-sm);
}

.weak-topic-card__stat {
  font-size: var(--text-xs);
  color: var(--muted);
}

.weak-topic-card__action {
  flex-shrink: 0;
}

/* ============================================
   Gamification — Level-up Overlay
   ============================================ */
.level-up {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-12);
  text-align: center;
  z-index: 1002;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(var(--accent-rgb), 0.3);
  pointer-events: none;
  animation: streakBounce 2.5s ease-out forwards;
}

.level-up__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.level-up__name {
  font-size: var(--text-3xl);
  font-weight: 700;
}

/* ============================================
   Gamification — Responsive
   ============================================ */
@media (max-width: 768px) {
  .streak-milestone {
    padding: var(--space-6) var(--space-8);
    font-size: var(--text-xl);
  }

  .level-up {
    padding: var(--space-6) var(--space-8);
  }

  .level-up__name {
    font-size: var(--text-2xl);
  }

  .heatmap__grid {
    grid-auto-columns: 12px;
    gap: 2px;
  }

  .heatmap__cell {
    width: 12px;
    height: 12px;
  }
}
