/* ═══════════════════════════════════════════════════════════════════════════
   FORMATEUR PRO — LMS v1.7  •  Foundation visuelle (style.css)
   Design system : palette brique #B5462E, fonts Inter, radius doux, surfaces blanches
   Couvre : reset, typo, layout (auth + app), composants UI, écrans LMS,
            studio multi-étapes, lecteur leçon, responsive.
   ═══════════════════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 0  •  VARIABLES CSS  (:root)
   ═══════════════════════════════════════════════════════════════════════════ */
:root {

  /* — Brand — */
  --brand:                 #B5462E;
  --brand-dark:            #712B13;
  --brand-soft:            #FAECE7;
  --brand-soft-strong:     #F4D9CF;
  --gradient-brand:        linear-gradient(135deg, #B5462E 0%, #712B13 100%);
  --gradient-brand-rev:    linear-gradient(135deg, #712B13 0%, #B5462E 100%);

  /* — Surfaces / Backgrounds — */
  --bg:                    #F7F5F1;   /* page bg beige */
  --bg-soft:               #FAFAF8;   /* outline list bg */
  --surface:               #FFFFFF;
  --hover-bg:              #F9FAFB;

  /* — Textes — */
  --text-1:                #1F2937;   /* corps fort, titres */
  --text-2:                #374151;   /* labels */
  --text-3:                #6B7280;   /* meta */
  --text-4:                #9CA3AF;   /* placeholder / disabled */
  --text-on-brand:         #FFFFFF;

  /* — Borders — */
  --border-strong:         #D1D5DB;
  --border:                #E5E7EB;
  --border-soft:           #F3F4F6;

  /* — Statuts — */
  --success:               #16A34A;
  --success-soft:          #DCFCE7;
  --success-dark:          #166534;

  --warning:               #EAB308;
  --warning-soft:          #FEF3C7;
  --warning-dark:          #92400E;

  --danger:                #DC2626;
  --danger-soft:           #FEE2E2;
  --danger-dark:           #991B1B;

  --info:                  #1E40AF;
  --info-soft:             #DBEAFE;
  --info-dark:             #1E3A8A;

  /* — Typo scale — */
  --fs-11:                 11px;
  --fs-12:                 12px;
  --fs-13:                 13px;
  --fs-14:                 14px;
  --fs-15:                 15px;
  --fs-16:                 16px;
  --fs-17:                 17px;
  --fs-18:                 18px;
  --fs-22:                 22px;
  --fs-26:                 26px;
  --fs-36:                 36px;
  --fs-50:                 50px;

  --fw-400:                400;
  --fw-500:                500;
  --fw-600:                600;

  --font-sans:             'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  /* — Espacements (4-base) — */
  --sp-1:                  4px;
  --sp-2:                  8px;
  --sp-3:                  12px;
  --sp-4:                  16px;
  --sp-5:                  20px;
  --sp-6:                  24px;
  --sp-7:                  28px;
  --sp-8:                  32px;
  --sp-9:                  40px;
  --sp-10:                 48px;
  --sp-11:                 56px;
  --sp-12:                 64px;
  --sp-13:                 72px;
  --sp-14:                 80px;

  /* — Radius — */
  --r-sm:                  6px;
  --r-md:                  8px;
  --r-lg:                  10px;
  --r-xl:                  12px;
  --r-2xl:                 16px;
  --r-pill:                999px;

  /* — Shadows — */
  --shadow-xs:             0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:             0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:             0 4px 12px rgba(31,41,55,0.05);
  --shadow-lg:             0 8px 24px rgba(31,41,55,0.08);
  --shadow-card:           0 1px 3px rgba(0,0,0,0.04);
  --shadow-drop:           0 4px 24px rgba(31,41,55,0.06);
  --shadow-modal:          0 20px 50px rgba(0,0,0,0.20);

  /* — Layout repères — */
  --sidebar-w:             260px;
  --topbar-h:              60px;
  --content-max:           1240px;

  /* — Transitions — */
  --t-fast:                0.15s ease;
  --t-base:                0.2s ease;
  --t-slow:                0.3s ease;

  /* — Alias historiques (compat JS v1.5) — */
  --text:                  #1F2937;
  --text2:                 #6B7280;
  --primary:               #B5462E;
  --primary-dark:          #712B13;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 1  •  RESET / BASE
   ═══════════════════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-feature-settings: 'cv02','cv03','cv04','cv11';
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

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

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

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--brand-dark); }

::-webkit-scrollbar      { width: 10px; height: 10px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{ background: #D7D3CC; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #BCB7AE; background-clip: padding-box; border: 2px solid transparent; }

::selection { background: var(--brand-soft-strong); color: var(--brand-dark); }


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 2  •  TYPOGRAPHIE
   ═══════════════════════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sp-3) 0;
  color: var(--text-1);
  font-weight: var(--fw-500);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
h1 { font-size: var(--fs-26); }
h2 { font-size: var(--fs-22); }
h3 { font-size: var(--fs-18); }
h4 { font-size: var(--fs-16); }
h5 { font-size: var(--fs-14); }
h6 { font-size: var(--fs-13); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }

p {
  margin: 0 0 var(--sp-3) 0;
  color: var(--text-2);
  line-height: 1.6;
}

small { font-size: var(--fs-12); color: var(--text-3); }
strong, b { font-weight: var(--fw-600); color: var(--text-1); }

code, pre, kbd {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--border-soft);
  border-radius: var(--r-sm);
  padding: 0.1em 0.4em;
  color: var(--text-1);
}

/* Eyebrow (badge label haut de section) */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-11);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: var(--fw-500);
  color: var(--brand-dark);
  background: var(--brand-soft);
  padding: 7px 14px;
  border-radius: 20px;
}
.eyebrow i { font-size: 14px; }

/* Titres de page */
.page-title {
  font-size: var(--fs-26);
  font-weight: var(--fw-500);
  letter-spacing: -0.01em;
  color: var(--text-1);
  margin: 0 0 var(--sp-2) 0;
}
.page-subtitle {
  font-size: var(--fs-14);
  color: var(--text-3);
  margin: 0 0 var(--sp-6) 0;
}

/* Helpers texte */
.text-muted     { color: var(--text-3) !important; }
.text-meta      { font-size: var(--fs-12); color: var(--text-3); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning-dark); }
.text-danger    { color: var(--danger); }
.text-brand     { color: var(--brand); }
.text-sm        { font-size: var(--fs-13); }
.text-xs        { font-size: var(--fs-12); }
.text-lg        { font-size: var(--fs-16); }

/* Headings utilitaires */
.h1 { font-size: var(--fs-26); font-weight: var(--fw-500); letter-spacing: -0.01em; }
.h2 { font-size: var(--fs-22); font-weight: var(--fw-500); }
.h3 { font-size: var(--fs-18); font-weight: var(--fw-500); }


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 3  •  LAYOUT  (Auth shell, App shell, Sidebar, Topbar)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ----- Auth shell (2 colonnes : brand panel | form panel) ----- */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  min-height: 100vh;
  background: var(--surface);
}

