/* ============================================
   CyberOps Associate — Design System
   Style coloré, ludique et accessible
   ============================================ */

/* --- Variables & Thème --- */
:root {
  /* Couleurs principales */
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #4A3FCF;
  --secondary: #00CEC9;
  --accent: #FD79A8;
  --accent-alt: #FDCB6E;
  --success: #00B894;
  --danger: #E17055;
  --warning: #FFEAA7;
  --info: #74B9FF;

  /* Couleurs modules */
  --mod1: #E17055; --mod2: #6C5CE7; --mod3: #00CEC9; --mod4: #2D3436;
  --mod5: #0984E3; --mod6: #00B894; --mod7: #FDCB6E; --mod8: #E84393;
  --mod9: #6C5CE7; --mod10: #00CEC9; --mod11: #D63031; --mod12: #636E72;
  --mod13: #E17055; --mod14: #0984E3; --mod15: #00B894; --mod16: #D63031;
  --mod17: #E84393; --mod18: #6C5CE7; --mod19: #00CEC9; --mod20: #FDCB6E;
  --mod21: #0984E3; --mod22: #00B894; --mod23: #E17055;
  --mod24: #636E72; --mod25: #D63031; --mod26: #6C5CE7; --mod27: #00CEC9; --mod28: #E84393;
  --modT1: #FF6B6B; --modT2: #4ECDC4; --modT3: #45B7D1; --modT4: #96CEB4;
  --modT5: #FFEAA7; --modT6: #DDA0DD; --modT7: #FF8C42; --modT8: #6C5CE7;

  /* Neutres */
  --bg: #F8F9FE;
  --bg-card: #FFFFFF;
  --bg-code: #2D3436;
  --text: #2D3436;
  --text-light: #636E72;
  --text-muted: #B2BEC3;
  --border: #DFE6E9;
  --shadow: 0 4px 15px rgba(108, 92, 231, 0.1);
  --shadow-hover: 0 8px 30px rgba(108, 92, 231, 0.2);

  /* Typo */
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.5rem;

  /* Espacement */
  --sp-xs: 0.25rem;
  --sp-sm: 0.5rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2rem;
  --sp-2xl: 3rem;

  /* Borders */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  /* Sidebar */
  --sidebar-width: 280px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }
ul, ol { padding-left: var(--sp-lg); }

/* --- Layout Principal --- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
  padding-bottom: var(--sp-xl);
}
.sidebar-header {
  padding: var(--sp-lg);
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.sidebar-header h1 {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.5px;
}
.sidebar-header .subtitle {
  font-size: var(--fs-xs);
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: var(--sp-xs);
}
.sidebar-nav { padding: var(--sp-md) 0; }
.sidebar-nav .nav-group {
  margin-bottom: var(--sp-sm);
}
.sidebar-nav .nav-group-title {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.6;
  padding: var(--sp-sm) var(--sp-lg);
  font-weight: 600;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-lg);
  color: rgba(255,255,255,0.85);
  font-size: var(--fs-sm);
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  border-left-color: var(--accent);
}
.sidebar-nav a.active {
  background: rgba(255,255,255,0.15);
  color: white;
  border-left-color: var(--accent);
  font-weight: 600;
}
.sidebar-nav .nav-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
  font-size: var(--fs-xs);
  font-weight: 700;
  flex-shrink: 0;
}

/* Menu hamburger mobile */
.menu-toggle {
  display: none;
  position: fixed;
  top: var(--sp-md);
  left: var(--sp-md);
  z-index: 200;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* Hero / Header Module */
.module-hero {
  padding: var(--sp-2xl) var(--sp-2xl) var(--sp-xl);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
}
.module-hero .breadcrumb {
  font-size: var(--fs-sm);
  opacity: 0.8;
  margin-bottom: var(--sp-md);
}
.module-hero .breadcrumb a { color: rgba(255,255,255,0.8); }
.module-hero .breadcrumb a:hover { color: white; }
.module-hero h1 {
  font-size: var(--fs-3xl);
  font-weight: 800;
  margin-bottom: var(--sp-sm);
  line-height: 1.2;
}
.module-hero .module-badge {
  display: inline-block;
  padding: var(--sp-xs) var(--sp-md);
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--sp-md);
}
.module-hero .module-desc {
  font-size: var(--fs-lg);
  opacity: 0.9;
  max-width: 700px;
}
.module-hero .objectives {
  margin-top: var(--sp-lg);
  list-style: none;
  padding: 0;
}
.module-hero .objectives li {
  padding: var(--sp-xs) 0;
  padding-left: var(--sp-lg);
  position: relative;
  opacity: 0.9;
}
.module-hero .objectives li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-alt);
  font-weight: 700;
}

