/* ============================================================
   ESPACE PROPULSER - Synoptia
   Complete standalone CSS - Glass morphism dark theme
   ============================================================ */

/* ----- @font-face ----- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-wghtOnly-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/fonts/plusjakartasans-latin-wghtOnly-normal.woff2') format('woff2');
}

/* ----- CSS Variables ----- */
:root {
  /* Colors */
  --bg: #0B1226;
  --bg-lighter: #111B33;
  --bg-card: #131D35;
  --text: #E6EDF7;
  --muted: #B6C7DA;
  --muted-dim: #7B8DA6;
  --primary: #2451FF;
  --primary-hover: #3A66FF;
  --accent: #22D3EE;
  --accent-dim: rgba(34, 211, 238, .15);
  --magenta: #E11D8D;
  --magenta-dim: rgba(225, 29, 141, .15);
  --green: #10B981;
  --green-dim: rgba(16, 185, 129, .15);
  --red: #EF4444;
  --red-dim: rgba(239, 68, 68, .12);
  --yellow: #FBBF24;

  /* Rainbow gradient (PROPULSER branding) - identique au site */
  --rainbow: linear-gradient(135deg, #FF6B6B, #FFA94D, #FFE066, #69DB7C, #22D3EE, #748FFC, #B197FC, #F06595);
  --rainbow-soft: linear-gradient(135deg, rgba(255,107,107,.6), rgba(255,169,77,.6), rgba(255,224,102,.6), rgba(105,219,124,.6), rgba(34,211,238,.6), rgba(116,143,252,.6), rgba(177,151,252,.6), rgba(240,101,149,.6));

  /* Glass tokens */
  --glass-bg: rgba(255, 255, 255, .04);
  --glass-bg-hover: rgba(255, 255, 255, .08);
  --glass-bg-strong: rgba(255, 255, 255, .06);
  --glass-border: rgba(255, 255, 255, .12);
  --glass-border-hover: rgba(255, 255, 255, .18);
  --glass-blur: blur(10px) saturate(150%);

  /* Spacing */
  --space-xs: .375rem;
  --space-sm: .625rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .45);
  --shadow-glow-cyan: 0 0 20px rgba(34, 211, 238, .25);
  --shadow-glow-primary: 0 0 20px rgba(36, 81, 255, .25);
  --shadow-glow-magenta: 0 0 20px rgba(225, 29, 141, .25);

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

  /* Transitions */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);
}

/* ----- Light theme (défaut) ----- */
:root,
[data-theme="light"] {
  --bg: #F5F7FA;
  --bg-lighter: #FFFFFF;
  --bg-card: #FFFFFF;
  --text: #1A1A2E;
  --muted: #5A6578;
  --muted-dim: #8896A8;
  --glass-bg: rgba(0, 0, 0, .03);
  --glass-bg-hover: rgba(0, 0, 0, .06);
  --glass-bg-strong: rgba(0, 0, 0, .04);
  --glass-border: rgba(0, 0, 0, .1);
  --glass-border-hover: rgba(0, 0, 0, .16);
  --glass-blur: blur(10px) saturate(120%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .1);
  --shadow-glow-cyan: 0 0 20px rgba(34, 211, 238, .12);
  --shadow-glow-primary: 0 0 20px rgba(36, 81, 255, .12);
  --shadow-glow-magenta: 0 0 20px rgba(225, 29, 141, .12);
  --accent-dim: rgba(34, 211, 238, .1);
  --magenta-dim: rgba(225, 29, 141, .08);
  --green-dim: rgba(16, 185, 129, .08);
  --red-dim: rgba(239, 68, 68, .06);
}

/* ----- Dark theme ----- */
[data-theme="dark"] {
  --bg: #0B1226;
  --bg-lighter: #111B33;
  --bg-card: #131D35;
  --text: #E6EDF7;
  --muted: #B6C7DA;
  --muted-dim: #7B8DA6;
  --glass-bg: rgba(255, 255, 255, .04);
  --glass-bg-hover: rgba(255, 255, 255, .08);
  --glass-bg-strong: rgba(255, 255, 255, .06);
  --glass-border: rgba(255, 255, 255, .12);
  --glass-border-hover: rgba(255, 255, 255, .18);
  --glass-blur: blur(10px) saturate(150%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .45);
  --shadow-glow-cyan: 0 0 20px rgba(34, 211, 238, .25);
  --shadow-glow-primary: 0 0 20px rgba(36, 81, 255, .25);
  --shadow-glow-magenta: 0 0 20px rgba(225, 29, 141, .25);
  --accent-dim: rgba(34, 211, 238, .15);
  --magenta-dim: rgba(225, 29, 141, .15);
  --green-dim: rgba(16, 185, 129, .15);
  --red-dim: rgba(239, 68, 68, .12);
}