/* Panneau gauche : gradient brique */
.brand-panel {
  background: var(--gradient-brand);
  color: #FFFFFF;
  padding: 48px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(255,255,255,0.08), transparent 50%),
              radial-gradient(circle at 0% 100%, rgba(0,0,0,0.15), transparent 60%);
  pointer-events: none;
}
.brand-panel > * { position: relative; z-index: 1; }

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-18);
  font-weight: var(--fw-600);
  letter-spacing: -0.01em;
  color: #FFFFFF;
}
.brand-logo i { font-size: 28px; }

.brand-content { max-width: 480px; }
.brand-content h1 {
  font-size: 38px;
  font-weight: var(--fw-500);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #FFFFFF;
  margin: 0 0 var(--sp-4) 0;
}
.brand-content p {
  color: rgba(255,255,255,0.85);
  font-size: var(--fs-16);
  line-height: 1.55;
  margin: 0 0 var(--sp-7) 0;
}

.value-props {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-8) 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.value-props li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.92);
  font-size: var(--fs-14);
}
.value-props li i {
  font-size: 18px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #B5F2C4;
}

.testimonial-mini {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 18px 20px;
  backdrop-filter: blur(6px);
}
.testimonial-mini p {
  font-style: italic;
  color: rgba(255,255,255,0.92);
  font-size: var(--fs-14);
  line-height: 1.55;
  margin: 0 0 var(--sp-3) 0;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.testimonial-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-500);
  font-size: var(--fs-13);
  color: #FFFFFF;
}
.testimonial-name {
  font-size: var(--fs-13);
  font-weight: var(--fw-500);
  color: #FFFFFF;
}
.testimonial-role {
  font-size: var(--fs-12);
  color: rgba(255,255,255,0.7);
}

.brand-footer {
  margin-top: var(--sp-6);
  font-size: var(--fs-12);
  color: rgba(255,255,255,0.7);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brand-footer-links {
  display: flex;
  gap: 18px;
}
.brand-footer-links a {
  color: rgba(255,255,255,0.85);
  font-size: var(--fs-12);
}
.brand-footer-links a:hover { color: #FFFFFF; }

/* Panneau droit : formulaire */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 64px;
  background: var(--surface);
}
.auth-container {
  width: 100%;
  max-width: 460px;
}

/* ----- App shell (sidebar + main) ----- */
#app,
.app {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}
.app-shell { display: flex; min-height: 100vh; }

/* Sidebar gauche — wrapper (aside) */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 22px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand,
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-15);
  font-weight: 500;
  color: var(--brand);
  letter-spacing: -0.005em;
}
.sidebar-logo i,
.sidebar-brand i {
  font-size: 24px;
  color: var(--brand);
}
.sidebar-logo span,
.sidebar-brand span {
  color: var(--brand);
}

/* Nav interne (peuplee par buildSidebar() dans #sidebar) */
.sidebar-nav,
#sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0 16px;
  width: 100%;
  background: transparent;
  border: none;
  position: static;
  height: auto;
  overflow: visible;
  flex-shrink: 1;
}

/* Item de navigation (peuple par buildSidebar() dans #sidebar) */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  font-size: var(--fs-14);
  color: #4B5563;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background var(--t-fast), color var(--t-fast);
  user-select: none;
  background: transparent;
  border-top: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  line-height: 1.4;
}
.nav-item i {
  font-size: 18px;
  color: #9CA3AF;
  flex-shrink: 0;
  width: 20px;
  display: inline-flex;
  justify-content: center;
  transition: color var(--t-fast);
}
.nav-item:hover {
  background: #F9FAFB;
  color: var(--text-1);
}
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-left-color: var(--brand);
  padding-left: 21px;
  font-weight: 500;
}
.nav-item.active i {
  color: var(--brand);
}
.nav-item.highlight {
  color: var(--brand);
}
.nav-item.highlight i {
  color: var(--brand);
}

/* Etiquettes de groupe dans la sidebar */
.nav-section-label {
  font-size: 11px;
  color: #9CA3AF;
  padding: 18px 24px 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  user-select: none;
}

/* Conserve l'ancienne classe utilitaire .nav-icon si elle est referencee ailleurs */
.nav-icon {
  font-size: 18px;
  width: 22px;
  display: inline-flex;
  justify-content: center;
  flex-shrink: 0;
}

/* Main (zone droite) */
.main,
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar .topbar-right { display: flex; align-items: center; gap: 16px; }

.user-info,
.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-name {
  font-size: var(--fs-14);
  font-weight: var(--fw-500);
  color: var(--text-1);
}

/* Content area */
.content {
  flex: 1;
  padding: 32px;
  background: var(--bg);
  min-height: 0;
}

/* Pages (vues SPA toggle via .active) */
.page { display: none; }
.page.active { display: block; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 4  •  BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  font-size: var(--fs-14);
  font-weight: var(--fw-500);
  font-family: inherit;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  background: transparent;
  color: var(--text-1);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
}
.btn i { font-size: 16px; }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(181,70,46,0.25);
}

/* — Primary — */
.btn-primary,
button.btn-primary {
  background: var(--brand);
  color: #FFFFFF;
  border: 1px solid var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  font-size: var(--fs-14);
  font-weight: var(--fw-500);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  font-family: inherit;
  line-height: 1.2;
}
.btn-primary:hover,
button.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #FFFFFF;
}
.btn-primary i { font-size: 16px; }

.btn-primary-lg,
.btn-primary.btn-lg {
  padding: 14px 22px;
  font-size: var(--fs-15);
  border-radius: var(--r-lg);
}

/* — Secondary / Outline — */
.btn-outline,
.btn-secondary,
button.btn-secondary {
  background: #FFFFFF;
  color: var(--text-1);
  border: 1px solid var(--border-strong);
  padding: 11px 18px;
  font-size: var(--fs-14);
  font-weight: var(--fw-500);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.2;
}
.btn-outline:hover,
.btn-secondary:hover {
  background: var(--hover-bg);
  border-color: var(--text-4);
  color: var(--text-1);
}
.btn-secondary i { font-size: 16px; }

/* — Ghost — */
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--border-soft); color: var(--text-1); }

/* — Danger — */
.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger-dark); border-color: var(--danger-dark); }