/* Contenu principal */
.content-area {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--sp-xl) var(--sp-2xl) var(--sp-2xl);
}

/* --- Sections pédagogiques --- */
.section {
  margin-bottom: var(--sp-2xl);
}
.section-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding-bottom: var(--sp-sm);
  border-bottom: 3px solid var(--primary-light);
}

/* Section types avec indicateurs visuels */
.section--theory { border-left: 4px solid var(--primary); padding-left: var(--sp-lg); }
.section--lab { border-left: 4px solid var(--success); padding-left: var(--sp-lg); }
.section--quiz { border-left: 4px solid var(--accent); padding-left: var(--sp-lg); }
.section--schema { border-left: 4px solid var(--info); padding-left: var(--sp-lg); }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: var(--sp-lg);
  box-shadow: var(--shadow);
  margin-bottom: var(--sp-lg);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.card h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
}
.card p { color: var(--text-light); }

/* --- Analogie Box --- */
.analogy {
  background: linear-gradient(135deg, #FFF3E0 0%, #FFECB3 100%);
  border-radius: var(--radius);
  padding: var(--sp-lg);
  margin: var(--sp-lg) 0;
  border-left: 4px solid var(--accent-alt);
  position: relative;
}
.analogy::before {
  content: "💡 Analogie";
  font-weight: 700;
  color: #E65100;
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: var(--sp-sm);
}
.analogy p { color: #5D4037; }

/* --- Alerte / Important --- */
.alert {
  border-radius: var(--radius);
  padding: var(--sp-lg);
  margin: var(--sp-lg) 0;
}
.alert--info {
  background: #E3F2FD;
  border-left: 4px solid var(--info);
  color: #1565C0;
}
.alert--warning {
  background: #FFF8E1;
  border-left: 4px solid var(--accent-alt);
  color: #E65100;
}
.alert--danger {
  background: #FFEBEE;
  border-left: 4px solid var(--danger);
  color: #C62828;
}
.alert--success {
  background: #E8F5E9;
  border-left: 4px solid var(--success);
  color: #2E7D32;
}
.alert-title {
  font-weight: 700;
  margin-bottom: var(--sp-xs);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Code / Terminal --- */
.code-block {
  background: var(--bg-code);
  border-radius: var(--radius);
  padding: var(--sp-lg);
  margin: var(--sp-lg) 0;
  overflow-x: auto;
  position: relative;
}
.code-block pre {
  color: #DFE6E9;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}
.code-block .code-label {
  position: absolute;
  top: var(--sp-sm);
  right: var(--sp-sm);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  padding: 2px var(--sp-sm);
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
}
code {
  font-family: var(--font-mono);
  background: #EDF2F7;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--primary-dark);
}

/* --- Terminal interactif --- */
.terminal {
  background: #1a1a2e;
  border-radius: var(--radius);
  overflow: hidden;
  margin: var(--sp-lg) 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.terminal-header {
  background: #16213e;
  padding: var(--sp-sm) var(--sp-md);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.terminal-dot.red { background: #E17055; }
.terminal-dot.yellow { background: #FDCB6E; }
.terminal-dot.green { background: #00B894; }
.terminal-title {
  color: rgba(255,255,255,0.5);
  font-size: var(--fs-xs);
  margin-left: var(--sp-sm);
  font-family: var(--font-mono);
}
.terminal-body {
  padding: var(--sp-lg);
  min-height: 200px;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: #00FF41;
  line-height: 1.8;
}
.terminal-body .prompt { color: #00CEC9; }
.terminal-body .output { color: #DFE6E9; }
.terminal-body .error { color: #E17055; }
.terminal-body .comment { color: #636E72; font-style: italic; }
.terminal-input-line {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-top: var(--sp-sm);
}
.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #00FF41;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  outline: none;
  caret-color: #00FF41;
}

/* --- Quiz --- */
.quiz-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: var(--sp-xl);
  box-shadow: var(--shadow);
  border: 2px solid var(--accent);
  margin: var(--sp-lg) 0;
}
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-lg);
}
.quiz-header h3 {
  font-size: var(--fs-lg);
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.quiz-progress {
  font-size: var(--fs-sm);
  color: var(--text-light);
  font-weight: 600;
}
.quiz-question {
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: var(--sp-lg);
  line-height: 1.5;
}
.quiz-options { list-style: none; padding: 0; }
.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--sp-md) var(--sp-lg);
  margin-bottom: var(--sp-sm);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  color: var(--text);
}
.quiz-option:hover {
  border-color: var(--primary-light);
  background: #F0EEFF;
  transform: translateX(4px);
}
.quiz-option.selected {
  border-color: var(--primary);
  background: #F0EEFF;
}
.quiz-option.correct {
  border-color: var(--success);
  background: #E8F5E9;
  color: #2E7D32;
}
.quiz-option.incorrect {
  border-color: var(--danger);
  background: #FFEBEE;
  color: #C62828;
}
.quiz-option.correct::after { content: " ✓"; font-weight: 700; }
.quiz-option.incorrect::after { content: " ✗"; font-weight: 700; }
.quiz-feedback {
  padding: var(--sp-md) var(--sp-lg);
  border-radius: var(--radius-sm);
  margin-top: var(--sp-md);
  font-size: var(--fs-sm);
  display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.correct {
  background: #E8F5E9;
  border: 1px solid var(--success);
  color: #2E7D32;
}
.quiz-feedback.incorrect {
  background: #FFEBEE;
  border: 1px solid var(--danger);
  color: #C62828;
}
.quiz-actions {
  display: flex;
  gap: var(--sp-md);
  margin-top: var(--sp-lg);
  justify-content: flex-end;
}
.quiz-score {
  text-align: center;
  padding: var(--sp-xl);
}
.quiz-score .score-number {
  font-size: var(--fs-3xl);
  font-weight: 800;
  color: var(--primary);
}
.quiz-score .score-label {
  color: var(--text-light);
  font-size: var(--fs-lg);
}

/* --- Boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-lg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--fs-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.btn--primary {
  background: var(--primary);
  color: white;
}
.btn--primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn--secondary {
  background: var(--bg);
  color: var(--primary);
  border: 2px solid var(--primary-light);
}
.btn--secondary:hover { background: #F0EEFF; }
.btn--success {
  background: var(--success);
  color: white;
}
.btn--success:hover { background: #00A884; }
.btn--large {
  padding: var(--sp-md) var(--sp-xl);
  font-size: var(--fs-base);
  border-radius: var(--radius);
}

/* --- Tableaux --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-lg) 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
thead { background: var(--primary); color: white; }
th {
  padding: var(--sp-md) var(--sp-lg);
  text-align: left;
  font-weight: 600;
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
td {
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}
tr:hover td { background: #F8F9FE; }

/* --- Tabs --- */
.tabs {
  margin: var(--sp-lg) 0;
}
.tab-buttons {
  display: flex;
  gap: 2px;
  background: var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.tab-btn {
  flex: 1;
  padding: var(--sp-md);
  background: var(--bg);
  border: none;
  font-family: var(--font);
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-light);
}
.tab-btn:hover { background: #F0EEFF; color: var(--primary); }
.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 -2px 0 var(--primary) inset;
}
.tab-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: var(--sp-lg);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* --- Accordéon --- */
.accordion { margin: var(--sp-lg) 0; }
.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-sm);
  overflow: hidden;
}
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--sp-md) var(--sp-lg);
  background: none;
  border: none;
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s;
}
.accordion-header:hover { background: #F8F9FE; }
.accordion-header::after {
  content: "▸";
  transition: transform 0.3s;
  font-size: var(--fs-lg);
  color: var(--primary);
}
.accordion-item.open .accordion-header::after { transform: rotate(90deg); }
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.accordion-body-inner {
  padding: 0 var(--sp-lg) var(--sp-lg);
  color: var(--text-light);
}

/* --- Schéma interactif (base) --- */
.diagram {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: var(--sp-xl);
  margin: var(--sp-lg) 0;
  box-shadow: var(--shadow);
  border: 2px solid var(--info);
  text-align: center;
}
.diagram-title {
  font-weight: 700;
  color: var(--info);
  margin-bottom: var(--sp-lg);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Boîtes du diagramme OSI/TCP */
.layer-stack { display: flex; flex-direction: column; gap: 4px; max-width: 500px; margin: 0 auto; }
.layer-box {
  padding: var(--sp-md) var(--sp-lg);
  border-radius: var(--radius-sm);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  position: relative;
}
.layer-box:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.layer-box .layer-detail {
  display: none;
  font-weight: 400;
  font-size: var(--fs-sm);
  margin-top: var(--sp-sm);
  opacity: 0.9;
}
.layer-box.expanded .layer-detail { display: block; }

/* --- Drag & Drop --- */
.drag-zone {
  min-height: 60px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin: var(--sp-sm) 0;
}
.drag-zone.over {
  border-color: var(--primary);
  background: #F0EEFF;
}
.drag-item {
  padding: var(--sp-sm) var(--sp-md);
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  cursor: grab;
  font-size: var(--fs-sm);
  font-weight: 600;
  user-select: none;
  transition: all 0.2s;
}
.drag-item:active { cursor: grabbing; opacity: 0.7; }
.drag-item.placed {
  background: var(--success);
}
.drag-zone-label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 600;
}

/* --- Points clés --- */
.key-points {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  border-radius: var(--radius);
  padding: var(--sp-xl);
  margin: var(--sp-2xl) 0;
  border-left: 4px solid var(--success);
}
.key-points h3 {
  color: #2E7D32;
  margin-bottom: var(--sp-md);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.key-points ul {
  list-style: none;
  padding: 0;
}
.key-points li {
  padding: var(--sp-sm) 0;
  padding-left: var(--sp-lg);
  position: relative;
  color: #1B5E20;
}
.key-points li::before {
  content: "★";
  position: absolute;
  left: 0;
  color: var(--success);
}

/* --- Navigation module (prev/next) --- */
.module-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-lg);
  margin-top: var(--sp-2xl);
  padding-top: var(--sp-xl);
  border-top: 2px solid var(--border);
}
.module-nav a {
  display: flex;
  flex-direction: column;
  padding: var(--sp-md) var(--sp-lg);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  transition: all 0.2s;
  min-width: 200px;
}
.module-nav a:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.module-nav .nav-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.module-nav .nav-title {
  font-weight: 700;
  color: var(--text);
}
.module-nav .next { text-align: right; margin-left: auto; }

/* --- Page d'accueil --- */
.home-hero {
  text-align: center;
  padding: var(--sp-2xl) var(--sp-xl);
  background: linear-gradient(135deg, var(--primary) 0%, #A29BFE 50%, var(--secondary) 100%);
  color: white;
}
.home-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: var(--sp-md);
}
.home-hero p {
  font-size: var(--fs-lg);
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-lg);
  padding: var(--sp-xl);
  max-width: 1200px;
  margin: 0 auto;
}
.module-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: var(--sp-lg);
  box-shadow: var(--shadow);
  transition: all 0.3s;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.module-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}
.module-card .module-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: var(--fs-lg);
  color: white;
  margin-bottom: var(--sp-md);
}
.module-card h3 {
  font-size: var(--fs-base);
  font-weight: 700;
  margin-bottom: var(--sp-sm);
}
.module-card p {
  font-size: var(--fs-sm);
  color: var(--text-light);
  line-height: 1.5;
}

/* Groupe de sections sur la home */
.section-group {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-xl) var(--sp-xl) 0;
}
.section-group h2 {
  font-size: var(--fs-xl);
  color: var(--text);
  margin-bottom: var(--sp-sm);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.section-group .group-desc {
  color: var(--text-light);
  margin-bottom: var(--sp-lg);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .main-content { margin-left: 0; }
  .module-hero { padding: var(--sp-xl) var(--sp-lg) var(--sp-lg); padding-top: 70px; }
  .content-area { padding: var(--sp-lg); }
}
@media (max-width: 640px) {
  .module-hero h1 { font-size: var(--fs-2xl); }
  .modules-grid { grid-template-columns: 1fr; padding: var(--sp-md); }
  .module-nav { flex-direction: column; }
  .module-nav a { min-width: auto; }
  .tab-buttons { flex-direction: column; }
  .quiz-header { flex-direction: column; align-items: flex-start; gap: var(--sp-sm); }
}

/* --- Overlay sidebar mobile --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
.animate-in {
  animation: fadeIn 0.4s ease forwards;
}

/* --- Dashboard de progression --- */
.progress-dashboard {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-lg);
  margin-top: var(--sp-xl);
  padding: var(--sp-lg) var(--sp-xl);
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}
.progress-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
}
.progress-stat-value {
  font-size: var(--fs-2xl);
  font-weight: 800;
}
.progress-stat-label {
  font-size: var(--fs-xs);
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.progress-bar-global {
  width: 100%;
  max-width: 400px;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent-alt);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* --- Barre de recherche --- */
.search-bar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-lg) var(--sp-xl) 0;
}
.search-input {
  width: 100%;
  padding: var(--sp-md) var(--sp-lg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: var(--fs-base);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.search-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}
.search-input::placeholder {
  color: var(--text-muted);
}

/* --- Badges de progression sur les cartes --- */
.module-card {
  position: relative;
}
.card-badge {
  display: inline-block;
  padding: 2px var(--sp-sm);
  border-radius: 12px;
  font-size: var(--fs-xs);
  font-weight: 700;
  margin-top: var(--sp-sm);
}
.card-badge--passed {
  background: #E8F5E9;
  color: #2E7D32;
}
.card-badge--attempted {
  background: #FFF3E0;
  color: #E65100;
}
.card-badge--visited {
  background: #E3F2FD;
  color: #1565C0;
}

/* --- Print --- */
@media print {
  .sidebar, .menu-toggle, .module-nav { display: none; }
  .main-content { margin-left: 0; }
  .module-hero { background: none; color: var(--text); }
  .quiz-option { border: 1px solid #ccc; }
}