/* ----- Theme-specific overrides ----- */
[data-theme="light"] .card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] .card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--glass-border-hover);
  background: var(--bg-card);
}
[data-theme="light"] .espace-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--glass-border);
}
[data-theme="light"] .espace-topbar {
  background: rgba(255, 255, 255, .85);
  border-bottom: 1px solid var(--glass-border);
}
[data-theme="light"] .input {
  background: var(--bg);
  border: 2px solid var(--glass-border);
}
[data-theme="light"] .input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 81, 255, .12);
}
[data-theme="light"] .btn {
  box-shadow: 0 4px 12px rgba(36, 81, 255, .2), inset 0 1px 0 rgba(255,255,255,.3);
  filter: none;
}
[data-theme="light"] .btn:hover {
  box-shadow: 0 6px 20px rgba(34, 211, 238, .25);
  filter: none;
}
[data-theme="light"] .btn-outline {
  color: var(--text);
  border-color: var(--glass-border);
  box-shadow: none;
}
[data-theme="light"] .btn-outline:hover {
  background: rgba(0, 0, 0, .04);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: none;
}
[data-theme="light"] .module-item.locked {
  opacity: .5;
}
[data-theme="light"] .sidebar-progress-bar {
  background: rgba(0, 0, 0, .08);
}
[data-theme="light"] .stat-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
}
[data-theme="light"] .toast {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text);
  box-shadow: var(--shadow-md);
}
[data-theme="light"] .login-page {
  background: linear-gradient(135deg, #EEF2FF 0%, #F5F7FA 50%, #FDF2F8 100%);
}
[data-theme="light"] .login-card {
  background: #fff;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}
[data-theme="light"] .halo { opacity: .15; }
[data-theme="light"] .avatar {
  border-color: var(--glass-border);
}
[data-theme="light"] .resource-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
}
[data-theme="light"] .filter-btn {
  color: var(--muted);
  border-color: var(--glass-border);
}
[data-theme="light"] .filter-btn.active {
  background: var(--primary);
  color: #fff;
}
[data-theme="light"] .module-gate:not(.validated) {
  border-color: #B45309;
}
[data-theme="light"] .module-gate-icon {
  background: rgba(180, 83, 9, .1);
  color: #B45309;
}
[data-theme="light"] .badge-pending {
  background: rgba(180, 83, 9, .1);
  color: #B45309;
}
[data-theme="light"] .module-gate-badge {
  color: #B45309;
}
[data-theme="light"] .admin-module-card.is-gate:not(.validated) {
  border-color: #B45309;
}

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}
.theme-toggle:hover {
  background: var(--glass-bg-hover);
  color: var(--text);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
/* Default (light) */
:root:not([data-theme]) .theme-toggle .icon-moon { display: block; }

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text);
}

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

::selection {
  background: rgba(36, 81, 255, .4);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .2);
}


/* ============================================================
   LAYOUT - Sidebar + Main
   ============================================================ */

.espace-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

/* ----- Sidebar ----- */
.espace-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: var(--text);
}

.logo-text-sm {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.logo-propulser {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .04em;
  background: var(--rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sidebar progress */
.sidebar-progress {
  padding: var(--space-md) var(--space-lg);
  flex-shrink: 0;
}

.sidebar-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.sidebar-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, .08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.sidebar-progress-fill {
  height: 100%;
  background: var(--rainbow);
  border-radius: var(--radius-full);
  transition: width 1s var(--ease-out);
  min-width: 0;
}

/* Module list */
.module-list {
  flex: 1;
  padding: var(--space-sm) var(--space-sm);
  overflow-y: auto;
}

.module-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--transition-normal);
  text-decoration: none;
  color: var(--text);
  position: relative;
}

.module-item:hover:not(.locked) {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border);
}

.module-item.current {
  background: rgba(34, 211, 238, .08);
  border-color: rgba(34, 211, 238, .3);
  box-shadow: inset 0 0 20px rgba(34, 211, 238, .06), 0 0 12px rgba(34, 211, 238, .1);
}

.module-item.completed {
  opacity: .85;
}

.module-item.completed:hover {
  opacity: 1;
}

.module-item.locked {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

.module-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--glass-border);
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition-normal);
}

.module-item.current .module-number {
  background: rgba(34, 211, 238, .15);
  border-color: var(--accent);
  color: var(--accent);
}

.module-item.completed .module-number {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
  font-size: .85rem;
}

