/* =========================================================
   EduVirtuelle — Feuille de style principale
   Palette : nuances de bleu & blanc + couleurs complémentaires
   ========================================================= */

:root {
  --blue-900: #0b1f4d;
  --blue-800: #12306e;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-200: #bfdbfe;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --sky: #0ea5e9;

  --green: #16a34a;
  --green-bg: #dcfce7;
  --orange: #ea580c;
  --orange-bg: #ffedd5;
  --amber: #f59e0b;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --violet: #7c3aed;
  --violet-bg: #ede9fe;
  --gray-bg: #f1f5f9;

  --bg: #f5f8ff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;
  --primary: var(--blue-600);
  --primary-strong: var(--blue-700);
  --primary-soft: var(--blue-50);
  --heading: var(--blue-900);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 6px 24px rgba(29, 78, 216, .08);
  --shadow-lg: 0 18px 50px rgba(29, 78, 216, .16);
  --sidebar-w: 260px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0a1224;
  --surface: #111c34;
  --surface-2: #0e1830;
  --border: #22335a;
  --text: #e6edf9;
  --text-soft: #b6c3dc;
  --text-muted: #8a9ab8;
  --primary: #4f8cff;
  --primary-strong: #6ea0ff;
  --primary-soft: #16264a;
  --heading: #f1f5ff;
  --green-bg: #0f2e1d;
  --orange-bg: #3a2210;
  --red-bg: #3a1417;
  --violet-bg: #251a45;
  --gray-bg: #1a2744;
  --blue-50: #13223f;
  --blue-100: #1a2d52;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.flex-wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.grid-side { grid-template-columns: 300px minmax(0, 1fr); }
:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 2px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer;
  text-decoration: none !important; white-space: nowrap;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .3); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(37, 99, 235, .42); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-light { background: #fff; color: var(--blue-700); }
.btn-light:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, .15); }
.btn-ghost { background: var(--primary-soft); color: var(--primary); }
.btn-ghost:hover { background: var(--blue-100); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-ghost { background: var(--red-bg); color: var(--red); }
.btn-sm { padding: 7px 13px; font-size: .84rem; border-radius: 9px; }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; border-radius: 14px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: inline-grid; place-items: center;
  cursor: pointer; font-size: 1.1rem; position: relative; transition: background .2s;
}
.icon-btn:hover { background: var(--primary-soft); }
.icon-btn .dot {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700;
  display: grid; place-items: center;
}

/* ---------- Cartes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title h3 { margin: 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-gray { background: var(--gray-bg); color: var(--text-muted); }
.badge-blue { background: var(--blue-100); color: var(--primary); }
.badge-violet { background: var(--violet-bg); color: var(--violet); }

/* ---------- Barre de progression ---------- */
.progress { height: 10px; background: var(--blue-100); border-radius: 99px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 99px; width: 0;
  background: linear-gradient(90deg, var(--sky), var(--blue-600));
  transition: width .8s cubic-bezier(.2, .8, .2, 1);
}
.progress-sm { height: 6px; }
.progress-label { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }

/* ---------- Alertes ---------- */
.alert { padding: 14px 16px; border-radius: 12px; border: 1px solid; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.alert-info { background: var(--blue-50); border-color: var(--blue-200); color: var(--primary-strong); }
.alert-success { background: var(--green-bg); border-color: #86efac; color: var(--green); }
.alert-warning { background: var(--orange-bg); border-color: #fdba74; color: var(--orange); }
.alert-danger { background: var(--red-bg); border-color: #fca5a5; color: var(--red); }
[data-theme="dark"] .alert { border-color: transparent; }
.alert .btn { margin-left: auto; }

/* ---------- Formulaires ---------- */
.form-group { margin-bottom: 16px; }
.form-group label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--text-soft); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 11px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; transition: border-color .2s, box-shadow .2s;
}
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.input.invalid { border-color: var(--red); }
.field-error { color: var(--red); font-size: .8rem; margin-top: 5px; min-height: 1em; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-icon { position: relative; }
.input-icon .toggle-pass { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; font-size: 1rem; color: var(--text-muted); }
.checkbox { display: flex; gap: 8px; align-items: center; font-size: .9rem; cursor: pointer; }
.password-meter { height: 5px; background: var(--border); border-radius: 5px; margin-top: 8px; overflow: hidden; }
.password-meter span { display: block; height: 100%; width: 0; transition: width .3s, background .3s; }

/* ---------- Navigation publique ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .navbar { background: rgba(10, 18, 36, .88); }
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--heading); text-decoration: none !important; }
.brand img { width: 42px; height: 42px; flex-shrink: 0; background: #fff; border-radius: 12px; padding: 3px; box-shadow: 0 2px 8px rgba(15, 23, 42, .12); }
.brand small { white-space: nowrap; }
.brand small { display: block; font-size: .7rem; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { padding: 8px 12px; border-radius: 9px; color: var(--text-soft); font-weight: 600; font-size: .93rem; }
.nav-links a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(1000px 500px at 85% -10%, rgba(14, 165, 233, .55), transparent 60%),
              linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 60%, var(--blue-500) 100%);
  padding: 90px 0 110px;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 -1px 0; height: 70px; background: var(--bg);
  clip-path: ellipse(75% 100% at 50% 100%);
}
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; position: relative; z-index: 1; }
.hero h1 { color: #fff; }
.hero h1 span { background: linear-gradient(90deg, #7dd3fc, #fff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.15rem; color: rgba(255, 255, 255, .85); max-width: 560px; }
.hero-tag { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 99px; background: rgba(255, 255, 255, .14); font-weight: 600; font-size: .85rem; margin-bottom: 18px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats { display: flex; gap: 34px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 1.7rem; font-weight: 800; }
.hero-stats span { color: rgba(255, 255, 255, .75); font-size: .9rem; }
.hero-visual { position: relative; }
.mock {
  background: #fff; color: var(--text); border-radius: 20px; padding: 20px; box-shadow: 0 30px 70px rgba(0, 0, 0, .3);
  animation: float 6s ease-in-out infinite;
}
[data-theme="dark"] .mock { background: var(--surface); }
.mock-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.mock-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--surface-2); margin-bottom: 10px; }
.mock-row .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.mock-row .grow { flex: 1; }
.floating-chip {
  position: absolute; background: #fff; color: var(--text); padding: 10px 14px; border-radius: 14px;
  box-shadow: var(--shadow-lg); font-weight: 700; font-size: .85rem; display: flex; gap: 8px; align-items: center;
  animation: float 5s ease-in-out infinite;
}
[data-theme="dark"] .floating-chip { background: var(--surface); }
.chip-1 { top: -18px; right: -10px; animation-delay: -2s; }
.chip-2 { bottom: -20px; left: -20px; animation-delay: -1s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--surface); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 46px; }
.eyebrow { display: inline-block; font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
.feature-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 14px; background: var(--primary-soft); }
.subject-card { text-align: center; padding: 26px 16px; }
.subject-card .feature-icon { margin: 0 auto 12px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.about-visual { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.about-visual .card { text-align: center; }
.about-visual .card strong { display: block; font-size: 1.8rem; color: var(--primary); font-weight: 800; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding: 6px 0 6px 30px; position: relative; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--green-bg); color: var(--green); font-size: .75rem; font-weight: 800; display: grid; place-items: center; }

/* Formules */
.plan-card { position: relative; display: flex; flex-direction: column; padding: 30px 26px; border-width: 2px; }
.plan-card.featured { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: scale(1.03); }
.plan-card.featured:hover { transform: scale(1.03) translateY(-4px); }
.plan-card .ribbon { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--blue-600), var(--sky)); color: #fff; padding: 4px 14px; border-radius: 99px; font-size: .78rem; font-weight: 800; }
.plan-card .plan-name { font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.plan-price { font-size: 2.2rem; font-weight: 800; color: var(--heading); margin: 12px 0 4px; }
.plan-price small { font-size: .95rem; font-weight: 600; color: var(--text-muted); }
.plan-card .check-list { margin: 18px 0 24px; flex: 1; }
.plan-card.current { border-color: var(--green); }

/* Étapes */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.step { text-align: center; position: relative; }
.step .num { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 14px; background: linear-gradient(135deg, var(--blue-600), var(--sky)); color: #fff; font-size: 1.4rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(37, 99, 235, .3); }
.flow { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 36px; }
.flow span { background: var(--primary-soft); color: var(--primary); padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: .82rem; }
.flow i { color: var(--text-muted); font-style: normal; align-self: center; }

/* Témoignages */
.testimonial p { font-style: italic; color: var(--text-soft); }
.testimonial .who { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--blue-600), var(--sky)); flex-shrink: 0; }
.avatar-lg { width: 84px; height: 84px; font-size: 1.8rem; }
.stars { color: var(--amber); letter-spacing: 2px; }

.cta-band { background: linear-gradient(135deg, var(--blue-700), var(--sky)); color: #fff; border-radius: var(--radius-lg); padding: 50px; text-align: center; box-shadow: var(--shadow-lg); }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, .88); }

/* Pied de page */
.footer { background: var(--blue-900); color: rgba(255, 255, 255, .78); padding: 60px 0 24px; }
[data-theme="dark"] .footer { background: #060d1c; }
.footer h4 { color: #fff; font-size: 1rem; }
.footer a { color: rgba(255, 255, 255, .78); }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 30px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { padding: 4px 0; }
.footer .brand { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .85rem; }
.pay-logos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pay-logos span { background: rgba(255, 255, 255, .1); padding: 4px 10px; border-radius: 8px; font-size: .78rem; font-weight: 700; }

/* ---------- Pages d'authentification ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background: radial-gradient(700px 400px at 100% 0, rgba(14, 165, 233, .5), transparent 60%), linear-gradient(135deg, var(--blue-900), var(--blue-700));
  color: #fff; padding: 50px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side h2 { color: #fff; }
.auth-side .brand { color: #fff; }
.auth-side .check-list li::before { background: rgba(255, 255, 255, .2); color: #fff; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 480px; }
.auth-card h1 { font-size: 1.9rem; }
.demo-box { font-size: .82rem; background: var(--primary-soft); border: 1px dashed var(--blue-400); border-radius: 12px; padding: 12px 14px; margin-top: 20px; }
.demo-box code { font-weight: 700; }

/* ---------- Espace application (élève & admin) ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 60; transition: transform .3s;
}
.sidebar .brand { padding: 20px 22px; border-bottom: 1px solid var(--border); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.sidebar-nav a, .sidebar-nav button {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 11px; width: 100%;
  color: var(--text-soft); font-weight: 600; font-size: .93rem; border: 0; background: none; font-family: inherit;
  cursor: pointer; text-align: left; margin-bottom: 2px; transition: background .2s, color .2s;
}
.sidebar-nav a:hover, .sidebar-nav button:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.sidebar-nav a.active { background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .3); }
.sidebar-nav .ico { width: 22px; text-align: center; }
.sidebar-nav .count { margin-left: auto; background: var(--red); color: #fff; font-size: .72rem; padding: 1px 7px; border-radius: 99px; }
.sidebar-nav .sep { height: 1px; background: var(--border); margin: 10px 8px; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }
.sub-mini { font-size: .82rem; padding: 12px; border-radius: 12px; background: var(--primary-soft); }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; background: rgba(245, 248, 255, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); padding: 12px 28px; display: flex; align-items: center; gap: 14px;
}
[data-theme="dark"] .topbar { background: rgba(10, 18, 36, .9); }
.topbar .title { font-weight: 800; font-size: 1.1rem; color: var(--heading); }
.topbar .spacer { flex: 1; }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .9rem; color: var(--text); text-decoration: none !important; }
.topbar .user-chip .avatar { width: 38px; height: 38px; font-size: .9rem; }
.menu-toggle { display: none; }
.content { padding: 28px; flex: 1; animation: fadeIn .35s ease; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.page-header h1 { font-size: 1.7rem; margin: 0; }
.page-header p { margin: 4px 0 0; color: var(--text-muted); }
.overlay { position: fixed; inset: 0; background: rgba(2, 6, 23, .5); z-index: 55; display: none; }
.overlay.show { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Statistiques */
.stat-card { display: flex; gap: 16px; align-items: center; }
.stat-card .ic { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 1.5rem; flex-shrink: 0; }
.stat-card .val { font-size: 1.6rem; font-weight: 800; color: var(--heading); line-height: 1.1; }
.stat-card .lbl { font-size: .85rem; color: var(--text-muted); font-weight: 600; }
.ic-blue { background: var(--blue-100); } .ic-green { background: var(--green-bg); } .ic-orange { background: var(--orange-bg); }
.ic-violet { background: var(--violet-bg); } .ic-red { background: var(--red-bg); } .ic-gray { background: var(--gray-bg); }

.welcome {
  background: radial-gradient(600px 300px at 100% 0, rgba(14, 165, 233, .45), transparent 60%), linear-gradient(135deg, var(--blue-700), var(--blue-600));
  color: #fff; border: 0; padding: 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.welcome h1 { color: #fff; font-size: 1.8rem; margin-bottom: 4px; }
.welcome p { color: rgba(255, 255, 255, .85); margin: 0; }
.ring { --p: 0; width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0); }
.ring span { width: 84px; height: 84px; border-radius: 50%; background: var(--blue-700); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; color: #fff; }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 700; color: var(--text); }
.list-item .s { font-size: .82rem; color: var(--text-muted); }
.thumb { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.sicon {
  --c: #1f6fe0; display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 30%; color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 20%, transparent);
}
.sicon svg { width: 56%; height: 56%; }
.sicon-emoji { font-size: 1.2em; line-height: 1; }
.sicon-xs { width: 1.3em; height: 1.3em; background: none; box-shadow: none; vertical-align: -.3em; margin-right: 1px; }
.sicon-xs svg { width: 100%; height: 100%; }
.sicon-sm { width: 32px; height: 32px; border-radius: 10px; }
.sicon-md { width: 44px; height: 44px; border-radius: 13px; font-size: 1.3rem; }
.sicon-lg { width: 58px; height: 58px; border-radius: 17px; font-size: 1.6rem; }
.sicon-xl { width: 80px; height: 80px; border-radius: 24px; font-size: 2.3rem; }
.sicon-solid {
  color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 80%, #000));
  box-shadow: 0 12px 26px color-mix(in srgb, var(--c) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35);
}
[data-theme="dark"] .sicon:not(.sicon-solid) { color: color-mix(in srgb, var(--c) 65%, #fff); background: color-mix(in srgb, var(--c) 22%, transparent); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .big { font-size: 2.6rem; margin-bottom: 8px; }

/* Cours */
.course-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.course-cover { height: 120px; display: grid; place-items: center; font-size: 3rem; position: relative; }
.course-cover .badge { position: absolute; top: 12px; right: 12px; }
.course-cover .lock { position: absolute; inset: 0; background: rgba(11, 31, 77, .55); display: grid; place-items: center; font-size: 2rem; }
.course-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-body h3 { margin: 0; font-size: 1.05rem; }
.course-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.filters .input { width: auto; min-width: 170px; flex: 1; }
.filters .search { flex: 2; min-width: 220px; }

.course-layout { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
.chapter { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.chapter-head { padding: 12px 14px; background: var(--surface-2); font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.chapter-body { padding: 6px; }
.chapter.collapsed .chapter-body { display: none; }
.lesson-link { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; color: var(--text-soft); font-size: .9rem; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; font-family: inherit; }
.lesson-link:hover { background: var(--primary-soft); }
.lesson-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.lesson-link .st { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: .7rem; flex-shrink: 0; }
.lesson-link.done .st { background: var(--green); border-color: var(--green); color: #fff; }
.lesson-content { font-size: 1rem; }
.lesson-content p { color: var(--text-soft); }
.video-wrap { position: relative; padding-top: 56.25%; border-radius: 14px; overflow: hidden; background: #000; margin-bottom: 18px; }
.video-wrap iframe, .video-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.doc-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; color: var(--text); }
.doc-link:hover { background: var(--primary-soft); text-decoration: none; }

/* Onglets */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 16px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--text-muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Tableaux */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; padding: 12px 14px; background: var(--surface-2); color: var(--text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }

/* Quiz / examens */
.quiz-shell { max-width: 820px; margin: 0 auto; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.timer { font-weight: 800; font-variant-numeric: tabular-nums; padding: 8px 14px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.timer.warn { background: var(--red-bg); color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.question-text { font-size: 1.2rem; font-weight: 700; color: var(--heading); margin-bottom: 18px; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 2px solid var(--border); border-radius: 13px;
  cursor: pointer; background: var(--surface); font: inherit; color: var(--text); text-align: left; width: 100%; transition: border-color .15s, background .15s;
}
.option:hover { border-color: var(--blue-400); }
.option .letter { width: 30px; height: 30px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option.selected .letter { background: var(--primary); color: #fff; }
.option.correct { border-color: var(--green); background: var(--green-bg); }
.option.correct .letter { background: var(--green); color: #fff; }
.option.wrong { border-color: var(--red); background: var(--red-bg); }
.option.wrong .letter { background: var(--red); color: #fff; }
.option:disabled { cursor: default; }
.explain { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--primary); font-size: .92rem; }
.q-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.q-dot { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; font-size: .8rem; cursor: pointer; color: var(--text-soft); }
.q-dot.answered { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.q-dot.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.score-hero { text-align: center; padding: 30px; }
.score-circle { width: 150px; height: 150px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c, var(--primary)) calc(var(--p) * 1%), var(--blue-100) 0); }
.score-circle span { width: 118px; height: 118px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; color: var(--heading); }
.review-item { border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.review-item.ok { border-left: 5px solid var(--green); }
.review-item.ko { border-left: 5px solid var(--red); }

/* Paiement */
.pay-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: start; }
.method {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 2px solid var(--border); border-radius: 14px;
  cursor: pointer; margin-bottom: 10px; background: var(--surface); transition: border-color .15s, background .15s;
}
.method:hover { border-color: var(--blue-400); }
.method input { accent-color: var(--primary); width: 18px; height: 18px; }
.method.selected { border-color: var(--primary); background: var(--primary-soft); }
.method .logo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: .8rem; flex-shrink: 0; }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .93rem; }
.summary-total { display: flex; justify-content: space-between; padding-top: 14px; font-weight: 800; font-size: 1.25rem; color: var(--heading); }
.secure-note { display: flex; gap: 10px; font-size: .82rem; color: var(--text-muted); margin-top: 16px; }
.btn-wave { background: #1dc4ff; color: #04243a; box-shadow: 0 6px 18px rgba(29, 196, 255, .35); }
.btn-wave:hover { background: #14b4ec; box-shadow: 0 10px 26px rgba(29, 196, 255, .45); }
.btn-wave img { border-radius: 6px; }
.wave-logo { width: 28px; height: 28px; border-radius: 7px; vertical-align: middle; }
.wave-steps { padding-left: 20px; margin: 8px 0 0; }
.wave-steps li { margin-bottom: 8px; line-height: 1.5; }
.success-screen { text-align: center; max-width: 560px; margin: 30px auto; }
.success-icon { width: 96px; height: 96px; border-radius: 50%; background: var(--green-bg); color: var(--green); font-size: 3rem; display: grid; place-items: center; margin: 0 auto 18px; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.flow-mini { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.flow-mini span { font-size: .8rem; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: var(--green-bg); color: var(--green); }

/* Abonnement */
.sub-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.sub-status .k { font-size: .78rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sub-status .v { font-weight: 800; color: var(--heading); font-size: 1.05rem; }

/* Notifications */
.notif { display: flex; gap: 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 10px; background: var(--surface); }
.notif.unread { border-color: var(--blue-400); background: var(--primary-soft); }
.notif .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; background: var(--blue-100); }
.notif .grow { flex: 1; }
.notif-panel {
  position: absolute; right: 0; top: 50px; width: 360px; max-width: calc(100vw - 32px); max-height: 440px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 12px; z-index: 70;
}
.notif-panel .notif { padding: 10px; font-size: .88rem; }

/* Modales */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fadeIn .2s; }
.modal { background: var(--surface); border-radius: 20px; width: 100%; max-width: 620px; max-height: calc(100vh - 40px); overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-lg { max-width: 920px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }

/* Toasts */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--surface); color: var(--text); border-left: 5px solid var(--primary); padding: 14px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 260px; max-width: 380px; font-weight: 600; font-size: .9rem; animation: slideIn .3s ease; }
.toast.success { border-color: var(--green); } .toast.error { border-color: var(--red); } .toast.warning { border-color: var(--amber); }
@keyframes slideIn { from { transform: translateX(120%); } to { transform: none; } }

/* Graphiques */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--border); }
.chart text { fill: var(--text-muted); font-size: 11px; font-family: var(--font); }
.chart .val-label { fill: var(--text); font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: .82rem; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* Éditeur de questions (admin) */
.q-editor { border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: var(--surface-2); }
.q-editor .opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.q-editor .opt-row input[type=radio] { accent-color: var(--green); width: 18px; height: 18px; flex-shrink: 0; }
.inline-list { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .course-layout { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nav-links, .nav-actions .btn-outline { display: none; }
  .nav-toggle { display: inline-grid; }
  .navbar.open .nav-links {
    display: flex; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 20px; box-shadow: var(--shadow);
  }
  .navbar.open .nav-actions .btn-outline { display: inline-flex; }
  .hero .container, .about-grid, .pay-layout, .grid-wide, .grid-side { grid-template-columns: 1fr; }
  .hero-visual { max-width: 460px; margin: 0 auto; width: 100%; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-card.featured { transform: none; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px; }
}
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .grid-2, .grid-3, .grid-4, .form-row, .steps, .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .hero { padding: 60px 0 90px; }
  .hero-stats { gap: 20px; }
  .cta-band { padding: 34px 20px; }
  .topbar .user-chip .name { display: none; }
  .topbar .title { font-size: 1rem; }
  .nav-actions .btn-primary { padding: 9px 14px; font-size: .85rem; }
  .brand small { display: none; }
  .modal-body { padding: 16px; }
  .floating-chip { display: none; }
  .card { padding: 18px; }
  .table-stack thead { display: none; }
  .table-stack tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .table-stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 14px; }
  .table-stack td::before { content: attr(data-label); font-weight: 700; color: var(--text-muted); font-size: .78rem; text-transform: uppercase; }
  .table-stack .actions { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Téléversement des fichiers de leçon ---------- */
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 6px; }
.media-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); min-width: 0; }
.media-box-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 30px; }
.media-state { display: flex; align-items: center; gap: 4px; }
.dropzone {
  display: flex; align-items: center; gap: 12px; padding: 16px; border: 2px dashed var(--blue-200); border-radius: 12px; cursor: pointer;
  background: var(--surface); transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dz-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 1.3rem; font-weight: 800; flex-shrink: 0; }
.dz-text { display: flex; flex-direction: column; line-height: 1.35; }
.dz-text strong { color: var(--primary); }
.dz-text small { font-size: .78rem; color: var(--text-soft); }
.dz-progress { display: flex; flex-direction: column; gap: 4px; }
.dz-bar { width: 0; transition: width .6s ease; }
.media-preview video { width: 100%; max-height: 190px; border-radius: 10px; background: #000; margin-top: 6px; }
.media-file { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; min-width: 0; }
.media-file .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .media-grid { grid-template-columns: 1fr; } }
