/* =====================================================================
   BAD - Bâtir l'Administration de Demain
   Design System : Fluent Design (Microsoft) 
   ===================================================================== */
:root {
  /* Couleurs principales */
  --navy: #0B2545;
  --navy-soft: #173A66;
  --blue: #1B4F9C;
  --accent: #E8890C;
  --accent-dark: #9C5300;          /* corrigé : contraste AA (5:1) sur fonds clairs */
  --accent-soft: #FDF0DC;
  --ink: #1A1D23;
  --body: #434B57;
  --muted: #5B6574;                /* corrigé : contraste AA sur --bg-alt */
  --line: #EBEDF1;
  --line-strong: #D3D8E0;
  --control-border: #8B95A5;       /* nouveau : bordure de champ (contraste 3:1, WCAG 1.4.11) */
  --surface: #FFFFFF;
  --bg: #FBFAF7;
  --bg-alt: #F3F1EB;
  --bg-soft: #F7F6F1;
  --tint: #EAEFF6;
  --gold-300: #F2C879;
  --gold-500: #B8860B;
  --green-600: #2E7D5B;
  --red-600: #B3261E;

  /* Alias (fusionnés ici : le :root était déclaré deux fois) */
  --gold: var(--gold-500);
  --gold-2: var(--gold-300);
  --gold2: var(--gold-300);
  --green: var(--green-600);
  --amber: var(--accent-dark);
  --navy-2: var(--navy-soft);
  --navy-3: var(--blue);

  /* Rayons */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Ombres */
  --shadow-sm: 0 1px 2px rgba(11,37,69,.04), 0 0 0 1px rgba(11,37,69,.04);
  --shadow-md: 0 4px 8px rgba(11,37,69,.06), 0 2px 4px rgba(11,37,69,.04), 0 0 0 1px rgba(11,37,69,.04);
  --shadow-lg: 0 12px 24px rgba(11,37,69,.10), 0 4px 8px rgba(11,37,69,.06), 0 0 0 1px rgba(11,37,69,.04);
  --shadow-xl: 0 24px 48px rgba(11,37,69,.14), 0 8px 16px rgba(11,37,69,.08);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(.4,0,.2,1);
  --transition-normal: 200ms cubic-bezier(.4,0,.2,1);
  --transition-slow: 300ms cubic-bezier(.4,0,.2,1);

  /* Dimensions */
  --nav-h: 68px;
  --dash-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --nav-total: calc(var(--nav-h) + var(--safe-top));
  --dash-total: calc(var(--dash-h) + var(--safe-top));

  /* Typographie — corrigé : pile identique sur tous les OS (avant : Segoe UI
     sur Windows mais Georgia sur Mac/Android, titres incohérents) */
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1160px;
  color-scheme: light;
}

/* =====================================================================
   RESET & BASE
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-total) + 24px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
html:has(.dash-top) { scroll-padding-top: calc(var(--dash-total) + 24px); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.nav-open { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; color: var(--navy); font-weight: 700; line-height: 1.2; overflow-wrap: break-word; }
h1, h2 { font-family: var(--font-display); letter-spacing: -.01em; }
h3, h4 { font-weight: 650; }
p { margin: 0; overflow-wrap: break-word; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--blue); text-decoration: none; transition: color var(--transition-fast); }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
img, video, iframe, canvas { max-width: 100%; }
img, video { height: auto; }
input, select, textarea { max-width: 100%; min-width: 0; }
pre, code, kbd { max-width: 100%; }
pre { overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
svg { display: block; }

/* Focus visible — corrigé : plus de border-radius forcé (déformait les boutons ronds) */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* Sur fonds sombres : contraste suffisant */
.nav :focus-visible, .bd-header :focus-visible, .nav-drawer :focus-visible,
.bd-hero :focus-visible, .bd-quote :focus-visible, .cta :focus-visible,
.footer :focus-visible, .bd-footer :focus-visible, .auth-aside :focus-visible,
.dash-top :focus-visible { outline-color: var(--gold-300); }

.container, .bd-container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 max(24px, var(--safe-right)) 0 max(24px, var(--safe-left));
}

.icon { width: 18px; height: 18px; flex: none; }
.icon-xs { width: 14px; height: 14px; }
.icon-lg { width: 24px; height: 24px; }

.skip-link {
  position: absolute; left: 20px; top: -72px; z-index: 210;
  background: var(--navy); color: #fff; padding: 10px 18px;
  font-weight: 600; border-radius: var(--radius-sm);
  transition: top var(--transition-normal);
}
.skip-link:focus { top: calc(var(--safe-top) + 8px); text-decoration: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* Scrollbar — corrigé : le standard écrasait ::-webkit-scrollbar dans Chrome */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong); border: 2px solid transparent;
  background-clip: content-box; border-radius: 6px;
  transition: background var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover { background: var(--navy); background-clip: content-box; }

/* =====================================================================
   NAVIGATION
   ===================================================================== */
.nav, .bd-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100; background: var(--navy);
  padding-top: var(--safe-top);              /* corrigé : .bd-header ignorait l'encoche */
  transition: box-shadow var(--transition-normal);
}
.nav { height: var(--nav-total); }
.bd-header {
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(11, 37, 69, .95);
}

.nav-inner, .bd-header-inner {
  height: 100%; display: flex; align-items: center; gap: 28px;
  padding: 0 max(24px, var(--safe-right)) 0 max(24px, var(--safe-left));
  max-width: var(--max); margin: 0 auto;
}
.bd-header-inner { justify-content: space-between; height: var(--nav-h); }

.brand, .bd-brand {
  display: flex; align-items: center; gap: 12px; color: #fff;
  min-width: 0; text-decoration: none; font-weight: 800; font-size: 20px;
  transition: opacity var(--transition-fast);
}
.brand:hover, .bd-brand:hover { text-decoration: none; opacity: .9; }

.brand-mark, .bd-brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  background: var(--accent); color: var(--navy); font-weight: 800;
  font-size: 16px; border-radius: var(--radius); letter-spacing: -1px;
  transition: transform var(--transition-fast);
}
.brand:hover .brand-mark, .bd-brand:hover .bd-brand-mark { transform: scale(1.05); }
.brand-mark span, .bd-brand-mark span { font-weight: 900; }
.brand-mark-lg { width: 48px; height: 48px; font-size: 17px; border-radius: 12px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-weight: 800; letter-spacing: 1px; font-size: 16px; color: #fff; }
.brand-baseline { font-size: 12px; color: #B7C6DA; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bd-brand-logo { height: 42px; width: auto; border-radius: var(--radius-sm); }

.nav-links, .bd-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.bd-nav { gap: 24px; }

.nav-link, .bd-nav a {
  padding: 8px 14px; color: #C9D4E3; font-size: 15px; font-weight: 500;
  border-radius: var(--radius); white-space: nowrap; text-decoration: none;
  transition: color var(--transition-fast), background var(--transition-fast);
  position: relative;
}
.nav-link:hover, .bd-nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav-link.is-active, .nav-link[aria-current="page"],
.bd-nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.14); }

.nav-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.nav-toggle, .bd-burger {
  display: none; width: 44px; height: 44px; background: rgba(255,255,255,.1);
  border: 0; border-radius: var(--radius); flex-direction: column; justify-content: center;
  align-items: center; gap: 5px; cursor: pointer; flex: none; color: #fff; padding: 8px;
  transition: background var(--transition-fast);
}
.nav-toggle:hover, .bd-burger:hover { background: rgba(255,255,255,.18); }
.nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #fff; transition: transform var(--transition-fast), opacity var(--transition-fast); }
/* nouveau : retour visuel burger → croix à l'ouverture */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.bd-burger svg { width: 28px; height: 28px; }