.module-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.module-title {
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-duration {
  font-size: .65rem;
  color: var(--muted-dim);
}

.module-lock {
  font-size: .75rem;
  flex-shrink: 0;
}

/* Sidebar footer */
.sidebar-footer {
  padding: var(--space-sm) var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.sidebar-link:hover {
  background: var(--glass-bg-hover);
  color: var(--text);
}

.sidebar-link.active {
  background: rgba(36, 81, 255, .1);
  color: var(--accent);
}


/* ----- Topbar ----- */
.espace-topbar {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xl);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 56px;
}

.topbar-spacer {
  flex: 1;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.topbar-name {
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
}

/* ----- Main Content ----- */
.espace-main {
  grid-column: 2;
  grid-row: 2;
  padding: var(--space-xl);
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}


/* ============================================================
   COMPONENTS
   ============================================================ */

/* ----- Card ----- */
.card {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

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

.card-highlight {
  position: relative;
  border: none;
  background: var(--glass-bg-strong);
}

.card-highlight::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: var(--rainbow);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card-highlight:hover {
  box-shadow: var(--shadow-md), 0 0 30px rgba(36, 81, 255, .12);
}

.card-sm {
  padding: var(--space-lg);
}


/* ----- Inputs ----- */
.input {
  width: 100%;
  padding: .75rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: .9375rem;
  outline: none;
  transition: all var(--transition-fast);
}

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

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .15), var(--shadow-glow-cyan);
  background: var(--glass-bg-hover);
}

textarea.input {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}


/* ----- Buttons (identiques au site - pill, pas de dégradé) ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: .9rem 1.1rem;
  min-height: 44px;
  min-width: 44px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: inherit;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.3);
  cursor: pointer;
  line-height: 1;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(23,51,166,.5), 0 0 30px rgba(36,81,255,.4), 0 4px 12px rgba(34,211,238,.2), inset 0 2px 0 rgba(255,255,255,.3), inset 0 -2px 4px rgba(0,0,0,.3);
  filter: drop-shadow(0 4px 16px rgba(36,81,255,.4));
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,.5) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.08);
  opacity: 0.3;
  border-radius: 999px;
}

.btn:hover {
  transform: translateY(-3px) scale(1.04);
  background: var(--accent);
  box-shadow: 0 12px 35px rgba(36,81,255,.45), 0 0 35px rgba(34,211,238,.3), 0 6px 20px rgba(34,211,238,.2), inset 0 3px 0 rgba(255,255,255,.5), inset 0 -3px 6px rgba(0,0,0,.2);
  border-color: rgba(34,211,238,.7);
  filter: drop-shadow(0 6px 18px rgba(34,211,238,.4));
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:active {
  transform: translateY(-2px) scale(1.03);
  background: var(--primary-900);
  transition: transform 0.08s ease;
  filter: brightness(1.1) drop-shadow(0 2px 8px rgba(34,211,238,.6));
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.btn-outline {
  background: transparent;
  backdrop-filter: blur(6px);
  color: var(--muted);
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: none;
  font-size: 0.9em;
  font-weight: 600;
  filter: none;
}

.btn-outline::before, .btn-outline::after {
  display: none;
}

.btn-outline:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.25);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-1px);
  filter: none;
}

.btn-sm {
  padding: .5rem 1rem;
  font-size: .8125rem;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  min-width: 36px;
  min-height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  border: none;
  box-shadow: none;
  filter: none;
  transition: all var(--transition-fast);
}

.btn-icon::before, .btn-icon::after {
  display: none;
}

.btn-icon:hover {
  background: var(--glass-bg-hover);
  color: var(--text);
  transform: none;
  box-shadow: none;
  filter: none;
}

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

.btn-success:hover {
  background: #059669;
  box-shadow: 0 12px 35px rgba(16,185,129,.35), 0 0 20px rgba(16,185,129,.3);
}

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

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


/* ----- Avatar ----- */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass-bg-strong);
  border: 2px solid transparent;
  background-image: linear-gradient(var(--bg-card), var(--bg-card)), var(--rainbow);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 1rem;
}


/* ----- Badge ----- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge-locked {
  background: rgba(255, 255, 255, .06);
  color: var(--muted-dim);
}

.badge-new {
  background: var(--accent-dim);
  color: var(--accent);
}

.badge-completed {
  background: var(--green-dim);
  color: var(--green);
}

.badge-skill {
  background: var(--accent-dim);
  color: var(--accent);
}

.badge-commande {
  background: rgba(36, 81, 255, .15);
  color: var(--primary-hover);
}

.badge-template {
  background: var(--magenta-dim);
  color: var(--magenta);
}

.badge-guide {
  background: var(--green-dim);
  color: var(--green);
}


/* ----- Video Container ----- */
.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Video loading state */
.video-container.video-loading {
  background: linear-gradient(135deg, rgba(34, 211, 238, .04), rgba(36, 81, 255, .06), rgba(225, 29, 141, .04));
}

.video-container.video-loading video,
.video-container.video-loading .plyr {
  opacity: 0;
}

.video-container:not(.video-loading) video,
.video-container:not(.video-loading) .plyr {
  opacity: 1;
  transition: opacity .4s ease;
}