/* — Success — */
.btn-success {
  background: var(--success);
  color: #FFFFFF;
  border: 1px solid var(--success);
  padding: 11px 18px;
  font-size: var(--fs-14);
  font-weight: var(--fw-500);
  border-radius: var(--r-lg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.btn-success:hover { background: var(--success-dark); border-color: var(--success-dark); }

/* — Tailles — */
.btn-sm {
  padding: 7px 12px !important;
  font-size: var(--fs-13) !important;
  border-radius: var(--r-md) !important;
}
.btn-lg {
  padding: 14px 22px;
  font-size: var(--fs-15);
}
.btn-block,
.btn.btn-block {
  display: flex;
  width: 100%;
}

/* — Variantes spéciales — */
.btn-white-lg {
  background: #FFFFFF;
  color: var(--brand-dark);
  border: 1px solid #FFFFFF;
  padding: 14px 22px;
  font-size: var(--fs-15);
  font-weight: var(--fw-500);
  border-radius: var(--r-lg);
  cursor: pointer;
}
.btn-white-lg:hover { background: var(--bg); }

.btn-google {
  background: #FFFFFF;
  color: var(--text-1);
  border: 1px solid var(--border-strong);
  padding: 11px 18px;
  font-size: var(--fs-14);
  font-weight: var(--fw-500);
  border-radius: var(--r-lg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.btn-google:hover { background: var(--hover-bg); }
.btn-google img,
.btn-google i { width: 16px; height: 16px; font-size: 16px; }

/* — Icon button (studio actions) — */
.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--text-2);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 14px;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn-icon:hover { background: var(--hover-bg); color: var(--text-1); }
.btn-icon.danger { color: var(--danger); }
.btn-icon.danger:hover { background: var(--danger-soft); border-color: var(--danger); }

/* — Logout / exit (topbar/lecon) — */
.btn-logout,
.btn-exit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-13);
  cursor: pointer;
  font-family: inherit;
}
.btn-logout:hover,
.btn-exit:hover { background: var(--hover-bg); color: var(--text-1); }

/* — Disabled — */
.btn:disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 5  •  INPUTS / FORMS
   ═══════════════════════════════════════════════════════════════════════════ */
.input-field,
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: #FFFFFF;
  font-family: inherit;
  font-size: var(--fs-14);
  color: var(--text-1);
  line-height: 1.4;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input-field::placeholder,
.form-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-4);
  opacity: 1;
}
.input-field:focus,
.form-input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(181,70,46,0.12);
}
.input-field:disabled,
.form-input:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--border-soft);
  color: var(--text-4);
  cursor: not-allowed;
}

/* — Select : flèche custom — */
select,
select.input-field,
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 36px;
  cursor: pointer;
}

/* — Textarea — */
textarea,
textarea.input-field,
textarea.form-input {
  min-height: 88px;
  resize: vertical;
  line-height: 1.5;
}

/* — Small input — */
.form-input-sm,
.input-field-sm {
  padding: 7px 11px;
  font-size: var(--fs-13);
  border-radius: var(--r-md);
}

/* — Form groups — */
.form-group,
.form-row {
  margin-bottom: var(--sp-4);
}
.form-group:last-child,
.form-row:last-child { margin-bottom: 0; }

label,
.form-label {
  display: block;
  font-size: var(--fs-13);
  font-weight: var(--fw-500);
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-heading {
  font-size: var(--fs-22);
  font-weight: var(--fw-500);
  letter-spacing: -0.01em;
  color: var(--text-1);
  margin: 0 0 var(--sp-2) 0;
}
.form-sub {
  font-size: var(--fs-14);
  color: var(--text-3);
  margin: 0 0 var(--sp-6) 0;
  line-height: 1.5;
}

.form-hint {
  font-size: var(--fs-12);
  color: var(--text-3);
  margin-top: 4px;
}
.form-error {
  font-size: var(--fs-13);
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #FECACA;
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin-bottom: var(--sp-4);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid.three {
  grid-template-columns: repeat(3, 1fr);
}
.form-grid > .form-group,
.form-grid > .form-row { margin-bottom: 0; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap > input {
  flex: 1;
}
.input-wrap > button,
.input-wrap > .input-suffix {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.input-wrap > button:hover { color: var(--text-1); background: var(--border-soft); }

/* — Password strength bar — */
.pwd-strength {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.pwd-strength > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--warning);
  border-radius: 2px;
  transition: width var(--t-base), background var(--t-base);
}
.pwd-strength.weak   > span { width: 33%; background: var(--danger); }
.pwd-strength.medium > span { width: 66%; background: var(--warning); }
.pwd-strength.strong > span { width: 100%; background: var(--success); }

/* — Checkbox / radio (custom subtil) — */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: #FFFFFF;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  transition: background var(--t-fast), border-color var(--t-fast);
  flex-shrink: 0;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--brand);
  border-color: var(--brand);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: #FFFFFF;
  border-radius: 50%;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 6  •  AUTH TABS  +  setup-box  +  test-bar
   ═══════════════════════════════════════════════════════════════════════════ */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--border-soft);
  border-radius: var(--r-lg);
  padding: 4px;
  margin-bottom: var(--sp-6);
}
.auth-tab,
.tab {
  padding: 10px;
  border: none;
  background: transparent;
  font-size: var(--fs-14);
  font-weight: var(--fw-500);
  color: var(--text-3);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--t-fast), color var(--t-fast);
}
.auth-tab:hover,
.tab:hover { color: var(--text-1); }
.auth-tab.active,
.tab.active {
  background: #FFFFFF;
  color: var(--brand);
  box-shadow: var(--shadow-xs);
}

/* form-panel (auth content swap) */
.form-panel { display: none; }
.form-panel.active { display: block; }

.auth-helper {
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border-soft);
  font-size: var(--fs-13);
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-helper a { color: var(--brand); }
.auth-helper p { margin: 0; display: flex; align-items: center; gap: 8px; }
.auth-helper i { color: var(--text-4); }

.setup-box {
  margin-top: var(--sp-4);
  padding: 16px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-strong);
  border-radius: var(--r-lg);
  font-size: var(--fs-13);
  color: var(--brand-dark);
}
.setup-box .btn-secondary { margin-top: 10px; }

.test-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: var(--warning-soft);
  border: 1px solid #FDE68A;
  border-radius: var(--r-md);
  font-size: var(--fs-12);
  color: var(--warning-dark);
  margin-bottom: var(--sp-4);
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 7  •  DIVIDER
   ═══════════════════════════════════════════════════════════════════════════ */
.divider-or {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--fs-12);
  color: var(--text-4);
  margin: 18px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.divider-or::before,
.divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: var(--sp-5) 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 8  •  CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-card);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-4);
  gap: 12px;
  flex-wrap: wrap;
}
.card-header h2,
.card-header .card-title {
  font-size: var(--fs-16);
  font-weight: var(--fw-500);
  color: var(--text-1);
  margin: 0;
}
.card-title {
  font-size: var(--fs-18);
  font-weight: var(--fw-500);
  color: var(--text-1);
  margin: 0 0 var(--sp-3) 0;
  letter-spacing: -0.01em;
}
.card-body { padding: 0; }
.card-footer {
  padding-top: var(--sp-4);
  margin-top: var(--sp-4);
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.card.card-flat { box-shadow: none; }
.card.card-bg-soft { background: var(--bg); }

/* — Stat card (KPI) — */
.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.stat-card .stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: var(--sp-2);
}
.stat-card .stat-label {
  font-size: var(--fs-11);
  font-weight: var(--fw-500);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-4);
}
.stat-card .stat-value {
  font-size: var(--fs-26);
  font-weight: var(--fw-500);
  color: var(--text-1);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.stat-card .stat-delta {
  font-size: var(--fs-12);
  color: var(--text-3);
  margin-top: 2px;
}
.stat-card .stat-delta.up   { color: var(--success); }
.stat-card .stat-delta.down { color: var(--danger); }

/* Variants couleurs (v1.5 compat) */
.stat-card.brand .stat-icon   { background: var(--brand-soft); color: var(--brand); }
.stat-card.success .stat-icon { background: var(--success-soft); color: var(--success-dark); }
.stat-card.warning .stat-icon { background: var(--warning-soft); color: var(--warning-dark); }
.stat-card.info .stat-icon    { background: var(--info-soft); color: var(--info-dark); }
.stat-card.danger .stat-icon  { background: var(--danger-soft); color: var(--danger-dark); }

/* Grilles de stats */
.stats-grid,
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: var(--sp-6);
}

/* — Compliance card (landing) — */
.compliance-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.compliance-card .compliance-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: var(--sp-4);
}

/* — Testimonial — */
.testimonial {
  background: var(--bg);
  border-radius: var(--r-xl);
  padding: 24px;
  margin-bottom: var(--sp-4);
}
.testimonial blockquote,
.testimonial .quote {
  font-style: italic;
  color: var(--text-2);
  margin: 0 0 var(--sp-4) 0;
  line-height: 1.55;
  font-size: var(--fs-15);
}
.testimonial .testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.testimonial .testimonial-author .testimonial-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: var(--fw-500);
  font-size: var(--fs-13);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* — Pricing card — */
.pricing-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  text-align: center;
  position: relative;
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.pricing-card:hover { box-shadow: var(--shadow-md); }
.pricing-card.featured {
  border: 2px solid var(--brand);
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}
.pricing-card .pricing-name {
  font-size: var(--fs-16);
  font-weight: var(--fw-500);
  color: var(--text-1);
  margin-bottom: var(--sp-2);
}
.pricing-card .pricing-price {
  font-size: var(--fs-36);
  font-weight: var(--fw-500);
  color: var(--text-1);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-2);
}
.pricing-card .pricing-price small {
  font-size: var(--fs-14);
  font-weight: var(--fw-400);
  color: var(--text-3);
}
.pricing-card ul {
  list-style: none;
  padding: 0;
  margin: var(--sp-5) 0;
  text-align: left;
}
.pricing-card ul li {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-14);
  color: var(--text-2);
}
.pricing-card ul li i { color: var(--success); }

/* — Formation card (v1.5 compat + redesign) — */
.formation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.formation-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  box-shadow: var(--shadow-card);
}
.formation-card:hover {
  border-color: var(--brand-soft-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.formation-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.formation-card-header h3,
.formation-card-header > div:first-child > strong {
  font-size: var(--fs-16);
  font-weight: var(--fw-500);
  color: var(--text-1);
  margin: 0;
  letter-spacing: -0.01em;
}
.formation-card-body {
  font-size: var(--fs-13);
  color: var(--text-3);
  line-height: 1.5;
  flex: 1;
}
.formation-card-meta {
  font-size: var(--fs-12);
  color: var(--text-4);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: var(--sp-2);
}
.formation-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--sp-3);
}

/* — Resume hero (apprenant) — */
.resume-hero {
  background: var(--gradient-brand-rev);
  color: #FFFFFF;
  border-radius: var(--r-xl);
  padding: 28px;
  margin-bottom: var(--sp-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.resume-hero h2 {
  font-size: var(--fs-22);
  color: #FFFFFF;
  font-weight: var(--fw-500);
  margin: 0 0 var(--sp-2) 0;
}
.resume-hero p {
  color: rgba(255,255,255,0.85);
  margin: 0;
  font-size: var(--fs-14);
  max-width: 540px;
  line-height: 1.55;
}
.resume-hero .btn { background: #FFFFFF; color: var(--brand-dark); border-color: #FFFFFF; }
.resume-hero .btn:hover { background: var(--bg); }


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 9  •  BADGES, PILLS, CHIPS
   ═══════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-11);
  font-weight: var(--fw-500);
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--border-soft);
  color: var(--text-2);
  line-height: 1.4;
  white-space: nowrap;
}
.badge-success,
.badge-green {
  background: var(--success-soft);
  color: var(--success-dark);
}
.badge-warning,
.badge-yellow,
.badge-orange {
  background: var(--warning-soft);
  color: var(--warning-dark);
}
.badge-danger,
.badge-red {
  background: var(--danger-soft);
  color: var(--danger-dark);
}
.badge-info,
.badge-blue {
  background: var(--info-soft);
  color: var(--info-dark);
}
.badge-neutral,
.badge-gray {
  background: var(--border-soft);
  color: var(--text-2);
}
.badge-brand {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.badge.large {
  font-size: var(--fs-12);
  padding: 5px 12px;
}

/* — Role pill (apprenant / formateur / admin) — */
.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-11);
  font-weight: var(--fw-500);
  letter-spacing: 0.02em;
  text-transform: capitalize;
  background: var(--border-soft);
  color: var(--text-2);
  white-space: nowrap;
}
.role-pill.role-admin,
.role-admin {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.role-pill.role-formateur,
.role-formateur {
  background: var(--warning-soft);
  color: var(--warning-dark);
}
.role-pill.role-apprenant,
.role-apprenant {
  background: var(--info-soft);
  color: var(--info-dark);
}

/* — Trust line (landing : "Conforme Qualiopi · Sécurisé · RGPD") — */
.trust-line {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: var(--fs-13);
  color: var(--text-4);
}
.trust-line span,
.trust-line li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.trust-line i {
  color: var(--success);
  font-size: 16px;
}

/* — Chip (filter) — */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--border-soft);
  color: var(--text-2);
  font-size: var(--fs-13);
  font-weight: var(--fw-500);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  border: 1px solid transparent;
}
.chip:hover { background: var(--border); }
.chip.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand-soft-strong);
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 10  •  TABLES
   ═══════════════════════════════════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: #FFFFFF;
}
.card .table-wrap {
  border: none;
  border-radius: 0;
  margin: 0 -24px -20px -24px;
  border-top: 1px solid var(--border);
}