.nav-drawer {
  position: fixed; top: var(--nav-total); left: 0; right: 0; z-index: 99;
  background: var(--navy); padding: 8px max(28px, var(--safe-right)) calc(22px + var(--safe-bottom)) max(28px, var(--safe-left));
  max-height: calc(100vh - var(--nav-total));
  max-height: calc(100dvh - var(--nav-total));
  overflow-y: auto; overscroll-behavior: contain;
  box-shadow: var(--shadow-lg);
}
.drawer-link {
  display: block; padding: 15px 0; color: #DCE4EF; font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,.08); text-decoration: none;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}
.drawer-link:hover { color: #fff; text-decoration: none; padding-left: 8px; }

/* Menu déroulant authentification */
.bd-auth-menu { position: relative; }
.bd-auth-trigger {
  display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1);
  border: 0; border-radius: var(--radius); padding: 8px 14px; min-height: 44px; color: #fff;
  cursor: pointer; font-size: 14px; font-weight: 600; list-style: none;
  transition: background var(--transition-fast);
}
.bd-auth-trigger:hover { background: rgba(255,255,255,.2); }
.bd-auth-trigger::-webkit-details-marker { display: none; }
.bd-auth-avatar svg, .bd-auth-chevron svg { width: 18px; height: 18px; }

.bd-auth-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  min-width: 220px; max-width: calc(100vw - 32px);
  padding: 8px; z-index: 110; border: 1px solid var(--line);
  animation: dropdown-in 200ms cubic-bezier(.4,0,.2,1);
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-8px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.bd-auth-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 44px;
  color: var(--body); text-decoration: none; font-size: 14.5px; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.bd-auth-item:hover { background: var(--bg-alt); color: var(--navy); transform: translateX(2px); text-decoration: none; }
.bd-auth-item-gold { color: var(--accent-dark); font-weight: 700; }
.bd-auth-item-gold:hover { background: var(--accent-soft); }
.bd-auth-item-icon svg { width: 18px; height: 18px; }

/* =====================================================================
   BOUTONS — refonte par variables : les états hover/tactile ne s'écrasent
   plus entre variantes (bug : sur mobile, .btn-green devenait bleu marine)
   ===================================================================== */
.btn, .bd-btn {
  --b-bg: var(--navy);       --b-fg: #fff;        --b-bd: transparent;
  --b-bg-h: var(--navy-soft); --b-fg-h: #fff;      --b-bd-h: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px; min-height: 44px; font-size: 15px; font-weight: 650; line-height: 1.3;
  text-align: center; border: 2px solid var(--b-bd); border-radius: var(--radius);
  background: var(--b-bg); color: var(--b-fg); cursor: pointer;
  /* corrigé : plus de « transition: all » (coûteux, anime des propriétés non voulues) */
  transition: background-color var(--transition-normal), color var(--transition-normal),
              border-color var(--transition-normal), transform var(--transition-normal),
              box-shadow var(--transition-normal);
  -webkit-appearance: none; appearance: none; touch-action: manipulation;
  text-decoration: none; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.btn:hover, .bd-btn:hover {
  background: var(--b-bg-h); color: var(--b-fg-h); border-color: var(--b-bd-h);
  text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md);
}
.btn:active, .bd-btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"], .bd-btn:disabled, .bd-btn[aria-disabled="true"] {
  opacity: .55; cursor: not-allowed; pointer-events: none; transform: none; box-shadow: none;
}

.btn-secondary, .btn-gray { --b-bg: var(--tint); --b-fg: var(--navy); --b-bg-h: #DCE4EF; --b-fg-h: var(--navy); }
.btn-light { --b-bg: #fff; --b-fg: var(--navy); --b-bg-h: #EEF2F7; --b-fg-h: var(--navy); }
.btn-outline-light { --b-bg: rgba(255,255,255,.12); --b-bg-h: rgba(255,255,255,.2); }
.btn-green { --b-bg: var(--green-600); --b-bg-h: #256A4C; }

/* corrigé : texte marine sur orange (contraste 5,7:1 au lieu de 2,7:1 en blanc) */
.bd-btn-gold {
  --b-bg: var(--accent); --b-fg: var(--navy); --b-bd: var(--accent);
  --b-bg-h: var(--accent-dark); --b-fg-h: #fff; --b-bd-h: var(--accent-dark);
  box-shadow: 0 2px 8px rgba(232,137,12,.25);
}
.bd-btn-gold:hover { box-shadow: 0 6px 16px rgba(232,137,12,.35); transform: translateY(-2px); }

.bd-btn-ghost {
  --b-bg: transparent; --b-fg: var(--navy); --b-bd: var(--control-border);
  --b-bg-h: var(--navy); --b-fg-h: #fff; --b-bd-h: var(--navy);
}

.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-block { width: 100%; }

/* =====================================================================
   HERO
   ===================================================================== */
.hero { padding: calc(var(--nav-total) + 80px) 0 80px; background: var(--bg); }

.bd-hero {
  position: relative;
  text-align: center;                         /* corrigé : contenu centré (marges auto sans text-align) */
  padding: calc(var(--nav-total) + 80px) 0 100px;   /* corrigé : encoche prise en compte */
  background-color: var(--navy);              /* corrigé : repli si l'image manque (texte blanc lisible) */
  background-image:
    linear-gradient(135deg, rgba(11,37,69,.88) 0%, rgba(27,79,156,.78) 100%),
    url('/assets/images/IMBADCI.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.bd-hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(232,137,12,.08) 0%, transparent 50%);
  pointer-events: none; z-index: 0;
}
.bd-hero > .bd-container { position: relative; z-index: 1; }

.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 64px; align-items: start; }
.hero-grid > * { min-width: 0; }

.eyebrow, .bd-eyebrow {
  display: inline-block; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent-dark); font-weight: 800; margin-bottom: 12px;
  background: var(--accent-soft); padding: 6px 14px; border-radius: 99px;
}
.bd-hero .bd-eyebrow { background: rgba(255,255,255,.12); color: var(--gold-300); backdrop-filter: blur(10px); }

.hero-title { font-size: clamp(34px, 4.8vw, 58px); line-height: 1.1; margin-bottom: 22px; max-width: 17ch; }
.bd-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 5.5vw, 64px);
  line-height: 1.08; color: #fff; margin: 0 auto 24px; max-width: 20ch;
  text-shadow: 0 2px 24px rgba(0,0,0,.25); letter-spacing: -.02em;
}
.bd-hero h1 em { font-style: normal; color: var(--gold-300); text-shadow: 0 2px 24px rgba(242,200,121,.3); }

.hero-lead { font-size: clamp(16.5px, 1.6vw, 18.5px); color: var(--body); max-width: 56ch; margin-bottom: 32px; }
/* corrigé : .bd-lead n'était blanc qu'en hero ; ailleurs il était invisible (blanc sur clair) */
.bd-lead { font-size: clamp(17px, 1.8vw, 20px); color: var(--body); max-width: 62ch; margin: 0 auto 48px; line-height: 1.6; }
.bd-hero > .bd-container > p, .bd-hero .bd-lead {
  color: rgba(255,255,255,.92); max-width: 62ch; margin: 0 auto 40px;
  font-size: clamp(17px, 1.8vw, 20px); line-height: 1.6; text-shadow: 0 1px 8px rgba(0,0,0,.15);
}

/* corrigé : le centrage ne s'appliquait qu'à .bd-hero ; .hero reste aligné à gauche */
.hero-actions, .bd-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 44px; }
.bd-hero-cta { margin-bottom: 48px; justify-content: center; }
.hero-stats, .bd-hero-stats { display: flex; flex-wrap: wrap; gap: 20px 48px; margin: 0; }
.bd-hero-stats { justify-content: center; }

/* corrigé : stats blanches sur .hero clair = invisibles → couleurs par contexte */
.hero-stat-value { font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--navy); line-height: 1; }
.hero-stat-label { margin: 8px 0 0; font-size: 14px; color: var(--muted); max-width: 16ch; font-weight: 500; }
.bd-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bd-stat b { font-family: var(--font-display); font-size: 40px; font-weight: 800; color: #fff; line-height: 1; text-shadow: 0 2px 12px rgba(0,0,0,.2); }
.bd-stat span { margin: 8px 0 0; font-size: 14px; color: rgba(255,255,255,.9); max-width: 16ch; font-weight: 500; }

.bd-hero .bd-btn-ghost {
  --b-fg: #fff; --b-bd: rgba(255,255,255,.55); --b-bg: rgba(255,255,255,.08);
  --b-bg-h: #fff; --b-fg-h: var(--navy); --b-bd-h: #fff;
  backdrop-filter: blur(10px);
}

/* =====================================================================
   SECTIONS & CARTES
   ===================================================================== */
.section, .bd-section { padding: 92px 0; }
.section-alt { background: var(--bg-alt); }
.bd-parcours { background: var(--bg-alt); }
.bd-center { text-align: center; }
.bd-center .section-head { margin-left: auto; margin-right: auto; }

.section-head { max-width: 66ch; margin-bottom: 48px; }
.section-eyebrow { font-size: 15px; color: var(--accent-dark); font-weight: 700; margin-bottom: 12px; }
.section-title, .bd-h2 {
  font-family: var(--font-display); font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.15; margin-bottom: 14px; color: var(--navy); letter-spacing: -.01em;
}
.bd-h2 { margin: 0 0 16px; }
.section-lead { font-size: 17px; color: var(--body); }

.pillar-grid, .bd-values {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 24px; margin-top: 48px;
}
.pillar, .bd-value {
  background: var(--surface); padding: 32px 28px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); text-align: left; border: 1px solid var(--line);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-fast);
  position: relative; overflow: hidden;
}
.pillar::before, .bd-value::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold-300));
  opacity: 0; transition: opacity var(--transition-normal);
}
.pillar:hover, .bd-value:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.pillar:hover::before, .bd-value:hover::before { opacity: 1; }

.pillar-icon, .bd-value-icon {
  display: inline-grid; place-items: center; width: 52px; height: 52px;
  color: var(--navy); background: var(--accent-soft); border-radius: var(--radius);
  margin-bottom: 18px; font-size: 24px;
  transition: transform var(--transition-fast), background var(--transition-fast);
}
.bd-value-icon { width: 56px; height: 56px; margin-bottom: 20px; }
/* corrigé : icône blanche sur orange (2,7:1) → marine (5,7:1) */
.pillar:hover .pillar-icon, .bd-value:hover .bd-value-icon { transform: scale(1.08); background: var(--accent); color: var(--navy); }
.bd-value-icon svg, .pillar-icon svg { width: 24px; height: 24px; }

.pillar-title, .bd-value h3 { font-size: 20px; margin-bottom: 10px; color: var(--navy); font-weight: 700; }
.pillar-text, .bd-value p { font-size: 15px; color: var(--body); margin-bottom: 18px; line-height: 1.6; }
.bd-value p { margin: 0; }