.video-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  z-index: 2;
}

.video-loader p {
  font-size: .875rem;
  color: var(--muted);
}

.video-loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.placeholder-video {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(34, 211, 238, .04), rgba(36, 81, 255, .06), rgba(225, 29, 141, .04));
  border: 1px dashed rgba(255, 255, 255, .15);
  border-radius: var(--radius-lg);
  text-align: center;
  padding: var(--space-xl);
}

.placeholder-icon {
  font-size: 3rem;
  opacity: .6;
  animation: pulse 3s ease-in-out infinite;
}

.placeholder-video h3 {
  font-size: 1.125rem;
  color: var(--muted);
}

.placeholder-video p {
  font-size: .875rem;
  color: var(--muted-dim);
}


/* ----- Tab System ----- */
.tab-system {
  margin-top: var(--space-xl);
}

.tab-header {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
}

.tab-btn {
  padding: var(--space-md) var(--space-lg);
  font-size: .875rem;
  font-weight: 600;
  color: var(--muted-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
  animation: fadeIn .35s var(--ease-out);
}

.tab-content.active {
  display: block;
}


/* ----- Progress Ring ----- */
.progress-ring-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.progress-ring {
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, .2));
}

.progress-ring-bg {
  stroke: rgba(255, 255, 255, .08);
  opacity: .6;
}

.progress-ring-text {
  fill: var(--text);
}

[data-theme="light"] .progress-ring-bg {
  stroke: rgba(0, 0, 0, .1);
  opacity: 1;
}


/* ----- Stats Grid ----- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-lg);
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--transition-normal);
}

.stat-card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.stat-number {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  background: var(--rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-label {
  font-size: .8125rem;
  color: var(--muted);
  margin-top: var(--space-xs);
}


/* ----- Resource Cards ----- */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.resource-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: all var(--transition-normal);
}

.resource-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.resource-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.resource-title {
  font-size: 1rem;
  font-weight: 700;
}

.resource-desc {
  font-size: .8125rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-card {
  width: 90%;
  max-width: 400px;
  padding: 2rem;
}

.resource-module {
  font-size: .75rem;
  color: var(--cyan);
  font-weight: 600;
  margin-top: .25rem;
}

.resource-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: auto;
}


/* ----- Filter Bar ----- */
.filter-bar {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

.filter-btn {
  padding: .5rem 1.125rem;
  border-radius: var(--radius-full);
  font-size: .8125rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  background: var(--glass-bg-hover);
  color: var(--text);
  border-color: var(--glass-border-hover);
}

.filter-btn.active {
  background: rgba(34, 211, 238, .1);
  border-color: var(--accent);
  color: var(--accent);
}


/* ----- Checklist ----- */
.checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.checklist-item:hover {
  background: var(--glass-bg-hover);
}

.checklist-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--glass-border-hover);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  position: relative;
}

.checklist-item input[type="checkbox"]:checked {
  background: var(--green);
  border-color: var(--green);
}

.checklist-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checklist-item.completed .checklist-label {
  text-decoration: line-through;
  color: var(--muted-dim);
}

.checklist-label {
  font-size: .875rem;
  flex: 1;
  transition: all var(--transition-fast);
}


/* ----- Toast Notifications ----- */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: .875rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  z-index: 10000;
  transform: translateX(120%);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-lg);
  max-width: 380px;
}

.toast.show {
  transform: translateX(0);
}

.toast-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, .92), rgba(5, 150, 105, .92));
  color: #fff;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.toast-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, .92), rgba(220, 38, 38, .92));
  color: #fff;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.toast-info {
  background: linear-gradient(135deg, rgba(36, 81, 255, .92), rgba(34, 211, 238, .72));
  color: #fff;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}


/* ----- Hamburger ----- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.hamburger:hover {
  background: var(--glass-bg-hover);
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all var(--transition-normal);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
  opacity: 1;
}


/* ============================================================
   ANIMATIONS
   ============================================================ */

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

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

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

@keyframes pulse {
  0%, 100% { opacity: .6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(15px, -20px) scale(1.05); }
  66% { transform: translate(-10px, 10px) scale(.97); }
}

@keyframes floatSlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, -15px) scale(1.04); }
}

@keyframes floatReverse {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-15px, 15px) scale(1.03); }
  66% { transform: translate(20px, -10px) scale(.98); }
}

.fade-in {
  animation: fadeIn .5s var(--ease-out);
}

.slide-up {
  animation: slideUp .6s var(--ease-out);
}

.stagger-1 { animation-delay: .05s; }
.stagger-2 { animation-delay: .1s; }
.stagger-3 { animation-delay: .15s; }
.stagger-4 { animation-delay: .2s; }
.stagger-5 { animation-delay: .25s; }