table,
table.table {
  width: 100%;
  border-collapse: collapse;
  background: #FFFFFF;
}
thead th,
table th {
  font-size: var(--fs-11);
  color: var(--text-4);
  font-weight: var(--fw-500);
  padding: 12px 14px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  white-space: nowrap;
}
tbody td,
table td {
  padding: 14px;
  font-size: var(--fs-13);
  color: var(--text-1);
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td      { background: var(--hover-bg); }

.table-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* Status cells */
td .badge { margin-right: 4px; }


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 11  •  MODALS
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.open,
.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

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

.modal {
  background: #FFFFFF;
  border-radius: var(--r-xl);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: modalSlideIn 0.25s ease;
}
.modal.modal-sm    { max-width: 420px; }
.modal.modal-lg,
.modal.modal-wide  { max-width: 720px; }
.modal.modal-xl    { max-width: 960px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.modal-header h3,
.modal-header h2 {
  font-size: var(--fs-16);
  font-weight: var(--fw-500);
  color: var(--text-1);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-header i { color: var(--brand); font-size: 20px; }

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-3);
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast), color var(--t-fast);
}
.modal-close:hover { background: var(--border-soft); color: var(--text-1); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-soft);
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 12  •  STEPPER (Studio 6 étapes)
   ═══════════════════════════════════════════════════════════════════════════ */
.stepper,
.studio-steps {
  display: flex;
  gap: 8px;
  margin-bottom: var(--sp-6);
  overflow-x: auto;
  padding-bottom: 4px;
}
.step,
.studio-step {
  flex: 1;
  min-width: 110px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--border-soft);
  color: var(--text-3);
  font-size: var(--fs-13);
  font-weight: var(--fw-500);
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.step:hover,
.studio-step:hover {
  background: var(--border);
  color: var(--text-1);
}
.step.active,
.studio-step.active {
  background: var(--brand);
  color: #FFFFFF;
}
.step.done,
.studio-step.done {
  background: var(--success-soft);
  color: var(--success-dark);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  color: inherit;
  font-size: var(--fs-12);
  font-weight: var(--fw-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step.active .step-num,
.studio-step.active .step-num {
  background: rgba(255,255,255,0.25);
  color: #FFFFFF;
}
.step.done .step-num,
.studio-step.done .step-num {
  background: var(--success);
  color: #FFFFFF;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 13  •  PROGRESS BARS
   ═══════════════════════════════════════════════════════════════════════════ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-soft);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.progress-bar .fill,
.progress-bar .progress-fill,
.progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 3px;
  transition: width var(--t-slow);
  display: block;
}
.progress-bar.lg { height: 10px; }
.progress-bar.sm { height: 4px; }

/* Variants couleur du fill (v1.5 compat : .green, .orange, .red) */
.progress-fill.green,
.progress-bar .fill.success    { background: var(--success); }
.progress-fill.orange,
.progress-bar .fill.warning    { background: var(--warning); }
.progress-fill.red,
.progress-bar .fill.danger     { background: var(--danger); }
.progress-fill.brand,
.progress-bar .fill.brand      { background: var(--brand); }


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 14  •  LESSON READER (apprenant)
   ═══════════════════════════════════════════════════════════════════════════ */
.lesson-shell {
  display: flex;
  height: calc(100vh - var(--topbar-h));
  background: #F7F5F1;
}

/* — Outline gauche — */
.lesson-outline {
  width: 320px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.outline-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-soft);
}
.outline-header h3 {
  font-size: var(--fs-14);
  font-weight: var(--fw-500);
  color: var(--text-1);
  margin: 0 0 4px 0;
}
.outline-header .outline-meta {
  font-size: var(--fs-12);
  color: var(--text-3);
}
.outline-module {
  border-bottom: 1px solid var(--border-soft);
}
.outline-module-title {
  padding: 12px 22px;
  font-size: var(--fs-13);
  font-weight: var(--fw-500);
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
}
.outline-lessons {
  background: var(--bg-soft);
  padding: 4px 0;
}
.outline-lesson {
  padding: 10px 22px 10px 54px;
  font-size: var(--fs-13);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid transparent;
  transition: background var(--t-fast), color var(--t-fast);
}
.outline-lesson i {
  font-size: 14px;
  color: var(--text-4);
  flex-shrink: 0;
}
.outline-lesson:hover {
  background: var(--border-soft);
  color: var(--text-1);
}
.outline-lesson.current,
.outline-lesson.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: var(--fw-500);
  border-left-color: var(--brand);
}
.outline-lesson.current i,
.outline-lesson.active i { color: var(--brand); }
.outline-lesson.done i { color: var(--success); }
.outline-lesson.locked { color: var(--text-4); cursor: not-allowed; }
.outline-lesson.locked i { color: var(--text-4); }

/* — Main lesson content — */
.lesson-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #F7F5F1;
  min-width: 0;
}
.lesson-topbar {
  padding: 14px 32px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.lesson-body {
  padding: 32px;
  flex: 1;
}
.lesson-content,
.lecon-content {
  max-width: 780px;
  margin: 0 auto;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 44px 56px;
  box-shadow: var(--shadow-card);
}
.lesson-content h1,
.lecon-content h1 {
  font-size: var(--fs-26);
  font-weight: var(--fw-500);
  letter-spacing: -0.01em;
  margin: 0 0 var(--sp-3) 0;
}
.lesson-content h2,
.lecon-content h2 {
  font-size: var(--fs-22);
  font-weight: var(--fw-500);
  margin: var(--sp-9) 0 var(--sp-3) 0;
  letter-spacing: -0.01em;
}
.lesson-content h3,
.lecon-content h3 {
  font-size: var(--fs-17);
  font-weight: var(--fw-500);
  margin: var(--sp-6) 0 var(--sp-2) 0;
}
.lesson-content p,
.lecon-content p {
  color: var(--text-2);
  margin: 0 0 var(--sp-4) 0;
  line-height: 1.65;
  font-size: var(--fs-15);
}
.lesson-content ul,
.lesson-content ol,
.lecon-content ul,
.lecon-content ol {
  margin: 0 0 var(--sp-4) 0;
  padding-left: 24px;
}
.lesson-content li,
.lecon-content li {
  margin-bottom: 8px;
  color: var(--text-2);
  line-height: 1.6;
}
.lesson-content blockquote,
.lecon-content blockquote {
  border-left: 3px solid var(--brand);
  background: var(--bg);
  padding: 16px 20px;
  margin: var(--sp-4) 0;
  font-style: italic;
  color: var(--text-2);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.lesson-content img,
.lecon-content img {
  max-width: 100%;
  border-radius: var(--r-md);
  margin: var(--sp-4) 0;
}

.lesson-bottombar {
  background: #FFFFFF;
  border-top: 1px solid var(--border-soft);
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.lesson-meta-strip {
  display: flex;
  gap: 14px;
  font-size: var(--fs-12);
  color: var(--text-3);
  align-items: center;
  flex-wrap: wrap;
}
.lesson-meta-strip span { display: inline-flex; align-items: center; gap: 6px; }

/* Lecon back wrap (v1.5) */
.lecon-back-wrap {
  display: flex;
  align-items: center;
  margin-bottom: var(--sp-4);
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 15  •  HERO / LANDING
   ═══════════════════════════════════════════════════════════════════════════ */
.hero {
  padding: 64px 40px;
  background: var(--bg);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  max-width: var(--content-max);
  margin: 0 auto;
}
.hero h1 {
  font-size: var(--fs-50);
  font-weight: var(--fw-500);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: var(--sp-4) 0;
  color: var(--text-1);
}
.hero h1 .accent { color: var(--brand); }
.hero p.sub,
.hero .hero-sub {
  font-size: var(--fs-17);
  color: var(--text-3);
  line-height: 1.55;
  max-width: 540px;
  margin: 0 0 var(--sp-7) 0;
}
.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: var(--sp-7);
}

.studio-demo {
  background: #FFFFFF;
  border-radius: var(--r-2xl);
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: var(--shadow-card);
}
.studio-demo header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border-soft);
}

/* Landing section (cards row) */
.section {
  padding: 64px 40px;
  max-width: var(--content-max);
  margin: 0 auto;
}
.section-head {
  text-align: center;
  margin-bottom: var(--sp-9);
}
.section-head h2 {
  font-size: var(--fs-36);
  font-weight: var(--fw-500);
  letter-spacing: -0.01em;
}
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 16  •  QUIZ (apprenant + résultats)
   ═══════════════════════════════════════════════════════════════════════════ */
.quiz-question {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  margin-bottom: var(--sp-4);
}
.quiz-question h3 {
  font-size: var(--fs-16);
  font-weight: var(--fw-500);
  margin: 0 0 var(--sp-4) 0;
  color: var(--text-1);
}
.quiz-question .quiz-label {
  font-size: var(--fs-11);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
  font-weight: var(--fw-500);
  margin-bottom: var(--sp-2);
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: #FFFFFF;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  font-size: var(--fs-14);
  color: var(--text-2);
}
.quiz-option:hover {
  background: var(--hover-bg);
  border-color: var(--text-4);
}
.quiz-option input[type="radio"] {
  margin: 0;
  flex-shrink: 0;
}
.quiz-option.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.quiz-option.correct {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success-dark);
}
.quiz-option.incorrect {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger-dark);
}