.pillar-items li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--body); padding: 5px 0; }
.pillar-items .icon { color: var(--accent-dark); margin-top: 4px; }

/* Cartes parcours — corrigé : min() évite le débordement horizontal < 360px */
.bd-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 28px; margin-top: 48px; text-align: left;
}
.bd-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 36px 32px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.bd-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
/* corrigé : bordure 1px + anneau (l'ancienne bordure de 2px décalait la mise en page) */
.bd-card.live { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(232,137,12,.12); }
.bd-card.live:hover { box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(232,137,12,.2); }

.bd-card-tag {
  position: absolute; top: 20px; right: 20px; background: var(--bg-alt); color: var(--muted);
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  padding: 4px 10px; border-radius: 99px; letter-spacing: .5px;
}
.bd-card.live .bd-card-tag { background: var(--accent); color: var(--navy); }   /* corrigé : contraste */

.bd-card-icon {
  width: 64px; height: 64px; background: var(--navy); color: #fff;
  border-radius: var(--radius-lg); display: grid; place-items: center; margin-bottom: 24px;
  transition: transform var(--transition-fast);
}
.bd-card:hover .bd-card-icon { transform: scale(1.05); }
.bd-card-icon svg { width: 32px; height: 32px; }

.bd-card h3 { font-size: 24px; color: var(--navy); margin: 0 0 8px; font-weight: 800; }
.bd-card-sub { font-size: 15px; color: var(--muted); margin: 0 0 24px; font-weight: 500; }
.bd-card ul { list-style: none; padding: 0; margin: 0 0 32px; flex: 1; }
.bd-card li { display: flex; gap: 12px; margin-bottom: 16px; font-size: 14.5px; color: var(--body); line-height: 1.5; }
.bd-card li i { color: var(--green-600); flex: none; margin-top: 2px; font-style: normal; }
.bd-card li i svg { width: 18px; height: 18px; }
.bd-card .bd-btn { width: 100%; margin-top: auto; }

/* Démarche */
.bd-steps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 32px; margin-top: 48px; text-align: left; counter-reset: step;
}
.bd-step { position: relative; padding-left: 68px; }
.bd-step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff;
  border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 20px; box-shadow: var(--shadow-md);
}
.bd-step h3 { font-size: 20px; color: var(--navy); margin: 0 0 8px; font-weight: 700; }
.bd-step p { font-size: 15px; color: var(--body); line-height: 1.6; margin: 0; }

/* Citation */
.bd-quote {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #fff; padding: 80px 0; text-align: center; position: relative; overflow: hidden;
}
.bd-quote::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(232,137,12,.1) 0%, transparent 60%);
  pointer-events: none;
}
.bd-quote blockquote {
  font-family: var(--font-display); font-size: clamp(22px, 3vw, 32px); line-height: 1.4;
  font-style: italic; max-width: 800px; margin: 0 auto 24px; position: relative; z-index: 1;
}
.bd-quote cite { display: block; font-size: 16px; color: var(--gold-300); font-style: normal; font-weight: 600; position: relative; z-index: 1; }