/* ============================================================
   PAGE SPECIFIC - LOGIN
   ============================================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}

.login-halos {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.halo {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .35;
}

.halo-cyan {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  top: -15%;
  right: -5%;
  animation: float 12s ease-in-out infinite;
}

.halo-blue {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary), transparent 70%);
  bottom: -20%;
  left: -10%;
  animation: floatSlow 16s ease-in-out infinite;
  animation-delay: -4s;
}

.halo-magenta {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--magenta), transparent 70%);
  top: 40%;
  left: 50%;
  animation: floatReverse 14s ease-in-out infinite;
  animation-delay: -8s;
}

.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: var(--space-xl);
}

.login-card {
  max-width: 420px;
  width: 100%;
  padding: var(--space-2xl);
  text-align: center;
  animation: slideUp .7s var(--ease-out);
}

.login-logo {
  margin-bottom: var(--space-md);
}

.login-logo .logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--muted);
}

.login-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-xs);
  letter-spacing: .02em;
}

.login-subtitle {
  color: var(--muted);
  font-size: .9375rem;
  margin-bottom: var(--space-xl);
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: var(--space-xs);
}

.error-message {
  color: var(--red);
  font-size: .8125rem;
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--red-dim);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, .2);
}

.login-card .btn-full {
  margin-top: var(--space-lg);
  padding: .875rem;
  font-size: 1rem;
}


/* ============================================================
   PAGE SPECIFIC - DASHBOARD
   ============================================================ */

.dashboard-hero {
  margin-bottom: var(--space-xl);
  animation: fadeIn .5s var(--ease-out);
}

.dashboard-greeting {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: var(--space-xs);
}

.dashboard-date {
  color: var(--muted);
  font-size: .9375rem;
}

.dashboard-progress-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
  animation: slideUp .6s var(--ease-out);
}

.dashboard-progress-label {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
}

.next-module-card {
  margin-bottom: var(--space-2xl);
  animation: slideUp .7s var(--ease-out);
}

.next-module-card .card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  cursor: pointer;
}

.next-module-card .card:hover {
  transform: translateY(-2px);
}

.next-module-info {
  flex: 1;
}

.next-module-badge {
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.next-module-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.next-module-duration {
  font-size: .8125rem;
  color: var(--muted-dim);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.quick-access {
  margin-top: var(--space-xl);
  animation: slideUp .8s var(--ease-out);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.quick-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.quick-card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.quick-card-icon {
  font-size: 1.75rem;
  margin-bottom: var(--space-xs);
}

.quick-card-label {
  font-size: .875rem;
  font-weight: 600;
}

.quick-card-desc {
  font-size: .75rem;
  color: var(--muted-dim);
}


/* ============================================================
   PAGE SPECIFIC - MODULE
   ============================================================ */

.module-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  animation: fadeIn .5s var(--ease-out);
}

.module-header-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--glass-bg-hover);
  border: 2px solid var(--accent);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  box-shadow: var(--shadow-glow-cyan);
}

.module-header-info h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.module-header-subtitle {
  font-size: .875rem;
  color: var(--muted);
}

.module-video-section {
  margin-bottom: var(--space-xl);
  animation: slideUp .6s var(--ease-out);
}

/* -- Module Description: Premium glass morphism rich content -- */
.module-description {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.8;
  max-width: 720px;
}

/* --- Paragraphs --- */
.module-description p {
  margin-bottom: var(--space-lg);
  color: var(--muted);
  max-width: 65ch;
}

.module-description p:last-child {
  margin-bottom: 0;
}

.module-description strong {
  color: var(--text);
  font-weight: 650;
}

/* --- Section cards (heading + body grouped) --- */
.module-description .md-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-xl) 0;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.module-description .md-section:first-child {
  margin-top: var(--space-md);
}

.module-description .md-section:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-sm);
}

/* --- Section headings --- */
.module-description .md-heading {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--space-md) 0;
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--accent-dim);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.module-description .md-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.125em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Standalone headings (not inside a card) */
.module-description > .md-heading {
  font-size: 1.25rem;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  border-bottom: none;
  padding-bottom: 0;
}

.module-description > .md-heading:first-child {
  margin-top: var(--space-md);
}

/* --- Lists (custom bullets) --- */
.module-description .md-list {
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0 var(--space-lg) 0;
}

.module-description .md-list li {
  position: relative;
  padding-left: 1.75em;
  margin-bottom: .625rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 62ch;
}

.module-description .md-list li::before {
  content: '';
  position: absolute;
  left: .25em;
  top: .6em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  opacity: .8;
  transform: rotate(45deg);
}

.module-description .md-list li strong {
  color: var(--text);
}

/* Ordered list variant */
.module-description .md-list-ordered {
  counter-reset: md-ol;
}

.module-description .md-list-ordered li {
  counter-increment: md-ol;
  padding-left: 2.25em;
}