/* Quiz result */
.quiz-result-card,
.quiz-result-banner {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  text-align: center;
  margin-bottom: var(--sp-4);
}
.quiz-result-banner.success,
.quiz-result-banner.pass {
  background: var(--success-soft);
  border-color: #BBF7D0;
  color: var(--success-dark);
}
.quiz-result-banner.danger,
.quiz-result-banner.fail {
  background: var(--danger-soft);
  border-color: #FECACA;
  color: var(--danger-dark);
}
.quiz-result-card .score,
.quiz-result-banner .score {
  font-size: var(--fs-36);
  font-weight: var(--fw-500);
  color: var(--brand);
  letter-spacing: -0.02em;
  display: block;
  margin-bottom: var(--sp-2);
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 17  •  SIGNATURE CANVAS
   ═══════════════════════════════════════════════════════════════════════════ */
#sig-canvas,
.signature-canvas {
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  width: 100%;
  height: 180px;
  touch-action: none;
  background: var(--bg-soft);
  cursor: crosshair;
  display: block;
}
.signature-actions {
  display: flex;
  gap: 8px;
  margin-top: var(--sp-3);
  justify-content: flex-end;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 18  •  TOAST
   ═══════════════════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: var(--text-1);
  color: #FFFFFF;
  border-radius: var(--r-md);
  font-size: var(--fs-13);
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: transform var(--t-slow), opacity var(--t-slow);
  z-index: 2000;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success { background: var(--success); }
.toast.error,
.toast.danger  { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--warning-dark); }
.toast.info    { background: var(--info); }


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 19  •  STUDIO (panneaux, layout, chapter/story cards, WYSIWYG)
   ═══════════════════════════════════════════════════════════════════════════ */

/* — Layout : panneau principal + aside latéral — */
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: flex-start;
}
.studio-panel { min-width: 0; }
.studio-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 92px;
}

/* — Panes (chaque étape) — */
.studio-pane { display: none; }
.studio-pane.active { display: block; }

/* — Toolbar interne (chapters/storyboard) — */
.studio-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-4);
}

/* — Footer actions de chaque étape (Next / Prev) — */
.studio-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

/* — Checklist (aside) — */
.studio-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.studio-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--bg-soft);
  font-size: var(--fs-13);
  color: var(--text-2);
}
.studio-checklist li.done {
  background: var(--success-soft);
  color: var(--success-dark);
}
.studio-checklist li.done i {
  color: var(--success);
}
.studio-checklist li i {
  color: var(--text-4);
  font-size: 16px;
}

/* — KPI mini (aside) — */
.studio-kpi {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bg-soft);
  font-size: var(--fs-13);
  color: var(--text-2);
}
.studio-kpi strong {
  font-size: var(--fs-18);
  color: var(--brand);
  font-weight: var(--fw-500);
}

/* — Chapters (étape 2) — */
.studio-chapters {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.studio-chapter-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.studio-chapter-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--sp-3);
}
.studio-chapter-head > span:first-child {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #FFFFFF;
  font-size: var(--fs-13);
  font-weight: var(--fw-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.studio-chapter-head input {
  flex: 1;
  border: 1px solid transparent;
  background: transparent;
  font-size: var(--fs-15);
  font-weight: var(--fw-500);
  color: var(--text-1);
  padding: 6px 10px;
  border-radius: var(--r-md);
}
.studio-chapter-head input:hover { border-color: var(--border); }
.studio-chapter-head input:focus { border-color: var(--brand); background: #FFFFFF; }

/* — Storyboard (étape 3) — */
.studio-story-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-card);
}
.studio-story-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-soft);
}
.studio-story-head h3 {
  font-size: var(--fs-15);
  font-weight: var(--fw-500);
  margin: 0;
}

.story-screen-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.story-screen {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.story-screen-edit {
  flex-direction: row;
  cursor: grab;
}
.story-screen-edit:active { cursor: grabbing; }
.story-screen-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.story-editor-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.story-editor-row > input,
.story-editor-row > select {
  flex: 1;
  min-width: 140px;
}

.story-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

/* — WYSIWYG — */
.wysiwyg-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #FFFFFF;
  overflow: hidden;
}
.wysiwyg-wrap summary {
  padding: 8px 12px;
  font-size: var(--fs-13);
  color: var(--text-3);
  cursor: pointer;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-soft);
}
.wysiwyg-wrap summary:hover { color: var(--text-1); }
.wysiwyg-toolbar {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
  background: #FFFFFF;
}
.wysiwyg-toolbar button {
  padding: 6px 10px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r-sm);
  font-size: var(--fs-13);
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.wysiwyg-toolbar button:hover {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--text-1);
}
.wysiwyg-editor {
  min-height: 120px;
  padding: 12px;
  font-size: var(--fs-14);
  line-height: 1.55;
  color: var(--text-1);
  outline: none;
}
.wysiwyg-editor:focus { background: var(--bg-soft); }
.wysiwyg-editor h2 { font-size: var(--fs-18); margin: var(--sp-3) 0 var(--sp-2); }
.wysiwyg-editor p  { margin: 0 0 var(--sp-2); color: var(--text-2); }