/* CTA final — corrigé : .cta-actions ne reçoit plus la marge/centrage de .bd-final-cta */
.cta {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%); color: #fff;
  padding: 52px; border-radius: var(--radius-lg);
  display: flex; justify-content: space-between; align-items: center; gap: 40px;
  flex-wrap: wrap; box-shadow: var(--shadow-lg);
}
.cta h2 { color: #fff; font-size: clamp(25px, 3vw, 34px); margin-bottom: 12px; max-width: 22ch; }
.cta p { color: rgba(255,255,255,.88); font-size: 16px; max-width: 52ch; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.bd-final-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 32px; }
.bd-final { background: var(--bg); text-align: center; }

/* =====================================================================
   FOOTER
   ===================================================================== */
.footer, .bd-footer { background: var(--navy); color: #B7C6DA; padding: 60px 0 calc(26px + var(--safe-bottom)); }
.bd-footer { padding-bottom: calc(30px + var(--safe-bottom)); }   /* corrigé : zone sûre iOS */

.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 40px; padding-bottom: 32px; }
.footer-baseline { color: #fff; font-weight: 650; margin: 16px 0 8px; }
.footer-text { font-size: 14.5px; max-width: 42ch; }
.footer-col h3 { color: #fff; font-size: 15px; margin-bottom: 12px; font-weight: 700; }
.footer-col a, .footer-meta {
  display: block; font-size: 14.5px; color: #B7C6DA; padding: 5px 0; overflow-wrap: anywhere;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}
.footer-col a:hover { color: #fff; padding-left: 4px; }

/* corrigé : règles .bd-footer-bottom contradictoires fusionnées (perdait son espacement) */
.footer-bottom, .bd-footer-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 22px; font-size: 13.5px; border-top: 1px solid rgba(255,255,255,.12);
}
.footer-bottom-center { justify-content: center; border-top: 0; padding-top: 0; }
.bd-footer-bottom { justify-content: center; border-top: 0; padding-top: 28px; }
.bd-footer-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.bd-footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.bd-footer-links a { color: #C9D4E3; text-decoration: none; font-size: 15px; padding: 6px 0; transition: color var(--transition-fast); }
.bd-footer-links a:hover { color: #fff; }

/* Retour en haut — corrigé : invisible = non cliquable ni focusable ; zone sûre */
.bd-to-top {
  position: fixed; bottom: calc(32px + var(--safe-bottom)); right: max(32px, var(--safe-right));
  width: 48px; height: 48px;
  background: var(--navy); color: #fff; border: 0; border-radius: 50%;
  box-shadow: var(--shadow-lg); cursor: pointer; display: grid; place-items: center;
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(20px);
  transition: opacity var(--transition-normal), transform var(--transition-normal),
              background var(--transition-fast), visibility 0s linear var(--transition-normal);
  z-index: 90;
}
.bd-to-top.is-visible {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
  transition: opacity var(--transition-normal), transform var(--transition-normal), background var(--transition-fast), visibility 0s;
}
.bd-to-top.is-visible:hover { background: var(--accent-dark); transform: translateY(-2px); }
.bd-to-top svg { width: 24px; height: 24px; }

/* =====================================================================
   COMPOSANTS DIVERS
   ===================================================================== */
.preview { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: clip; }
.preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 22px; background: var(--navy); color: #fff; }
.preview-label { font-size: 14px; color: #C9D4E3; font-weight: 500; }
.preview-value { font-size: 15px; font-weight: 700; color: #fff; }
.preview-body { padding: 24px 22px; }
.preview-formation { font-size: 17px; font-weight: 700; color: var(--navy); }
.preview-module { font-size: 14px; color: var(--muted); margin: 3px 0 16px; }
.progress { height: 8px; background: #E6EAF0; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width var(--transition-slow); }
.preview-lessons { margin-top: 18px; }
.preview-lessons li { display: flex; align-items: center; gap: 12px; padding: 11px 0; font-size: 14.5px; }
.pl-mark { display: grid; place-items: center; width: 22px; height: 22px; flex: none; color: var(--navy); }
.pl-label { flex: 1; min-width: 0; color: var(--body); }
.pl-state { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
li.is-done .pl-label { color: var(--muted); }
li.is-current .pl-label { font-weight: 700; color: var(--navy); }
li.is-locked .pl-mark, li.is-locked .pl-label { color: var(--muted); }
.preview-foot { padding: 14px 22px; background: var(--bg-soft); font-size: 13.5px; color: var(--muted); }

.notice { margin: 28px 0 0; padding: 16px 20px; background: var(--accent-soft); border-radius: var(--radius); font-size: 15px; color: var(--body); border-left: 4px solid var(--accent); }
.notice strong { color: var(--navy); }

.journey-grid { display: grid; grid-template-columns: .82fr 1.18fr; gap: 64px; align-items: start; }
.sticky-inner { position: sticky; top: calc(var(--nav-total) + 40px); }
.journey { position: relative; }
.journey-step { display: flex; gap: 22px; padding-bottom: 28px; position: relative; }
.journey-step:last-child { padding-bottom: 0; }
.journey-step::before { content: ""; position: absolute; left: 18px; top: 42px; bottom: 2px; width: 2px; background: #DDE2EA; border-radius: 2px; }
.journey-step:last-child::before { display: none; }
.journey-bullet { display: grid; place-items: center; width: 38px; height: 38px; flex: none; background: var(--navy); color: #fff; font-weight: 700; font-size: 15px; border-radius: 50%; position: relative; z-index: 1; box-shadow: var(--shadow-sm); }
.journey-body { flex: 1; min-width: 0; padding-top: 6px; }
.journey-body h3 { font-size: 18px; margin-bottom: 5px; }
.journey-body p { font-size: 15px; color: var(--body); }

.roles { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 10px; overflow: clip; }
.role-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--bg-alt); border-radius: var(--radius); }
.role-tab {
  flex: 1; min-width: 150px; min-height: 48px; padding: 13px 18px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); font-weight: 650; font-size: 15px; cursor: pointer; touch-action: manipulation;
  transition: background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}
.role-tab:hover { color: var(--navy); }
.role-tab.is-active, .role-tab[aria-selected="true"] { color: var(--navy); background: var(--surface); box-shadow: var(--shadow-sm); }
.role-panel { display: none; padding: 34px 28px 28px; grid-template-columns: .8fr 1.2fr; gap: 40px; }
.role-panel.is-active { display: grid; }
.role-panel > * { min-width: 0; }
.role-tag { display: inline-block; font-size: 13.5px; color: var(--accent-dark); font-weight: 700; margin-bottom: 10px; }
.role-head h3 { font-family: var(--font-display); font-size: 27px; margin-bottom: 10px; }
.role-head p { font-size: 15.5px; color: var(--body); }
.role-caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 0 28px; }
.role-caps li { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; font-size: 15px; color: var(--body); }
.role-caps .icon { color: var(--accent-dark); margin-top: 4px; }

.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 20px; margin-bottom: 40px; }
.trust { background: var(--surface); padding: 28px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: transform var(--transition-normal), box-shadow var(--transition-normal); }
.trust:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.trust-icon { color: var(--accent-dark); margin-bottom: 14px; }
.trust h3 { font-size: 18px; margin-bottom: 7px; }
.trust p { font-size: 15px; color: var(--body); }

.roadmap { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 32px; }
.roadmap-title { font-family: var(--font-display); font-size: 22px; color: var(--navy); font-weight: 700; margin-bottom: 24px; }
.roadmap-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 24px; }
.roadmap-item { display: flex; gap: 14px; }
.roadmap-mark { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; color: var(--navy); background: #DDE2EA; }
.roadmap-done .roadmap-mark { background: var(--navy); color: #fff; }
.roadmap-current .roadmap-mark { background: var(--accent); color: var(--navy); }
.roadmap-label { font-weight: 700; font-size: 16px; color: var(--navy); }
.roadmap-badge { font-weight: 500; font-size: 13.5px; color: var(--muted); }
.roadmap-text { font-size: 14.5px; color: var(--body); margin-top: 3px; }

/* =====================================================================
   FORMULAIRES & AUTH
   ===================================================================== */
.auth-body, .dash-body { background: var(--bg-alt); }
.auth-shell { display: grid; grid-template-columns: 420px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.auth-aside { background: var(--navy); color: #C9D4E3; padding: 52px 44px; display: flex; flex-direction: column; }
.auth-brand { display: flex; align-items: center; gap: 12px; color: #fff; margin-bottom: 40px; }
.auth-brand:hover { text-decoration: none; }
.auth-aside-baseline { font-family: var(--font-display); color: #fff; font-size: 27px; font-weight: 700; line-height: 1.25; margin-bottom: 14px; }
.auth-aside-text { font-size: 15.5px; margin-bottom: 30px; }
.auth-aside-list li { font-size: 15px; padding: 10px 0 10px 26px; position: relative; }
.auth-aside-list li::before { content: ""; position: absolute; left: 0; top: 19px; width: 10px; height: 10px; border-radius: 3px; background: #93A8C4; }
.auth-aside-foot { margin-top: auto; padding-top: 32px; font-size: 13px; color: #93A8C4; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 28px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 42px 38px; }
.auth-title { font-size: 30px; margin-bottom: 8px; }
.auth-sub { font-size: 15.5px; color: var(--muted); margin-bottom: 28px; }
.auth-note { font-size: 14px; color: var(--muted); margin-top: 22px; }

.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { font-size: 14.5px; font-weight: 650; color: var(--navy); }

/* corrigé : bordure visible (3:1), cases à cocher non cassées, flèche des <select> restaurée */
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field select, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--control-border); border-radius: var(--radius);
  -webkit-appearance: none; appearance: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.field select {
  padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230B2545' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #7A8494; opacity: 1; }
.field input:hover:not(:disabled):not(:focus), .field select:hover:not(:disabled):not(:focus), .field textarea:hover:not(:disabled):not(:focus) { border-color: var(--navy); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid transparent;               /* visible en mode contraste élevé */
  background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,79,156,.2);
}
.field input:disabled, .field select:disabled, .field textarea:disabled { background: var(--bg-soft); color: var(--muted); border-color: var(--line-strong); cursor: not-allowed; }
/* nouveau : état d'erreur */
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--red-600); }
.field input[aria-invalid="true"]:focus, .field select[aria-invalid="true"]:focus, .field textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(179,38,30,.2); }
.field .hint { font-size: 13.5px; color: var(--muted); }
.field .error { font-size: 13.5px; color: var(--red-600); font-weight: 600; }

.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--body); cursor: pointer; }
.checkbox input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--navy); }

.alert {
  position: relative; padding: 14px 50px 14px 16px; font-size: 14.5px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--bg-alt); color: var(--body); margin-bottom: 18px; overflow-wrap: anywhere;
}
.alert-error { background: #FBEFED; border-color: #E8C4C0; color: #7A2620; border-left: 4px solid var(--red-600); }
.alert-success { background: #EAF5EF; border-color: #BFDCCB; color: #1E5B3C; border-left: 4px solid var(--green-600); }
.alert-info { background: var(--tint); border-color: #C7D3E4; color: var(--navy); border-left: 4px solid var(--blue); }
.alert-close {
  position: absolute; right: 2px; top: 2px; min-width: 44px; min-height: 44px; background: none; border: 0;
  font-size: 22px; line-height: 1; cursor: pointer; color: inherit; padding: 4px 10px;
  border-radius: var(--radius-sm); transition: background var(--transition-fast);
}
.alert-close:hover { background: rgba(0,0,0,.06); }

.auth-page {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt);
  padding: max(24px, var(--safe-top)) max(16px, var(--safe-right)) max(24px, var(--safe-bottom)) max(16px, var(--safe-left));
}
.auth-page .auth-card { max-width: 420px; padding: 36px 32px; border: 1px solid var(--line-strong); }
.auth-page .auth-title { font-size: 28px; margin-bottom: 6px; }
.auth-page .auth-sub { margin-bottom: 24px; }
.auth-page .auth-note a { text-decoration: underline; text-underline-offset: 3px; }

/* =====================================================================
   DASHBOARD
   ===================================================================== */
.dash-top {
  position: fixed; top: 0; left: 0; right: 0; height: var(--dash-total);
  padding: var(--safe-top) max(22px, var(--safe-right)) 0 max(22px, var(--safe-left));
  z-index: 60; background: var(--navy);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  box-shadow: var(--shadow-sm);
}
.dash-top-left, .dash-top-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dash-brand { display: flex; align-items: center; gap: 11px; color: #fff; min-width: 0; }
.dash-brand:hover { text-decoration: none; }
.dash-burger {
  display: none; width: 44px; height: 44px; flex: none; background: rgba(255,255,255,.1);
  border: 0; border-radius: var(--radius); flex-direction: column; justify-content: center; align-items: center; gap: 5px; cursor: pointer;
  transition: background var(--transition-fast);
}
.dash-burger:hover { background: rgba(255,255,255,.18); }
.dash-burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #fff; }
.dash-role { font-size: 13.5px; color: #B7C6DA; padding-right: 14px; white-space: nowrap; }
.dash-user { position: relative; }
.dash-user summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
  color: #fff; font-size: 14.5px; padding: 5px 4px; min-height: 44px;
  border-radius: var(--radius); transition: background var(--transition-fast);
}
.dash-user summary:hover { background: rgba(255,255,255,.08); }
.dash-user summary::-webkit-details-marker { display: none; }
.dash-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; background: var(--accent); color: var(--navy); font-size: 13px; font-weight: 800; border-radius: 50%; }
.dash-username { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-user-menu {
  position: absolute; right: 0; top: calc(100% + 6px); width: 260px; max-width: calc(100vw - 32px);
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 16px; z-index: 70;
  border: 1px solid var(--line); animation: dropdown-in 200ms cubic-bezier(.4,0,.2,1);
}
.dash-user-email { font-size: 14px; color: var(--navy); font-weight: 650; word-break: break-all; }
.dash-user-meta { font-size: 13px; color: var(--muted); margin: 4px 0 14px; }

.dash-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); padding-top: var(--dash-total); min-height: 100vh; min-height: 100dvh; }
.dash-sidebar {
  background: var(--surface); border-right: 1px solid var(--line-strong); padding: 22px 0;
  position: sticky; top: var(--dash-total);
  height: calc(100vh - var(--dash-total)); height: calc(100dvh - var(--dash-total));
  overflow-y: auto; overscroll-behavior: contain;
}
.dash-nav-title { font-size: 13px; color: var(--muted); font-weight: 700; padding: 0 26px; margin-bottom: 8px; }
.dash-nav { margin-bottom: 24px; }
.dash-nav-link {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; margin: 2px 12px;
  min-height: 44px; font-size: 15px; color: var(--body); border-radius: var(--radius); text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.dash-nav-link:hover { background: var(--bg-alt); color: var(--navy); text-decoration: none; transform: translateX(2px); }
.dash-nav-link.is-active, .dash-nav-link[aria-current="page"] { color: var(--navy); font-weight: 700; background: var(--tint); }
.dash-soon { margin-left: auto; font-size: 12px; color: var(--muted); }
.dash-scrim { position: fixed; inset: var(--dash-total) 0 0; background: rgba(11,37,69,.45); z-index: 49; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

.dash-main { padding: 34px 38px 64px; width: 100%; max-width: 1240px; margin: 0 auto; min-width: 0; transition: opacity var(--transition-normal); }
.dash-main.is-swapping { opacity: .42; }
.dash-main:focus { outline: none; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.dash-eyebrow { font-size: 14px; color: var(--accent-dark); font-weight: 700; margin-bottom: 6px; }
.dash-title { font-size: 30px; margin-bottom: 6px; }
.dash-sub { font-size: 15.5px; color: var(--muted); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; margin-bottom: 28px; }
.kpi { background: var(--surface); padding: 22px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: transform var(--transition-normal), box-shadow var(--transition-normal); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-label { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.kpi-value { font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.kpi-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

.panel { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 22px; min-width: 0; overflow-x: auto; overflow-y: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; flex-wrap: wrap; padding: 20px 24px 8px; }
.panel-title { font-family: var(--font-display); font-size: 20px; }
.panel-count { font-size: 13.5px; color: var(--muted); }
.panel-empty { padding: 26px 24px; font-size: 15px; color: var(--muted); }
.panel-body { padding: 26px 24px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { padding: 13px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table .nowrap, .table .tag, .table .link-action { white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table thead th { font-size: 13.5px; color: var(--muted); font-weight: 650; background: var(--surface); }
.table tbody th { font-weight: 650; color: var(--navy); background: var(--surface); }   /* corrigé : fond opaque (sticky) */
.table tbody td { color: var(--body); }
.table tbody tr:last-child th, .table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover th, .table tbody tr:hover td { background: var(--bg-soft); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 20px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; padding-top: 22px; }

.search-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.search-bar input, .search-bar select {
  flex: 1; min-width: min(220px, 100%); padding: 11px 14px; font: inherit; font-size: 15px;
  border: 1px solid var(--control-border); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.search-bar input:hover:not(:focus), .search-bar select:hover:not(:focus) { border-color: var(--navy); }
.search-bar input:focus, .search-bar select:focus { outline: 2px solid transparent; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,79,156,.2); }
.search-bar select { flex: none; }

.table-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.link-action { font-size: 14.5px; font-weight: 650; }
.tag { display: inline-block; padding: 3px 11px; font-size: 13px; font-weight: 650; border-radius: 99px; background: var(--bg-alt); color: var(--muted); }
.tag-on { background: #EAF5EF; color: #1E5B3C; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 24px; font-size: 14px; color: var(--muted); }

.lesson-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; }
.lesson-sidebar {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 14px;
  position: sticky; top: calc(var(--dash-total) + 20px);
  max-height: calc(100vh - var(--dash-total) - 40px); max-height: calc(100dvh - var(--dash-total) - 40px); overflow-y: auto;
}
.lesson-nav-item a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 44px;
  font-size: 14.5px; color: var(--body); border-radius: var(--radius); text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.lesson-nav-item a:hover { background: var(--bg-alt); text-decoration: none; }
.lesson-nav-item.is-active a { background: var(--navy); color: #fff; font-weight: 650; }
.lesson-content { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 36px; min-width: 0; }
.lesson-video iframe { display: block; width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--radius); }
.lesson-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 34px; padding-top: 24px; flex-wrap: wrap; }

/* Extensions */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 22px; min-width: 0; }
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.muted { color: var(--muted); }
.h2 { font-family: var(--font-display); font-size: 20px; color: var(--navy); font-weight: 700; margin: 26px 0 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 3px 11px; font-size: 13px; font-weight: 650; border-radius: 99px; background: var(--bg-alt); color: var(--muted); }
.badge-green { background: #EAF5EF; color: #1E5B3C; }
.badge-amber { background: var(--accent-soft); color: var(--accent-dark); }
.dash-nav-group { margin-bottom: 20px; }
.dash-nav-link .tag { margin-left: auto; }
.dash-nav-link.is-active .tag { background: var(--surface); color: var(--navy); }
.dash-top-search {
  display: flex; align-items: center; gap: 8px; flex: 1; max-width: 340px; margin: 0 auto;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius); padding: 8px 12px; color: #B7C6DA;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.dash-top-search:hover { background: rgba(255,255,255,.15); }
/* corrigé : le focus était supprimé sans équivalent → indicateur sur le conteneur */
.dash-top-search:focus-within { background: rgba(255,255,255,.18); border-color: var(--gold-300); box-shadow: 0 0 0 3px rgba(242,200,121,.25); }
.dash-top-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: #fff; font: inherit; font-size: 14px; }
.dash-top-search input::placeholder { color: #A9BAD1; }
.dash-user-menu a:not(.btn) { display: block; padding: 9px 0; font-size: 14.5px; font-weight: 650; color: var(--blue); text-decoration: none; transition: color var(--transition-fast), padding-left var(--transition-fast); }
.dash-user-menu a:not(.btn):hover { color: var(--navy); text-decoration: none; padding-left: 4px; }
.dash-user-menu a.danger { color: var(--red-600); }
.dash-user-menu .sep { height: 1px; background: var(--line); margin: 8px 0; }

/* Navigation intégrée (bad-nav.js) */
.bad-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; pointer-events: none; opacity: 0; transition: opacity var(--transition-normal); }
.bad-progress.is-active { opacity: 1; }
.bad-progress i {
  display: block; height: 100%; width: 34%; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, var(--accent) 0%, var(--gold-300) 45%, var(--blue) 100%);
  box-shadow: 0 0 12px rgba(232,137,12,.55);
  animation: bad-slide 1.05s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes bad-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(330%); } }

.btn.is-busy, .bd-btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after, .bd-btn.is-busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  animation: bad-spin .7s linear infinite;
}
.btn-gray.is-busy::after, .btn-secondary.is-busy::after, .btn-light.is-busy::after, .bd-btn-ghost.is-busy::after, .bd-btn-gold.is-busy::after {
  border-color: rgba(11,37,69,.3); border-top-color: var(--navy);
}
@keyframes bad-spin { to { transform: rotate(360deg); } }

.bad-nav-error { background: var(--surface); border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: var(--radius-lg); padding: 28px; max-width: 620px; }
.bad-nav-error-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; font-size: 20px; margin-bottom: 14px; }

/* Fragments injectés dans .dash-main (SPA) */
.dash-main .nav, .dash-main .nav-drawer, .dash-main .dash-top, .dash-main .dash-sidebar,
.dash-main .dash-scrim, .dash-main .footer, .dash-main .skip-link { display: none !important; }
.dash-main .hero { padding: 8px 0 32px; }
.dash-main .section { padding: 36px 0; }
.dash-main .section:first-child { padding-top: 0; }
.dash-main .container { max-width: none; padding: 0; }
.dash-main .dash-layout { display: block; padding-top: 0; min-height: 0; }
.dash-main .dash-main { padding: 0; max-width: none; }

/* Animations */
@keyframes home-fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* Tableau de bord v2 */
.dash-brand-text { font-weight: 700; font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-top-search svg { width: 16px; height: 16px; opacity: .7; }
.dash-grid-2 { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 24px; align-items: start; }
.dash-stack { display: flex; flex-direction: column; gap: 14px; }
.resume-card {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-fast);
}
.resume-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.resume-info { flex: 1; min-width: 0; }
.resume-info h3 { font-size: 16.5px; margin: 8px 0 10px; }
.resume-info .progress { margin-bottom: 8px; }
.resume-info p { font-size: 13.5px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-top .kpi-label { margin-bottom: 0; }
.kpi-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-dark); }
.kpi-icon svg { width: 20px; height: 20px; }
.feed { padding: 6px 24px 20px; }
.feed li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.feed li:last-child { border-bottom: 0; }
.feed li div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feed li strong { font-weight: 650; color: var(--navy); }
.feed-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--tint); color: var(--navy); }
.feed-icon svg { width: 15px; height: 15px; }
.empty-state { padding: 48px 24px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--tint); color: var(--navy); }
.empty-icon svg { width: 28px; height: 28px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { font-size: 14.5px; color: var(--muted); margin-bottom: 20px; }
.badge-green svg { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; }

/* =====================================================================
   MEDIA QUERIES
   ===================================================================== */
@media (min-width: 1025px) { .dash-scrim { display: none; } }   /* nouveau : jamais visible sur desktop */

@media (max-width: 1100px) {
  .nav-inner { gap: 18px; }
  .nav-link { padding: 8px 10px; font-size: 14.5px; }
}

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .journey-grid { grid-template-columns: 1fr; gap: 36px; }
  .sticky-inner { position: static; }
  .role-panel { grid-template-columns: 1fr; gap: 24px; padding: 28px 20px 22px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .dash-layout { grid-template-columns: minmax(0, 1fr); }
  .dash-burger { display: flex; }
  .dash-sidebar {
    position: fixed; top: var(--dash-total); left: 0; bottom: 0; width: 290px; max-width: 85vw;
    padding-bottom: calc(26px + var(--safe-bottom)); z-index: 50;
    transform: translateX(-100%); visibility: hidden;
    transition: transform var(--transition-normal), visibility 0s linear var(--transition-normal);
    height: auto;
  }
  .dash-sidebar.is-open { transform: none; visibility: visible; transition: transform var(--transition-normal), visibility 0s; box-shadow: var(--shadow-xl); }
  body.dash-nav-open { overflow: hidden; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-sidebar { position: static; max-height: none; }
  .dash-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav-links, .bd-nav { display: none; }
  .nav-toggle, .bd-burger { display: flex; margin-left: auto; }
  .nav-actions { margin-left: 0; }
  .nav-actions .btn { display: none; }
  .section, .bd-section { padding: 64px 0; }
  .section-head { margin-bottom: 32px; }
  .cta { padding: 34px; }
  .table .col-hide-sm { display: none; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { padding: 28px 26px; }
  .auth-brand { margin-bottom: 18px; }
  .auth-aside-baseline { font-size: 22px; }
  .auth-aside-list, .auth-aside-foot { display: none; }
  .auth-aside-text { margin-bottom: 0; }
  .auth-main { align-items: flex-start; padding: 28px 20px calc(32px + var(--safe-bottom)); }
  .dash-role { display: none; }
  .table tbody th { position: sticky; left: 0; z-index: 1; }
  .bd-footer-top { flex-direction: column; align-items: center; text-align: center; }
  .bd-footer-links { justify-content: center; }
  .bd-footer-bottom { flex-direction: column; text-align: center; align-items: center; }
  .dash-top-search { display: none; }
}

@media (max-width: 600px) {
  .container, .bd-container { padding: 0 max(20px, var(--safe-right)) 0 max(20px, var(--safe-left)); }
  .nav-drawer { padding-left: max(20px, var(--safe-left)); padding-right: max(20px, var(--safe-right)); }
  .hero { padding: calc(var(--nav-total) + 40px) 0 52px; }
  .bd-hero { padding: calc(var(--nav-total) + 50px) 0 60px; }
  .brand-baseline { display: none; }
  .hero-actions, .bd-hero-cta { flex-direction: column; align-items: stretch; margin-bottom: 34px; width: 100%; }
  /* corrigé : « .bd-btn » seul rendait TOUS les boutons pleine largeur (header, menus…) */
  .hero-actions .btn, .bd-hero-cta .bd-btn, .bd-final-cta .bd-btn, .cta-actions .btn { width: 100%; }
  .bd-final-cta, .cta-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 22px 16px; }
  .hero-stat-value { font-size: 30px; }
  .bd-hero h1 { font-size: clamp(30px, 8vw, 44px); }
  .bd-stat b { font-size: 32px; }
  .section, .bd-section { padding: 52px 0; }
  .pillar, .trust { padding: 24px 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .auth-card { padding: 30px 22px; max-width: none; }
  .auth-title { font-size: 26px; }
  .dash-top { padding-left: max(14px, var(--safe-left)); padding-right: max(14px, var(--safe-right)); }
  .dash-username { display: none; }
  .dash-main { padding: 22px max(16px, var(--safe-right)) 44px max(16px, var(--safe-left)); }
  .dash-title { font-size: 25px; }
  .kpi { padding: 18px; }
  .kpi-value { font-size: 30px; }
  .panel-head { padding: 18px 16px 6px; }
  .panel-empty { padding: 22px 16px; }
  .panel-body { padding: 20px 16px; }
  .pagination { padding: 12px 16px; }
  .table th, .table td, .table th:first-child, .table td:first-child, .table th:last-child, .table td:last-child { padding: 12px 16px; }
  .form-actions .btn { width: 100%; }
  .search-bar input, .search-bar select, .search-bar .btn { width: 100%; min-width: 100%; }
  .lesson-content { padding: 22px 16px; }
  .lesson-sidebar { padding: 10px; }
  .lesson-actions { flex-direction: column-reverse; align-items: stretch; }
  .bd-card { padding: 28px 24px; }
  .resume-card { flex-direction: column; align-items: stretch; }
  .resume-card .btn { width: 100%; }
  .dash-brand-text { display: none; }
  .bd-to-top { right: max(16px, var(--safe-right)); bottom: calc(20px + var(--safe-bottom)); }
}

@media (pointer: coarse) {
  .btn, .btn-sm, .bd-btn { min-height: 44px; }
  .link-action { display: inline-flex; align-items: center; min-height: 44px; }
  .field input, .field select, .field textarea, .search-bar input, .search-bar select { font-size: 16px; min-height: 46px; }
  .drawer-link { padding: 16px 0; }
  .footer-col a, .bd-footer-links a { min-height: 44px; display: flex; align-items: center; }
}

/* corrigé : l'ancienne règle forçait .btn:hover en marine et écrasait .btn-green, .bd-btn-gold, etc.
   On neutralise simplement l'état « survol collant » du tactile via les variables */
@media (hover: none) {
  .btn:hover, .bd-btn:hover { background: var(--b-bg); color: var(--b-fg); border-color: var(--b-bd); transform: none; box-shadow: var(--shadow-sm); }
  .table tbody tr:hover td { background: transparent; }
  .table tbody tr:hover th { background: var(--surface); }
  .pillar:hover, .bd-value:hover, .bd-card:hover, .kpi:hover, .trust:hover, .resume-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .bad-progress i { animation: none; width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-grid > div:first-child { animation: home-fade-up .8s cubic-bezier(.16,1,.3,1) both; }
  .hero-visual { animation: home-fade-up .8s cubic-bezier(.16,1,.3,1) .15s both; }
}

@media (forced-colors: active) {
  .btn, .bd-btn, .tag, .badge, .alert, .field input, .field select, .field textarea { border: 1px solid ButtonText; }
  .progress { border: 1px solid ButtonText; }
  .progress span { background: Highlight; }
  :focus-visible { outline-color: Highlight; }
}

@media print {
  .nav, .bd-header, .nav-drawer, .cta-actions, .dash-top, .dash-sidebar, .dash-scrim, .skip-link, .bd-to-top, .bad-progress { display: none !important; }
  .dash-layout { display: block; padding-top: 0; }
  body, .section-alt, .auth-body, .dash-body { background: #fff; }
  .cta, .footer, .bd-footer { background: #fff; color: #000; }
  .cta h2, .footer-baseline, .footer-col h3 { color: #000; }
  .hero, .bd-hero { padding-top: 24px; }
  .bd-hero { background: #fff; color: #000; }
  .bd-hero h1, .bd-hero p { color: #000; text-shadow: none; }
  .panel, .lesson-content, .preview { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  a { color: #000; }
}

/* =====================================================================
   CORRECTIF — taille des icônes SVG (icônes géantes dans la sidebar,
   les boutons et les menus). :where() = spécificité 0 : n'écrase aucune
   règle dédiée (.kpi-icon svg, .icon-lg, etc.)
   ===================================================================== */
:where(.btn, .bd-btn, .dash-nav-link, .drawer-link, .nav-link, .bd-auth-item,
       .dash-user-menu a, .lesson-nav-item a, .link-action, .badge, .tag, .alert,
       .pl-mark, .roadmap-mark, .dash-top-search, .dash-burger) svg {
  width: 18px; height: 18px; flex: none;
}
:where(.btn-sm) svg { width: 16px; height: 16px; }
:where(.dash-nav-link) svg { width: 20px; height: 20px; color: var(--muted); }
.dash-nav-link:hover svg, .dash-nav-link.is-active svg, .dash-nav-link[aria-current="page"] svg { color: var(--navy); }

/* Libellés : pas de retour à la ligne parasite, alignement vertical propre */
.dash-nav-link { white-space: nowrap; }
.dash-nav-link > span:not(.tag):not(.dash-soon) { overflow: hidden; text-overflow: ellipsis; }
.btn, .bd-btn { white-space: nowrap; }
@media (max-width: 600px) { .btn, .bd-btn { white-space: normal; } }

/* Filet de sécurité : tout SVG inline sans taille ni classe reste raisonnable */
svg:where(:not([width]):not([height]):not([class])) { max-width: 1.5em; max-height: 1.5em; }

/* =====================================================================
   PAGE PROFIL — classes utilisées par le HTML mais absentes du CSS
   ===================================================================== */

/* Sprite SVG : doit être invisible et hors flux (sinon un SVG 300×150 s'affiche en bas de page) */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* Avatar (photo ou initiales) */
.avatar {
  display: inline-grid; place-items: center; flex: none; overflow: hidden;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: var(--navy);
  font-weight: 800; font-size: 15px; line-height: 1; text-transform: uppercase;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line-strong);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }

/* Section photo de profil */
.profile-photo { display: flex; align-items: flex-start; gap: 28px; flex-wrap: wrap; }
.profile-photo-actions { flex: 1; min-width: min(280px, 100%); max-width: 520px; display: flex; flex-direction: column; gap: 14px; }
.profile-photo-actions .form-actions { margin-top: 0; padding-top: 0; }

/* Aide sous un champ (alias de .field .hint) */
.field-hint { font-size: 13.5px; color: var(--muted); }
.field-error { font-size: 13.5px; color: var(--red-600); font-weight: 600; }

/* Champ fichier : bouton natif stylé, zone cliquable lisible */
.field input[type="file"] {
  width: 100%; padding: 8px; font: inherit; font-size: 14.5px; color: var(--body);
  background: var(--surface); border: 1px dashed var(--control-border); border-radius: var(--radius);
  cursor: pointer; transition: border-color var(--transition-fast), background var(--transition-fast);
}
.field input[type="file"]:hover { border-color: var(--navy); background: var(--bg-soft); }
.field input[type="file"]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.field input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 9px 16px; min-height: 40px; font: inherit; font-size: 14px; font-weight: 650;
  color: var(--navy); background: var(--tint); border: 0; border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--transition-fast);
}
.field input[type="file"]::file-selector-button:hover { background: #DCE4EF; }

/* Champ date : icône et hauteur cohérentes avec les autres champs */
.field input[type="date"] { min-height: 46px; }

/* Barre d'actions d'un formulaire : séparée du contenu */
.panel-body > .form > .form-actions { border-top: 1px solid var(--line); margin-top: 6px; }

/* Note de bas de page */
.dash-foot-note { max-width: 70ch; margin: 4px 0 0; font-size: 14px; color: var(--muted); line-height: 1.6; }
.dash-foot-note a { font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

/* Éléments vides côté serveur (e-mail, rôle) : pas de blocs fantômes dans l'en-tête */
.dash-role:empty, .dash-user-email:empty { display: none; }
.dash-user-menu form { margin: 0; }

/* Titre de section de la barre latérale : espace entre groupes */
.dash-nav-title:not(:first-child) { margin-top: 8px; }

@media (max-width: 600px) {
  .profile-photo { flex-direction: column; align-items: center; text-align: left; }
  .profile-photo-actions { width: 100%; max-width: none; }
}
/* =====================================================================
   LOGO DE MARQUE (pastille blanche) — remplace le carré texte BAD
   ===================================================================== */
.brand-logo {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; flex: none; overflow: hidden;
  background: #fff; border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(255,255,255,.20), 0 2px 8px rgba(0,0,0,.14);
  transition: transform var(--transition-fast);
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 3px; }
.brand-logo-lg { width: 48px; height: 48px; border-radius: 12px; }
/* sur fond clair (carte auth mobile, footer) : bordure subtile pour ne pas "disparaître" */
.auth-mobile-brand .brand-logo, .footer .brand-logo, .bd-footer .brand-logo {
  box-shadow: 0 0 0 1px var(--line-strong), 0 1px 4px rgba(11,37,69,.08);
}
/* le logo grossit légèrement au survol de la marque, comme l'ancien carré */
.brand:hover .brand-logo, .bd-brand:hover .brand-logo,
.auth-brand:hover .brand-logo, .dash-brand:hover .brand-logo { transform: scale(1.05); }
/* si l'image venait à manquer, l'attribut alt "BAD" s'affiche dans la pastille */
.brand-logo img[alt] { color: var(--navy); font-weight: 800; font-size: 12px; }

/* =====================================================================
   FIX LISIBILITÉ HEADER + CTA (aucun effet « IA », sobre et robuste)
   ===================================================================== */

/* 1. Variante manquante : CTA primaire doré, texte marine (contraste AA) */
.btn-primary, .btn-cta {
  --b-bg: var(--accent); --b-fg: var(--navy); --b-bd: var(--accent);
  --b-bg-h: var(--accent-dark); --b-fg-h: #fff; --b-bd-h: var(--accent-dark);
  box-shadow: 0 2px 10px rgba(232,137,12,.28);
}
.btn-primary:hover, .btn-cta:hover { box-shadow: 0 6px 18px rgba(232,137,12,.36); }

/* 2. Dans le header navy, tout bouton SANS variante de couleur devient lisible
      (contour clair). Les variantes explicites (btn-light, btn-outline-light,
      btn-secondary, btn-green, btn-gray, bd-btn-gold, bd-btn-ghost, btn-primary…)
      sont préservées car elles contiennent « btn- ». */
.nav .btn:not([class*="btn-"]),
.nav .bd-btn:not([class*="btn-"]),
.bd-header .btn:not([class*="btn-"]),
.bd-header .bd-btn:not([class*="btn-"]) {
  --b-bg: rgba(255,255,255,.10); --b-fg: #fff; --b-bd: rgba(255,255,255,.32);
  --b-bg-h: rgba(255,255,255,.18); --b-fg-h: #fff; --b-bd-h: rgba(255,255,255,.52);
}

/* 3. Liens du menu : contraste garanti sur navy */
.nav .nav-link, .bd-header .bd-nav a { color: #D3DCE8; }
.nav .nav-link:hover, .nav .nav-link.is-active,
.bd-header .bd-nav a:hover, .bd-header .bd-nav a[aria-current="page"] { color: #fff; }

/* 4. Sécurité : si la vue oublie le padding-top, le hero ne passe jamais sous le menu fixe */
.nav + main > .hero:first-child,
.nav + .hero:first-child,
.bd-header + .bd-hero:first-child { padding-top: calc(var(--nav-total) + 56px); }

/* =====================================================================
   ANIMATIONS SOBRES (fade-up léger, respectueux prefers-reduced-motion)
   ===================================================================== */
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  .hero-grid > *, .bd-hero .bd-container > * { animation: fade-up .6s cubic-bezier(.16,1,.3,1) both; }
  .bd-hero .bd-container > *:nth-child(2) { animation-delay: .06s; }
  .bd-hero .bd-container > *:nth-child(3) { animation-delay: .12s; }
  .section-head { animation: fade-up .6s cubic-bezier(.16,1,.3,1) both; }
  .pillar, .bd-card, .bd-step, .trust, .kpi {
    animation: fade-up .55s cubic-bezier(.16,1,.3,1) both;
  }
  .pillar:nth-child(2), .bd-card:nth-child(2), .bd-step:nth-child(2), .trust:nth-child(2), .kpi:nth-child(2) { animation-delay: .07s; }
  .pillar:nth-child(3), .bd-card:nth-child(3), .bd-step:nth-child(3), .trust:nth-child(3), .kpi:nth-child(3) { animation-delay: .14s; }
  .pillar:nth-child(4), .bd-card:nth-child(4), .kpi:nth-child(4) { animation-delay: .21s; }
}

/* =====================================================================
   FIX DÉFINITIF — lisibilité des boutons/liens sur HEADER NAVY
   (.bd-header / .nav / .dash-top) — aucune variante de couleur perdue
   ===================================================================== */
.bd-header .btn:not([class*="btn-"]),
.bd-header .bd-btn:not([class*="btn-"]),
.nav .btn:not([class*="btn-"]),
.nav .bd-btn:not([class*="btn-"]) {
  --b-bg: rgba(255,255,255,.10); --b-fg: #fff; --b-bd: rgba(255,255,255,.34);
  --b-bg-h: rgba(255,255,255,.20); --b-fg-h: #fff; --b-bd-h: rgba(255,255,255,.55);
  box-shadow: none;
}

/* Le ghost sur navy devient un bouton clair lisible (comme dans le hero) */
.bd-header .bd-btn-ghost, .bd-header .btn-ghost,
.nav .bd-btn-ghost, .nav .btn-ghost {
  --b-bg: transparent; --b-fg: #fff; --b-bd: rgba(255,255,255,.55);
  --b-bg-h: #fff; --b-fg-h: var(--navy); --b-bd-h: #fff;
}

/* Liens du menu : contraste garanti */
.bd-header .bd-nav a, .nav .nav-link { color: #D3DCE8; }
.bd-header .bd-nav a:hover, .bd-header .bd-nav a[aria-current="page"],
.nav .nav-link:hover, .nav .nav-link.is-active { color: #fff; }

/* Burger + drawer cohérents */
.bd-header .bd-burger, .nav .nav-toggle { color: #fff; }
.bd-header .bd-burger span, .nav .nav-toggle span { background: #fff; }

/* Le CTA doré garde sa place de hiérarchie principale */
.bd-header .bd-btn-gold, .nav .bd-btn-gold { --b-fg: var(--navy); --b-fg-h: #fff; }

/* =====================================================================
   REVEAL SOBRE AU SCROLL (fade-up 14px, stagger léger)
   ===================================================================== */
.reveal-item { opacity: 0; transform: translateY(14px); transition: opacity .5s cubic-bezier(.16,1,.3,1), transform .5s cubic-bezier(.16,1,.3,1); }
.reveal-item.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal-item { opacity: 1; transform: none; transition: none; } }

/* =====================================================================
   FIX DROPDOWN AUTH — contraste AA (bat toute règle héritée du header)
   Spécificité (0,3,0) > .bd-header a (0,1,1) et .bd-header details a (0,2,1)
   ===================================================================== */
.bd-header .bd-auth-dropdown,
.nav .bd-auth-dropdown {
  background: #fff;                 /* blanc pur : le .98+blur "lavait" le texte */
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(11,37,69,.16), 0 2px 6px rgba(11,37,69,.08);
  padding: 8px;
  min-width: 230px;
}

.bd-header .bd-auth-dropdown .bd-auth-item,
.bd-header .bd-auth-dropdown .bd-auth-item > span {
  color: #1A1D23;                   /* ink : lisible sur blanc */
  font-weight: 600;
}
.bd-header .bd-auth-dropdown .bd-auth-item-icon svg { color: inherit; }

.bd-header .bd-auth-dropdown .bd-auth-item:hover {
  background: var(--bg-soft);
  color: var(--navy);
}
.bd-header .bd-auth-dropdown .bd-auth-item:hover > span { color: var(--navy); }

.bd-header .bd-auth-dropdown .bd-auth-item-gold,
.bd-header .bd-auth-dropdown .bd-auth-item-gold > span {
  color: var(--accent-dark);
  font-weight: 700;
}
.bd-header .bd-auth-dropdown .bd-auth-item-gold:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

/* Séparateur discret entre les deux actions */
.bd-header .bd-auth-dropdown .bd-auth-item + .bd-auth-item {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 12px;
}

/* =====================================================================
   SIDEBAR ACCORDÉON (style Microsoft 365 admin center)
   ===================================================================== */
.dash-nav-parent { margin: 2px 12px; border-radius: var(--radius); }
.dash-nav-parent-row { display: flex; align-items: center; gap: 4px; }
.dash-nav-parent-link { flex: 1; margin: 0; }
.dash-nav-parent-row .dash-nav-link { margin: 0; }
.dash-nav-chevron {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 8px; color: var(--muted);
  cursor: pointer; transition: background var(--transition-fast), color var(--transition-fast);
}
.dash-nav-chevron:hover { background: var(--bg-alt); color: var(--navy); }
.dash-nav-chevron svg { width: 16px; height: 16px; transition: transform var(--transition-normal); }
.dash-nav-parent.is-open .dash-nav-chevron svg { transform: rotate(180deg); }

.dash-nav-children {
  list-style: none; margin: 0; padding: 0;
  max-height: 0; overflow: hidden;
  transition: max-height var(--transition-slow);
}
.dash-nav-parent.is-open .dash-nav-children { max-height: 320px; }

.dash-nav-child {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px 9px 44px; margin: 1px 0;
  font-size: 14px; color: var(--body); border-radius: 8px; text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.dash-nav-child::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--line-strong); flex: none; transition: background var(--transition-fast);
}
.dash-nav-child:hover { background: var(--bg-alt); color: var(--navy); text-decoration: none; }
.dash-nav-child.is-active { background: var(--tint); color: var(--navy); font-weight: 700; }
.dash-nav-child.is-active::before { background: var(--accent); }

/* Séparateur de section type MS */
.dash-nav-group + .dash-nav-group { margin-top: 6px; }
.dash-nav-group + .dash-nav-group .dash-nav-title { border-top: 1px solid var(--line); padding-top: 14px; }

/* =====================================================================
   URGENCE — Navigation interne des groupes de Paramètres (style SaaS)
   ===================================================================== */
.dash-main a[href^="#"],
.dash-main a[href*="group="],
.dash-main a[href*="/parametres?"] {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; margin: 0 6px 8px 0;
  font-size: 13.5px; font-weight: 600;
  color: var(--body); background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: 99px;
  text-decoration: none; transition: all var(--transition-fast);
}
.dash-main a[href^="#"]:hover,
.dash-main a[href*="group="]:hover,
.dash-main a[href*="/parametres?"]:hover {
  background: var(--surface); border-color: var(--line-strong);
  color: var(--navy); text-decoration: none; transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.dash-main a[href^="#"].is-active,
.dash-main a[href^="#"][aria-current],
.dash-main a[href*="group="].is-active {
  background: var(--navy); color: #fff; border-color: var(--navy);
}

/* =====================================================================
   NAVIGATION INTERNE DES GROUPES DE PARAMÈTRES (style GitHub/Stripe)
   ===================================================================== */

/* Cas 1 : Liste verticale <ul><li><a> ou <nav><a> */
.dash-main nav a,
.dash-main ul a[href],
.dash-main ol a[href] {
  display: block;
  padding: 10px 16px;
  margin: 2px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  background: transparent;
  border-left: 3px solid transparent;
  border-radius: 6px;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.dash-main nav a:hover,
.dash-main ul a[href]:hover,
.dash-main ol a[href]:hover {
  background: var(--bg-alt);
  color: var(--navy);
  border-left-color: var(--accent);
  text-decoration: none;
}
.dash-main nav a.is-active,
.dash-main nav a[aria-current],
.dash-main ul a[href].is-active,
.dash-main ul a[href][aria-current] {
  background: var(--tint);
  color: var(--navy);
  border-left-color: var(--navy);
  font-weight: 700;
}

/* Cas 2 : Liens d'ancres # (si présents) */
.dash-main a[href^="#"] {
  display: inline-block;
  padding: 8px 16px;
  margin: 4px 8px 4px 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--body);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 99px;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.dash-main a[href^="#"]:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--navy);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.dash-main a[href^="#"].is-active,
.dash-main a[href^="#"][aria-current] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* Panneaux de groupe (sections avec id) */
.dash-main section[id],
.dash-main div[id] {
  scroll-margin-top: 100px;
}

/* Titre "Groupes" */
.dash-main h3:contains("Groupes"),
.dash-main h2:contains("Groupes"),
.dash-main h4:contains("Groupes") {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 12px;
}

/* =====================================================================
   NAVIGATION INTERNE PARAMÈTRES (fonctionne avec chargement dynamique)
   ===================================================================== */

/* Tous les liens dans le contenu principal qui ressemblent à une navigation */
.dash-main a {
  transition: color var(--transition-fast), background var(--transition-fast);
}

/* Liens de navigation (href vers sections ou groupes) */
.dash-main a[href*="group"],
.dash-main a[href^="#"],
.dash-main a[href*="/parametres"] {
  display: inline-block;
  padding: 8px 14px;
  margin: 4px 6px 4px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.dash-main a[href*="group"]:hover,
.dash-main a[href^="#"]:hover,
.dash-main a[href*="/parametres"]:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--navy);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.dash-main a[href*="group"].is-active,
.dash-main a[href*="group"][aria-current],
.dash-main a[href^="#"].is-active,
.dash-main a[href^="#"][aria-current] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  font-weight: 600;
}

/* Si les liens sont dans une liste <ul> ou <nav> */
.dash-main ul a,
.dash-main nav a,
.dash-main ol a {
  display: block;
  padding: 10px 16px;
  margin: 2px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  border-left: 3px solid transparent;
  border-radius: 6px;
  text-decoration: none;
}

.dash-main ul a:hover,
.dash-main nav a:hover,
.dash-main ol a:hover {
  background: var(--bg-alt);
  color: var(--navy);
  border-left-color: var(--accent);
  text-decoration: none;
}

.dash-main ul a.is-active,
.dash-main nav a.is-active,
.dash-main ul a[aria-current],
.dash-main nav a[aria-current] {
  background: var(--tint);
  color: var(--navy);
  border-left-color: var(--navy);
  font-weight: 700;
}

/* =====================================================================
   PAGE PARAMÈTRES : Layout, Sous-navigation et UX Premium
   ===================================================================== */

/* 1. Grille principale : Sidebar des groupes à gauche, contenu à droite */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}

/* 2. Sidebar des groupes (sticky pour rester visible au scroll) */
.settings-sidebar {
  position: sticky;
  top: calc(var(--dash-total) + 24px);
  padding-right: 16px;
}
.settings-sidebar .dash-nav-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 12px;
  padding-left: 12px;
}

/* 3. Liens de navigation des groupes */
.settings-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--line);
}
.settings-nav-item a {
  display: block;
  padding: 10px 12px 10px 16px;
  margin-left: -2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  transition: all var(--transition-fast);
}
.settings-nav-item a:hover {
  background: var(--bg-alt);
  color: var(--navy);
  border-left-color: var(--line-strong);
}
.settings-nav-item.is-active a {
  background: var(--tint);
  color: var(--navy);
  font-weight: 650;
  border-left-color: var(--accent);
}

/* 4. Interrupteur (Toggle Switch) moderne style iOS/SaaS */
.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.toggle-wrapper:last-child { border-bottom: 0; }
.toggle-info { flex: 1; padding-right: 20px; }
.toggle-info label { font-weight: 650; color: var(--navy); cursor: pointer; display: block; margin-bottom: 4px; }
.toggle-info .hint { font-size: 13.5px; color: var(--muted); margin: 0; }

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex: none;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--line-strong);
  transition: .3s cubic-bezier(.4,0,.2,1);
  border-radius: 24px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(.4,0,.2,1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }
.toggle-switch input:focus-visible + .toggle-slider { outline: 2px solid var(--blue); outline-offset: 2px; }

/* 5. UX : État de chargement du formulaire */
.form.is-saving button[type="submit"] {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.form.is-saving button[type="submit"]::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive : empiler sur mobile */
@media (max-width: 860px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-sidebar { position: static; padding-right: 0; margin-bottom: 24px; }
  .settings-nav { border-left: 0; display: flex; flex-wrap: wrap; gap: 8px; }
  .settings-nav-item a { margin-left: 0; border-left: 1px solid var(--line); border-radius: 8px; }
}
.row-menu{position:relative;display:inline-block}
.row-menu-panel{display:none;position:absolute;right:0;top:calc(100% + 6px);z-index:40;min-width:170px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-lg);padding:6px}
.row-menu.open .row-menu-panel{display:block}
.row-menu-panel form{margin:0}
.row-menu-panel button{display:block;width:100%;text-align:left;padding:9px 12px;background:none;border:0;border-radius:6px;font-size:14px;font-weight:500;color:var(--body);cursor:pointer}
.row-menu-panel button:hover{background:var(--bg-alt);color:var(--navy)}
.row-menu-panel button.danger{color:var(--red-600)}
.row-menu-panel button.danger:hover{background:#FBEFED}