.module-description .md-list-ordered li::before {
  content: counter(md-ol);
  width: 1.5em;
  height: 1.5em;
  background: var(--accent-dim);
  border-radius: 50%;
  transform: none;
  opacity: 1;
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent);
  top: .2em;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Acte / Phase cards --- */
.module-description .md-acte-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

.module-description .md-acte-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: border-color var(--transition-normal), transform var(--transition-normal), box-shadow var(--transition-normal);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: relative;
  overflow: hidden;
}

.module-description .md-acte-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--rainbow);
  opacity: .6;
  transition: opacity var(--transition-normal);
}

.module-description .md-acte-card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.module-description .md-acte-card:hover::before {
  opacity: 1;
}

.module-description .md-acte-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--glass-border);
}

.module-description .md-acte-label {
  display: inline-block;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: .2em .6em;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-xs);
}

.module-description .md-acte-title {
  display: block;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-top: var(--space-xs);
}

.module-description .md-acte-body {
  font-size: .9375rem;
  color: var(--muted);
  line-height: 1.7;
}

.module-description .md-acte-body p {
  margin-bottom: var(--space-sm);
}

.module-description .md-acte-body .md-list {
  margin: var(--space-xs) 0 var(--space-sm) 0;
}

.module-description .md-acte-body .md-list li {
  font-size: .875rem;
  margin-bottom: var(--space-xs);
}

/* --- Bloc headings (sub-sections with duration) --- */
.module-description .md-bloc {
  margin: var(--space-lg) 0;
  padding-left: var(--space-md);
  border-left: 2px solid rgba(34, 211, 238, .25);
}

.module-description .md-bloc-heading {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.module-description .md-bloc-name {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text);
}

.module-description .md-bloc-duration {
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: .15em .5em;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* --- Highlight quotes --- */
.module-description .md-highlight {
  position: relative;
  margin: var(--space-xl) 0;
  padding: var(--space-lg) var(--space-xl);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--magenta);
  border-radius: var(--radius-sm);
  font-size: 1.0625rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.7;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.module-description .md-highlight::before {
  content: '\201C';
  position: absolute;
  top: -.15em;
  left: .3em;
  font-size: 2.5rem;
  color: var(--magenta);
  opacity: .35;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1;
}

/* --- Code blocks (terminal commands) --- */
.module-description .md-code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: .8125rem;
  line-height: 1.6;
  background: var(--bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-sm) 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--accent);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* --- Inline code --- */
.module-description .md-inline-code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: .85em;
  background: var(--accent-dim);
  color: var(--accent);
  padding: .15em .4em;
  border-radius: 4px;
  border: 1px solid rgba(34, 211, 238, .12);
}

/* ========== Light theme overrides for module description ========== */
[data-theme="light"] .module-description .md-section {
  background: rgba(0, 0, 0, .02);
  border-color: var(--glass-border);
}

[data-theme="light"] .module-description .md-section:hover {
  background: rgba(0, 0, 0, .03);
}

.md-code-text { flex: 1; user-select: all; }

.md-code-copy {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all .2s;
  opacity: .5;
}

.md-code:hover .md-code-copy { opacity: 1; }
.md-code-copy:hover { background: rgba(255,255,255,.1); color: var(--cyan); }
.md-code-copy.copied { color: var(--green); opacity: 1; }

.md-inline-code { cursor: pointer; user-select: all; transition: background .2s; }
.md-inline-code:hover { background: rgba(34, 211, 238, .15); }
.md-inline-code.copied { background: rgba(39, 174, 96, .2); }

[data-theme="light"] .module-description .md-code {
  background: #F0F3F7;
  border-color: rgba(0, 0, 0, .08);
  color: var(--primary);
}

[data-theme="light"] .module-description .md-inline-code {
  background: rgba(36, 81, 255, .08);
  color: var(--primary);
  border-color: rgba(36, 81, 255, .1);
}

[data-theme="light"] .module-description .md-heading::before {
  background: var(--primary);
}

[data-theme="light"] .module-description .md-list li::before {
  background: var(--primary);
}

[data-theme="light"] .module-description .md-list-ordered li::before {
  color: var(--primary);
  background: rgba(36, 81, 255, .08);
}

[data-theme="light"] .module-description .md-heading {
  border-bottom-color: rgba(36, 81, 255, .15);
}

[data-theme="light"] .module-description .md-acte-card {
  background: rgba(0, 0, 0, .02);
  border-color: var(--glass-border);
}

[data-theme="light"] .module-description .md-acte-card:hover {
  background: rgba(0, 0, 0, .03);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
}

[data-theme="light"] .module-description .md-acte-label {
  color: var(--primary);
  background: rgba(36, 81, 255, .08);
}

[data-theme="light"] .module-description .md-bloc {
  border-left-color: rgba(36, 81, 255, .25);
}