.html-source {
  width: 100%;
  min-height: 100px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: var(--fs-12);
  background: var(--bg-soft);
  color: var(--text-2);
  resize: vertical;
}

/* — Callout (encadré pédagogique) — */
.callout {
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  padding: 14px 18px;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: var(--sp-4) 0;
  font-size: var(--fs-14);
  color: var(--brand-dark);
  line-height: 1.55;
}
.callout strong { color: var(--brand-dark); }

/* — Activities bank (étape 4) — */
.activity-bank-panel {
  display: block;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: var(--sp-4);
}
.activity-bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: var(--sp-3);
}
.activity-bank-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--fs-13);
}
.activity-bank-card strong {
  color: var(--text-1);
  font-size: var(--fs-13);
  font-weight: var(--fw-500);
}
.activity-bank-card small { color: var(--text-3); font-size: var(--fs-12); }
.activity-bank-card select { font-size: var(--fs-12); padding: 6px 10px; }

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: var(--sp-3);
}

/* — Quality grid (Qualiopi) — */
.quality-grid {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  background: var(--bg-soft);
  margin-top: var(--sp-3);
}
.quality-grid summary {
  font-size: var(--fs-13);
  font-weight: var(--fw-500);
  color: var(--text-2);
  cursor: pointer;
  padding: 4px 0;
}
.quality-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--sp-3);
  background: #FFFFFF;
  border-radius: var(--r-md);
  overflow: hidden;
  font-size: var(--fs-12);
}
.quality-table th,
.quality-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
}
.quality-table tr:last-child td { border-bottom: none; }

/* — Quiz editor (étape 4) — */
.quiz-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quiz-edit-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
}
.quiz-edit-card > input[type="text"] {
  margin-bottom: var(--sp-2);
  font-weight: var(--fw-500);
}
.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: var(--sp-2);
}

/* — Learner preview (étape 5) — */
.learner-preview {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.learner-preview-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: var(--fs-13);
  border-bottom: 1px solid var(--brand-soft-strong);
}
.learner-preview-top span { font-size: var(--fs-12); opacity: 0.85; }

.preview-screen {
  padding: 24px;
  border-bottom: 1px solid var(--border-soft);
}
.preview-screen:last-child { border-bottom: none; }
.preview-screen-num {
  font-size: var(--fs-11);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-4);
  font-weight: var(--fw-500);
  margin-bottom: var(--sp-2);
}
.preview-screen h3 {
  font-size: var(--fs-16);
  font-weight: var(--fw-500);
  margin-bottom: var(--sp-2);
}

/* — Studio success (étape 6) — */
.studio-success {
  background: var(--success-soft) !important;
  border-color: #BBF7D0 !important;
  color: var(--success-dark);
}
.studio-success strong { color: var(--success-dark); }

/* — PPT slide rendering — */
.ppt-layout {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  margin: var(--sp-4) 0;
  position: relative;
}
.ppt-slide-badge {
  position: absolute;
  top: -10px;
  left: 16px;
  background: var(--brand);
  color: #FFFFFF;
  font-size: var(--fs-11);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-weight: var(--fw-500);
}
.ppt-content {
  margin-top: var(--sp-3);
}
.ppt-text-block {
  font-size: var(--fs-14);
  color: var(--text-2);
  line-height: 1.55;
  margin: 0 0 var(--sp-2);
}
.ppt-image {
  margin: var(--sp-3) 0;
  text-align: center;
}
.ppt-image img {
  max-width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
}
.ppt-image figcaption {
  font-size: var(--fs-12);
  color: var(--text-4);
  margin-top: 4px;
  font-style: italic;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 19b  •  EMPTY STATES
   ═══════════════════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: var(--sp-9) var(--sp-5);
  color: var(--text-3);
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  font-size: var(--fs-14);
}
.empty-state i {
  font-size: 36px;
  color: var(--text-4);
  margin-bottom: var(--sp-3);
}
.empty-state h3 {
  font-size: var(--fs-16);
  color: var(--text-2);
  margin-bottom: var(--sp-2);
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 19c  •  PRESENCE / SIGNATURE / CERT / BPF (v1.5 compat)
   ═══════════════════════════════════════════════════════════════════════════ */
.presence-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: var(--sp-4);
}
.presence-date-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.presence-date-wrap input { flex: 1; }

.presence-cell {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  background: var(--border-soft);
  color: var(--text-4);
  border: 1px solid var(--border);
  transition: background var(--t-fast), color var(--t-fast);
  user-select: none;
  margin: 2px;
}
.presence-cell:hover { border-color: var(--text-4); }
.presence-cell.present {
  background: var(--success-soft);
  color: var(--success-dark);
  border-color: #BBF7D0;
}
.presence-cell.absent {
  background: var(--danger-soft);
  color: var(--danger-dark);
  border-color: #FECACA;
}
.presence-cell.unset {
  background: var(--border-soft);
  color: var(--text-4);
}

.sign-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-md);
  background: var(--bg-soft);
  cursor: pointer;
  margin-left: 4px;
  border: 1px solid var(--border);
  font-size: 14px;
  transition: background var(--t-fast);
}
.sign-btn:hover { background: var(--brand-soft); border-color: var(--brand-soft-strong); }
.sign-btn.signed {
  background: var(--success-soft);
  border-color: #BBF7D0;
  color: var(--success-dark);
}

.cert-row,
.bpf-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: var(--fs-13);
  color: var(--text-2);
}
.cert-row:last-child,
.bpf-row:last-child { border-bottom: none; }
.cert-row:hover,
.bpf-row:hover { background: var(--hover-bg); }


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 20  •  UTILITIES (flex, spacing, text helpers)
   ═══════════════════════════════════════════════════════════════════════════ */

/* — Display — */
.hidden     { display: none !important; }
.block      { display: block; }
.inline     { display: inline; }
.inline-block { display: inline-block; }
.flex       { display: flex; }
.flex-col   { display: flex; flex-direction: column; }
.flex-row   { display: flex; flex-direction: row; }
.grid       { display: grid; }
.inline-flex { display: inline-flex; }