[data-theme="light"] .module-description .md-bloc-duration {
  color: var(--primary);
  background: rgba(36, 81, 255, .08);
}

[data-theme="light"] .module-description .md-highlight {
  background: rgba(225, 29, 141, .03);
  border-color: var(--glass-border);
  border-left-color: var(--magenta);
}

[data-theme="light"] .module-description .md-highlight::before {
  color: var(--magenta);
}

/* --- Responsive: stack acte cards on small screens --- */
@media (max-width: 600px) {
  .module-description .md-acte-group {
    grid-template-columns: 1fr;
  }

  .module-description .md-acte-card {
    padding: var(--space-md);
  }

  .module-description .md-highlight {
    padding: var(--space-md);
    font-size: 1rem;
  }
}

.module-notes {
  padding: var(--space-md) 0;
}

.module-notes textarea {
  width: 100%;
}

.module-notes-hint {
  font-size: .75rem;
  color: var(--muted-dim);
  margin-top: var(--space-xs);
}

.module-actions {
  margin-top: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  animation: slideUp .8s var(--ease-out);
}

.module-complete-section {
  text-align: center;
  padding: var(--space-xl);
}

.module-complete-section.completed {
  opacity: .7;
}

.module-complete-section .badge {
  font-size: .875rem;
  padding: .5rem 1rem;
}

.module-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--glass-border);
}

.module-nav .btn {
  min-width: 140px;
}

.module-checklist {
  margin-top: var(--space-xl);
}

.module-checklist h3 {
  font-size: 1.125rem;
  margin-bottom: var(--space-md);
}


/* ============================================================
   PAGE SPECIFIC - RESOURCES
   ============================================================ */

.resources-header {
  margin-bottom: var(--space-xl);
  animation: fadeIn .5s var(--ease-out);
}

.resources-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: var(--space-xs);
}

.resources-header p {
  color: var(--muted);
  font-size: .9375rem;
}

.resources-count {
  font-size: .8125rem;
  color: var(--muted-dim);
  margin-bottom: var(--space-md);
}

.resource-empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--muted-dim);
}

.resource-empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  opacity: .5;
}

.resource-empty p {
  font-size: .9375rem;
}


/* ============================================================
   UTILITIES
   ============================================================ */

.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-sm { font-size: .8125rem; }
.text-xs { font-size: .6875rem; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Rainbow text utility */
.text-rainbow {
  background: var(--rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Gradient border utility */
.border-rainbow {
  position: relative;
  border: none;
}

.border-rainbow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--rainbow);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Loading shimmer */
.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, .03) 0%,
    rgba(255, 255, 255, .08) 50%,
    rgba(255, 255, 255, .03) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}


/* ============================================================
   RESPONSIVE - Mobile (max-width: 900px)
   ============================================================ */

@media (max-width: 900px) {
  .espace-layout {
    grid-template-columns: 1fr;
  }

  .espace-sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .espace-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
  }

  .espace-topbar {
    grid-column: 1;
    justify-content: space-between;
  }

  .espace-main {
    grid-column: 1;
    padding: var(--space-lg);
  }

  .hamburger {
    display: flex;
  }

  .dashboard-greeting {
    font-size: 1.375rem;
  }

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

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

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

  .module-header {
    flex-direction: column;
    text-align: center;
  }

  .module-nav {
    flex-direction: column;
  }

  .module-nav .btn {
    min-width: 0;
    width: 100%;
  }

  .login-card {
    padding: var(--space-xl);
  }

  .login-title {
    font-size: 2rem;
  }

  .halo-cyan {
    width: 300px;
    height: 300px;
  }

  .halo-blue {
    width: 350px;
    height: 350px;
  }

  .halo-magenta {
    width: 250px;
    height: 250px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-sm);
  }

  .filter-btn {
    flex-shrink: 0;
  }
}


/* ============================================================
   MODULE GATE (live session validation)
   ============================================================ */

.module-gate {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--glass-bg-strong);
  border: 2px dashed var(--yellow);
  margin-top: var(--space-xl);
  transition: all var(--transition-normal);
}

.module-gate.validated {
  border-color: var(--green);
  border-style: solid;
  background: var(--green-dim);
}

.module-gate-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, .12);
  color: var(--yellow);
}

.module-gate.validated .module-gate-icon {
  background: var(--green-dim);
  color: var(--green);
}

.module-gate-info {
  flex: 1;
}

.module-gate-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: .25rem;
}

.module-gate-desc {
  font-size: .875rem;
  color: var(--muted);
}

.module-gate-status {
  flex-shrink: 0;
}

/* Booking CTA (before live sessions) */
.module-booking {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(34, 211, 238, .08), rgba(225, 29, 141, .08));
  border: 2px solid var(--cyan);
  margin-top: var(--space-xl);
}