/* — Align / Justify — */
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.flex-wrap   { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1      { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* — Gap — */
.gap-2  { gap: 2px; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

/* — Margin bottom / top — */
.mb-2  { margin-bottom: 2px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-40 { margin-bottom: 40px; }

.mt-2  { margin-top: 2px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }

.mx-auto { margin-left: auto; margin-right: auto; }

/* — Padding — */
.p-0  { padding: 0; }
.p-8  { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }

/* — Width / Height — */
.w-100  { width: 100%; }
.w-auto { width: auto; }
.h-100  { height: 100%; }
.full   { width: 100%; height: 100%; }

/* — Text — */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.fs-11 { font-size: var(--fs-11); }
.fs-12 { font-size: var(--fs-12); }
.fs-13 { font-size: var(--fs-13); }
.fs-14 { font-size: var(--fs-14); }
.fs-15 { font-size: var(--fs-15); }
.fs-16 { font-size: var(--fs-16); }
.fs-18 { font-size: var(--fs-18); }
.fs-22 { font-size: var(--fs-22); }
.fs-26 { font-size: var(--fs-26); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

.color-text-1 { color: var(--text-1); }
.color-text-2 { color: var(--text-2); }
.color-text-3 { color: var(--text-3); }
.color-text-4 { color: var(--text-4); }
.color-brand  { color: var(--brand); }

.uppercase { text-transform: uppercase; letter-spacing: 0.04em; }
.italic    { font-style: italic; }
.truncate  {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* — Borders & radius helpers — */
.rounded    { border-radius: var(--r-md); }
.rounded-lg { border-radius: var(--r-lg); }
.rounded-xl { border-radius: var(--r-xl); }
.rounded-full { border-radius: var(--r-pill); }

.bordered { border: 1px solid var(--border); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* — Cursors — */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* — Misc — */
.no-select { user-select: none; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky   { position: sticky; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 20b  •  COMPLEMENTS — classes ajoutees par les agents JS
   ═══════════════════════════════════════════════════════════════════════════ */

/* — Alias utility — */
.text-uppercase { text-transform: uppercase; letter-spacing: 0.04em; }

/* — User cell (tables users / presences) — */
.user-cell {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-12);
  font-weight: 500;
  flex-shrink: 0;
}

/* — KPI larges (dashboard admin) — */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}
.kpi-large {
  padding: var(--sp-5) var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

/* — Certificats grid (apprenant) — */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}
.cert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  text-align: center;
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.cert-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.cert-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: var(--sp-3);
}
.cert-card h3 {
  font-size: var(--fs-16);
  font-weight: 500;
  margin: var(--sp-2) 0 var(--sp-1);
}

/* — Lesson list (formation detail) — */
.module-card {
  margin-bottom: var(--sp-4);
}
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-soft);
  border-radius: var(--r-md);
  overflow: hidden;
}
.lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  cursor: pointer;
  transition: background var(--t-fast);
}
.lesson-row:hover {
  background: var(--hover-bg);
}
.lesson-row-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.lesson-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.lesson-row-title {
  font-weight: 500;
  font-size: var(--fs-14);
  color: var(--text-1);
}

/* — Formation overview (page detail apprenant) — */
.formation-overview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6) var(--sp-7);
  margin-bottom: var(--sp-5);
}
.formation-overview h1 {
  font-size: var(--fs-26);
  font-weight: 500;
  margin: var(--sp-2) 0 var(--sp-3);
  letter-spacing: -0.01em;
}
.formation-overview p {
  color: var(--text-3);
  margin-bottom: var(--sp-3);
}
.formation-progress {
  margin: var(--sp-3) 0;
}
.formation-price {
  font-size: var(--fs-18);
  font-weight: 500;
  color: var(--brand);
}

/* — Resume hero (eyebrow lumineux sur fond brique) — */
.eyebrow-light {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.95);
}
.resume-hero-content {
  flex: 1;
}
.resume-progress {
  margin-top: var(--sp-3);
  max-width: 420px;
}
.resume-progress .progress-bar {
  background: rgba(255, 255, 255, 0.18);
}
.resume-progress .progress-bar .fill {
  background: #fff;
}

/* — Quality card variant — */
.quality-card {
  padding: var(--sp-5);
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 21  •  RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

/* — < 1100px : aside studio passe sous le main — */
@media (max-width: 1100px) {
  .studio-layout {
    grid-template-columns: 1fr;
  }
  .studio-aside {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .studio-aside > .card {
    flex: 1;
    min-width: 280px;
  }
  .hero {
    padding: 48px 24px;
  }
}

/* — < 900px : auth stack, hero stack — */
@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .brand-panel {
    padding: 32px 24px;
  }
  .brand-content h1 { font-size: 32px; }
  .auth-panel {
    padding: 32px 24px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }
  .presence-filters {
    grid-template-columns: 1fr;
  }
}

/* — < 768px : sidebar drawer, content compact — */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform var(--t-base);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main,
  .app-main {
    margin-left: 0;
  }
  .topbar {
    padding: 10px 16px;
  }
  .content {
    padding: 16px;
  }
  .stats-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .modal {
    max-width: 96vw;
  }
  .modal-body,
  .modal-header,
  .modal-footer { padding-left: 16px; padding-right: 16px; }
  .lesson-shell {
    flex-direction: column;
    height: auto;
  }
  .lesson-outline {
    width: 100%;
    max-height: 240px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .lesson-content,
  .lecon-content { padding: 28px 22px; }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .activity-bank-grid {
    grid-template-columns: 1fr;
  }
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }
  .formation-grid {
    grid-template-columns: 1fr;
  }
  .card { padding: 16px 18px; }
  .card .table-wrap { margin: 0 -18px -16px -18px; }
  .stepper,
  .studio-steps {
    padding-bottom: 8px;
  }
  .step,
  .studio-step {
    font-size: var(--fs-12);
    padding: 10px 12px;
    min-width: 90px;
  }
}

/* — < 480px : très compact — */
@media (max-width: 480px) {
  body { font-size: var(--fs-13); }
  .hero h1 { font-size: var(--fs-36); }
  .hero p.sub { font-size: var(--fs-15); }
  .brand-content h1 { font-size: 26px; }
  .brand-content p  { font-size: var(--fs-14); }
  .brand-panel { padding: 24px 18px; }
  .auth-panel  { padding: 24px 18px; }
  .section { padding: 40px 18px; }
  .page-title { font-size: var(--fs-22); }
  .resume-hero { padding: 20px; }
  .resume-hero h2 { font-size: var(--fs-18); }
  .modal-header h3 { font-size: var(--fs-15); }
  .btn-primary,
  .btn-secondary,
  .btn-outline { padding: 10px 14px; font-size: var(--fs-13); }
  .stat-card .stat-value { font-size: var(--fs-22); }
  .topbar { height: auto; padding: 8px 12px; flex-wrap: wrap; gap: 8px; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 22  •  PRINT
   ═══════════════════════════════════════════════════════════════════════════ */
@media print {
  .sidebar,
  .topbar,
  .modal-overlay,
  .toast,
  .studio-actions,
  .lesson-topbar,
  .lesson-bottombar,
  .btn,
  .btn-primary,
  .btn-secondary { display: none !important; }
  body { background: #FFFFFF; color: #000; }
  .content { padding: 0; }
  .card {
    box-shadow: none;
    border: 1px solid #CCC;
    page-break-inside: avoid;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   FIN  •  Formateur Pro v1.7 — style.css
   ═══════════════════════════════════════════════════════════════════════════ */