.module-booking-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 211, 238, .15);
  color: var(--cyan);
}

.module-booking-info {
  flex: 1;
}

.module-booking-info h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 .25rem;
}

.module-booking-info p {
  font-size: .875rem;
  color: var(--muted);
  margin: 0;
}

.module-booking.booked {
  border-color: var(--green);
  background: linear-gradient(135deg, rgba(39, 174, 96, .08), rgba(16, 185, 129, .08));
}

.module-booking.booked .module-booking-icon {
  background: rgba(39, 174, 96, .15);
  color: var(--green);
}

@media (max-width: 640px) {
  .module-booking {
    flex-direction: column;
    text-align: center;
  }
}

.badge-pending {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .375rem .75rem;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
  background: rgba(251, 191, 36, .12);
  color: var(--yellow);
  white-space: nowrap;
}

/* Sidebar gate badge */
.module-gate-badge {
  display: block;
  font-size: .625rem;
  font-weight: 600;
  color: var(--yellow);
  letter-spacing: .02em;
  margin-top: 2px;
}

/* Admin sidebar link */
.sidebar-link-admin {
  border-top: 1px solid var(--glass-border);
  padding-top: var(--space-sm);
  margin-top: var(--space-xs);
  color: var(--magenta);
}
.sidebar-link-admin:hover {
  color: var(--magenta);
  background: var(--magenta-dim);
}

/* ============================================================
   ADMIN PAGE
   ============================================================ */

.admin-header {
  margin-bottom: var(--space-xl);
}

.admin-header h1 {
  font-size: 1.75rem;
  margin-bottom: .25rem;
}

.admin-header p {
  color: var(--muted);
}

.admin-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: var(--space-sm);
}

.admin-tab {
  padding: .5rem 1rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: .875rem;
}

.admin-tab.active {
  background: var(--magenta);
  color: #fff;
}

.admin-tab:hover:not(.active) {
  background: var(--glass-bg-hover);
  color: var(--text);
}

/* User cards */
.admin-user-grid {
  display: grid;
  gap: var(--space-md);
}

.admin-user-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-user-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-md);
}

.admin-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--magenta-dim);
  color: var(--magenta);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.admin-user-info {
  flex: 1;
  min-width: 0;
}

.admin-user-name {
  font-weight: 700;
  font-size: 1rem;
}

.admin-user-email {
  font-size: .8125rem;
  color: var(--muted);
}

.admin-user-progress {
  flex-shrink: 0;
  text-align: right;
}

.admin-user-percent {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.admin-user-modules {
  font-size: .75rem;
  color: var(--muted);
}

/* User detail view */
.admin-detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.admin-back-btn {
  flex-shrink: 0;
}

.admin-detail-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.admin-detail-sub {
  font-size: .8125rem;
  color: var(--muted);
}

.admin-module-list {
  display: grid;
  gap: var(--space-md);
}

.admin-module-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-fast);
}

.admin-module-card.is-gate {
  border-color: var(--yellow);
  border-width: 2px;
}

.admin-module-card.is-gate.validated {
  border-color: var(--green);
}

.admin-module-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass-bg-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .875rem;
  flex-shrink: 0;
}

.admin-module-card.validated .admin-module-number {
  background: var(--green-dim);
  color: var(--green);
}

.admin-module-info {
  flex: 1;
  min-width: 0;
}

.admin-module-title {
  font-weight: 600;
}

.admin-module-meta {
  font-size: .75rem;
  color: var(--muted);
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: 2px;
}

.admin-module-actions {
  flex-shrink: 0;
}

.btn-validate {
  background: var(--green);
  color: #fff;
  border: none;
  padding: .5rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: .8125rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-validate:hover {
  filter: brightness(1.1);
}

.btn-invalidate {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
  padding: .5rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: .8125rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-invalidate:hover {
  background: var(--red-dim);
}

/* ============================================================
   PLYR OVERRIDES (when loaded)
   ============================================================ */

.plyr--video {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.plyr--full-ui input[type=range] {
  color: var(--accent);
}

.plyr__control--overlaid {
  background: rgba(36, 81, 255, .8);
}

.plyr__control--overlaid:hover {
  background: var(--primary);
}

.plyr__controls {
  background: linear-gradient(transparent, rgba(11, 18, 38, .85)) !important;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

/* Focus visible - all interactive elements */
.btn:focus-visible,
.tab-btn:focus-visible,
.module-item:focus-visible,
.quick-card:focus-visible,
.filter-btn:focus-visible,
.sidebar-link:focus-visible,
.checklist-item:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Skip link (hidden until focused) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: .5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top .2s;
}

.skip-link:focus {
  top: 1rem;
}

/* Loading state */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--muted);
  gap: 1rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

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

  .progress-ring-fill {
    transition: none !important;
  }
}
