/* =====================================================================
   site.css — feuille de style UNIQUE de formation.ivart.net
   Accueil (accueil.php) · Catalogue (/Catalogue/) · Espace apprenant (/Apprenant/)
   + administration (/adminperso/apprenants.php, via le gabarit apprenant)

   Options d'affichage (boutons Thème / Contraste / A+), posées sur <html> :
     data-theme="light|dark"   (absent = suit le réglage du système)
     data-contraste="eleve"
     data-taille="grand|tres-grand"
   Choix mémorisés dans le navigateur (clé « fpi_affichage »), communs aux 3 espaces.

   NB : /_commun/theme.css reste en place pour l'ancien /index.php (ne pas supprimer).
   ===================================================================== */

/* ---------- Police (hébergée sur le site, aucun appel externe) ---------- */
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/_polices/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/_polices/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* =====================================================================
   1. COULEURS — modifier ici = modifier partout
   ===================================================================== */
:root {
  color-scheme: light;
  --fond: #f6f5f2;          /* fond de page */
  --surface: #ffffff;       /* cartes, en-tête */
  --surface-2: #eef1f4;     /* boutons d'option, en-têtes de tableau */
  --texte: #1d2329;
  --texte-2: #56616c;       /* texte secondaire (≥ 4,5:1 sur le fond) */
  --bord: #dcdad3;
  --accent: #1f5f8b;        /* liens, boutons, repères */
  --accent-fort: #174a6c;   /* survol */
  --accent-texte: #ffffff;  /* texte sur fond accent */
  --accent-doux: #e6eef5;   /* fonds légers, pastilles */
  --vert: #1b7f45;          /* action « apprenant » */
  --vert-texte: #ffffff;
  --vert-doux: #e3f3ea;
  --etoile: #e0a100; --etoile-off: #d9d6cf;
  --alerte: #5c4400; --alerte-fond: #fff3cd; --alerte-bord: #f0d58a;
  --nouveau: #9a3412; --nouveau-fond: #fdeee4;
  --erreur: #a1201b; --erreur-fond: #fbe9e7;
  --succes: #1e6b34; --succes-fond: #e5f3e8;
  --formateur: #6b3fa0; --formateur-fond: #f1eafa;
  --focus: #c2410c;
  --img-filtre: none;       /* adresse mail affichée en image */
  --ombre: 0 1px 2px rgb(29 35 33 / .06), 0 4px 14px rgb(29 35 33 / .05);
  --rayon: 12px;
  --largeur: 64rem;         /* largeur commune : en-tête, contenu, pied */
  --police: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --echelle: 100%;          /* bouton A+ */
}

/* Thème sombre : automatique (système) ou forcé */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fond: #14181c; --surface: #1d2329; --surface-2: #25303a;
    --texte: #e8ecef; --texte-2: #9fabb6; --bord: #313a44;
    --accent: #5fa8d8; --accent-fort: #8cc3e6; --accent-texte: #0d1216; --accent-doux: #1f2c38;
    --vert: #4cbb7f; --vert-texte: #0b1a11; --vert-doux: #17301f;
    --etoile: #f2b928; --etoile-off: #3a434c;
    --alerte: #f3dc9b; --alerte-fond: #3d3214; --alerte-bord: #5a4c1f;
    --nouveau: #fdba8c; --nouveau-fond: #3a2418;
    --erreur: #ffaaa3; --erreur-fond: #3b1d1b;
    --succes: #9be0ad; --succes-fond: #1b3323;
    --formateur: #c9a7f2; --formateur-fond: #2a2136;
    --focus: #fdba74;
    --img-filtre: invert(1) hue-rotate(180deg) brightness(1.25);
    --ombre: 0 1px 2px rgb(0 0 0 / .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fond: #14181c; --surface: #1d2329; --surface-2: #25303a;
  --texte: #e8ecef; --texte-2: #9fabb6; --bord: #313a44;
  --accent: #5fa8d8; --accent-fort: #8cc3e6; --accent-texte: #0d1216; --accent-doux: #1f2c38;
  --vert: #4cbb7f; --vert-texte: #0b1a11; --vert-doux: #17301f;
  --etoile: #f2b928; --etoile-off: #3a434c;
  --alerte: #f3dc9b; --alerte-fond: #3d3214; --alerte-bord: #5a4c1f;
  --nouveau: #fdba8c; --nouveau-fond: #3a2418;
  --erreur: #ffaaa3; --erreur-fond: #3b1d1b;
  --succes: #9be0ad; --succes-fond: #1b3323;
  --formateur: #c9a7f2; --formateur-fond: #2a2136;
  --focus: #fdba74;
  --img-filtre: invert(1) hue-rotate(180deg) brightness(1.25);
  --ombre: 0 1px 2px rgb(0 0 0 / .3);
}

/* Contraste élevé (s'ajoute au thème clair ou sombre) */
:root[data-contraste="eleve"] {
  --fond: #ffffff; --surface: #ffffff; --surface-2: #ffffff;
  --texte: #000000; --texte-2: #000000; --bord: #000000;
  --accent: #00346b; --accent-fort: #001f40; --accent-texte: #ffffff; --accent-doux: #ffffff;
  --vert: #00521f; --vert-texte: #ffffff; --vert-doux: #ffffff;
  --etoile: #8a5a00; --etoile-off: #bbbbbb;
  --alerte: #000000; --alerte-fond: #ffffff; --alerte-bord: #000000;
  --nouveau: #7a1d00; --nouveau-fond: #ffffff;
  --formateur: #000000; --formateur-fond: #ffffff;
  --focus: #b00000; --img-filtre: grayscale(1) brightness(0); --ombre: none;
}
:root[data-contraste="eleve"][data-theme="dark"] {
  --fond: #000000; --surface: #000000; --surface-2: #000000;
  --texte: #ffffff; --texte-2: #ffffff; --bord: #ffffff;
  --accent: #ffe14d; --accent-fort: #fff3a3; --accent-texte: #000000; --accent-doux: #000000;
  --vert: #7dffa8; --vert-texte: #000000; --vert-doux: #000000;
  --etoile: #ffe14d; --etoile-off: #555555;
  --alerte: #ffffff; --alerte-fond: #000000; --alerte-bord: #ffffff;
  --nouveau: #ffb0a0; --nouveau-fond: #000000;
  --formateur: #ffffff; --formateur-fond: #000000;
  --focus: #00e5ff; --img-filtre: grayscale(1) invert(1) brightness(1.6);
}
@media (prefers-color-scheme: dark) {
  :root[data-contraste="eleve"]:not([data-theme="light"]) {
    --fond: #000000; --surface: #000000; --surface-2: #000000;
    --texte: #ffffff; --texte-2: #ffffff; --bord: #ffffff;
    --accent: #ffe14d; --accent-fort: #fff3a3; --accent-texte: #000000; --accent-doux: #000000;
    --vert: #7dffa8; --vert-texte: #000000; --vert-doux: #000000;
    --etoile: #ffe14d; --etoile-off: #555555;
    --alerte: #ffffff; --alerte-fond: #000000; --alerte-bord: #ffffff;
    --nouveau: #ffb0a0; --nouveau-fond: #000000;
    --formateur: #ffffff; --formateur-fond: #000000;
    --focus: #00e5ff; --img-filtre: grayscale(1) invert(1) brightness(1.6);
  }
}

/* Taille du texte : toute la page est en rem/em, donc tout grandit */
:root[data-taille="grand"] { --echelle: 115%; }
:root[data-taille="tres-grand"] { --echelle: 132%; }

/* =====================================================================
   2. BASE
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--echelle); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 400 1rem/1.6 var(--police);
}
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-fort); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.3rem; margin-top: 2em; }
h3 { font-size: 1.1rem; }
p { max-width: 75ch; }

.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--accent-texte); padding: .6em 1em; z-index: 10; }
.evitement:focus { left: 1rem; top: 1rem; }

/* =====================================================================
   3. EN-TÊTE COMMUN + options d'affichage
   ===================================================================== */
.entete { background: var(--surface); border-bottom: 1px solid var(--bord); }
.entete-int { max-width: var(--largeur); margin: 0 auto; padding: .8rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.marque { text-decoration: none; color: var(--texte); display: flex; flex-direction: column; }
.marque:hover { color: var(--texte); }
.marque:hover .marque-titre { text-decoration: underline; }
.marque-titre { font-weight: 700; font-size: 1.1rem; }
.marque-sous { font-size: .8rem; color: var(--texte-2); }
.outils { display: flex; gap: .35rem; flex-wrap: wrap; }
.outil {
  font: inherit; font-size: .82rem; display: inline-flex; align-items: center; gap: .35em;
  background: var(--surface-2); color: var(--texte); border: 1px solid var(--bord);
  border-radius: 999px; padding: .3em .8em; cursor: pointer; min-height: 2.25rem;
}
.outil:hover { border-color: var(--accent); }
.ico { width: 1.05em; height: 1.05em; fill: currentColor; stroke: currentColor; flex: none; }
.ico-txt { font-weight: 700; }
.outil[aria-pressed="true"] { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }

/* Bandeau « Mode formateur » (espace apprenant) */
.bandeau-formateur { background: var(--formateur-fond); border-top: 3px solid var(--formateur); color: var(--texte); font-size: .9rem; }
.bandeau-formateur .entete-int { padding-top: .45rem; padding-bottom: .45rem; }
.bandeau-formateur p { margin: 0; }
.bandeau-formateur strong { color: var(--formateur); }
.bandeau-liens { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; }
.bandeau-liens form { margin: 0; }
.bandeau-liens .btn-lien { font-size: 1em; color: var(--texte); }

/* =====================================================================
   4. MISE EN PAGE COMMUNE
   ===================================================================== */
.page { max-width: var(--largeur); margin: 0 auto; padding: 2rem 1rem 3rem; }
.page:focus { outline: none; }
.chapeau { color: var(--texte-2); font-size: 1.05rem; margin-top: 0; }
.fil { margin: 0 0 1.25rem; font-size: .92rem; }
.fil a { font-weight: 700; text-decoration: none; }
.fil a:hover { text-decoration: underline; }
.aide { color: var(--texte-2); font-size: .88rem; margin: .5em 0 0; }
.vide { color: var(--texte-2); font-style: italic; }

.pied { max-width: var(--largeur); margin: 0 auto; padding: 1.5rem 1rem 2.5rem; font-size: .85rem; color: var(--texte-2); border-top: 1px solid var(--bord); }
.pied p { margin: .3em 0; max-width: none; text-align: center; }
.pied-contact { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; font-size: .95rem; }
.pied-note { text-align: center; }

/* Messages et encadrés */
.message { border-radius: var(--rayon); padding: .8em 1em; margin-bottom: 1.5rem; border: 1px solid; max-width: none; }
.message-erreur { background: var(--erreur-fond); color: var(--erreur); }
.message-succes { background: var(--succes-fond); color: var(--succes); }
.message-info { background: var(--accent-doux); color: var(--texte); border-color: var(--bord); }
.message-alerte { background: var(--alerte-fond); color: var(--alerte); border-color: var(--alerte-bord); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; font: inherit; font-weight: 700; text-decoration: none; border-radius: 10px; padding: .6em 1.2em; cursor: pointer; border: 2px solid transparent; min-height: 2.75rem; }
.btn-primaire { background: var(--accent); color: var(--accent-texte); }
.btn-primaire:hover { background: var(--accent-fort); color: var(--accent-texte); }
.btn-vert { background: var(--vert); color: var(--vert-texte); }
.btn-vert:hover { filter: brightness(1.08); color: var(--vert-texte); }
.btn-secondaire { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn-secondaire:hover { background: var(--accent-doux); color: var(--accent-fort); }
.btn-danger { background: var(--erreur); color: #fff; }
.btn-danger:hover { filter: brightness(.9); color: #fff; }
.btn-lien { font: inherit; font-size: .88rem; background: none; border: 0; padding: 0; color: var(--texte-2); text-decoration: underline; cursor: pointer; }
.btn-lien:hover { color: var(--erreur); }
.btn-mini { display: inline-flex; align-items: center; gap: .35em; font: inherit; font-size: .8rem; font-weight: 700; text-decoration: none; color: var(--accent); background: var(--surface); border: 1px solid var(--bord); border-radius: 6px; padding: .3em .7em; cursor: pointer; min-height: 2rem; white-space: nowrap; }
.btn-mini:hover { border-color: var(--accent); }
.btn-mini.btn-danger { background: var(--surface); color: var(--erreur); }
.btn-mini.btn-danger:hover { border-color: var(--erreur); }
.btn-mini-discret { color: var(--texte-2); }
.btn-mini-formateur { color: var(--formateur); border-color: var(--formateur); }
.boutons { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.boutons form { margin: 0; }

/* Pastilles */
.badge { display: inline-block; font-size: .78rem; font-weight: 700; border-radius: 999px; padding: .12em .65em; border: 1px solid var(--bord); margin: 0; }
.badge-niveau { background: var(--accent-doux); color: var(--accent-fort); border-color: transparent; }
.badge-nouveau { background: var(--nouveau-fond); color: var(--nouveau); border-color: currentColor; }
.badge-neutre { color: var(--texte-2); }

/* Étoiles (note sur 5) : <span class="etoiles" style="--pct:88%"> */
.etoiles { position: relative; display: inline-block; letter-spacing: 2px; color: var(--etoile-off); line-height: 1; white-space: nowrap; }
.etoiles::before { content: "★★★★★"; }
.etoiles::after { content: "★★★★★"; position: absolute; left: 0; top: 0; color: var(--etoile); width: var(--pct, 0%); overflow: hidden; }

/* Adresse mail en image + bouton « Copier l'adresse » */
.mail { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .6rem; vertical-align: middle; }
.mail a { display: inline-block; line-height: 0; padding: 3px 0; border-bottom: 1px solid var(--accent); }
.mail img { display: block; filter: var(--img-filtre); }
.btn-copier { font: inherit; font-size: .8rem; cursor: pointer; padding: .2em .8em; border-radius: 6px; background: transparent; color: var(--accent); border: 1px solid var(--bord); min-height: 2rem; }
.btn-copier:hover { border-color: var(--accent); }

/* =====================================================================
   5. CARTES (communes aux 3 espaces)
   ===================================================================== */
.cartes { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.carte { position: relative; background: var(--surface); border: 1px solid var(--bord); border-top: 4px solid var(--accent); border-radius: var(--rayon); padding: 1.1rem 1.2rem 1.2rem; box-shadow: var(--ombre); transition: border-color .15s, transform .15s; }
.carte:hover { border-color: var(--accent); transform: translateY(-2px); }
.carte:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.carte-titre { font-size: 1.15rem; margin: .1em 0 .45em; }
.carte-titre a { color: var(--texte); text-decoration: none; }
.carte-titre a::after { content: ""; position: absolute; inset: 0; } /* toute la carte est cliquable */
.carte-titre a:focus-visible { outline: none; }
.carte-domaine { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.carte-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; margin: 0 0 .5em; font-size: .88rem; color: var(--texte-2); }
.carte .badge-nouveau, .carte .badge-neutre { margin-top: .4em; }
.carte-sans-fiche { border-top-color: var(--bord); opacity: .85; }
.code-cnfpt { font-family: var(--mono); font-size: .85em; color: var(--texte-2); }

/* Panneau : bloc de contenu encadré */
.panneau { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.2rem 1.4rem; margin: 0 0 1.25rem; box-shadow: var(--ombre); }
.panneau > h2:first-child, .panneau h2 { margin-top: 0; font-size: 1.15rem; }
.panneau-tirets { border-style: dashed; box-shadow: none; }

/* =====================================================================
   6. ACCUEIL (accueil.php)
   ===================================================================== */
.presentation { display: flex; gap: 1.25rem; align-items: center; margin-bottom: 1.5rem; }
.photo { width: 6rem; height: 6rem; border-radius: 50%; flex: none; object-fit: cover;
         background: var(--accent); color: var(--accent-texte); display: grid; place-items: center;
         font-size: 2.1rem; font-weight: 700; letter-spacing: 1px; }
img.photo { border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--bord); }
.presentation h1 { margin: 0; }
.metier { color: var(--accent); font-weight: 700; margin: .2em 0 0; }
.linkedin { display: inline-flex; align-items: center; gap: .4em; margin-top: .5rem; font-size: .9rem; color: var(--texte-2); text-decoration: none; }
.linkedin svg { width: 1.1em; height: 1.1em; flex: none; color: var(--accent); }
.linkedin:hover, .linkedin:focus-visible { color: var(--accent); text-decoration: underline; }
.accroche { margin: 0 0 .5rem; font-size: 1.05rem; }
.profil { color: var(--texte-2); margin: 0 0 1.5rem; }

.note-globale { display: inline-flex; align-items: center; gap: .6rem; flex-wrap: wrap;
                background: var(--surface); border: 1px solid var(--bord); border-radius: 999px;
                padding: .35rem 1rem; margin-bottom: 1.75rem; font-size: .95rem; }
.note-globale .etoiles { font-size: 1.15rem; }
.note-globale small { color: var(--texte-2); }

.portes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.porte { display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem; }
.porte h2 { margin: .4rem 0 0; font-size: 1.3rem; }
.porte h2 a { color: var(--texte); text-decoration: none; }
.porte h2 a::after { content: ""; position: absolute; inset: 0; }
.porte h2 a:focus-visible { outline: none; }
.porte p { margin: 0; color: var(--texte-2); }
.porte .btn { margin-top: auto; align-self: flex-start; }
.porte .aide { margin-top: .25rem; }
.porte-ico { width: 3.25rem; height: 3.25rem; border-radius: 12px; display: grid; place-items: center; }
.porte-ico svg { width: 1.75rem; height: 1.75rem; }
.porte-apprenant { border-top-color: var(--vert); }
.porte-apprenant:hover { border-color: var(--vert); }
.porte-apprenant .porte-ico { background: var(--vert-doux); color: var(--vert); }
.porte-recruteur .porte-ico { background: var(--accent-doux); color: var(--accent); }

/* =====================================================================
   7. CATALOGUE (Catalogue/index.php et fiche.php)
   ===================================================================== */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; }
.hero h1 { margin: 0 0 .25rem; font-size: 1.65rem; }
.hero p { margin: 0; color: var(--texte-2); }
.hero-liens { margin-top: .9rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.hero-liens > a { font-weight: 700; text-decoration: none; }
.score { text-align: center; min-width: 13rem; padding-left: 1.5rem; border-left: 1px solid var(--bord); }
.score-chiffre { font-size: 2.75rem; font-weight: 700; line-height: 1; }
.score-chiffre span { font-size: 1.25rem; color: var(--texte-2); }
.score .etoiles { font-size: 1.6rem; margin: .35rem 0; }
.score small { color: var(--texte-2); display: block; line-height: 1.4; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .75rem; margin: 0 0 1.75rem; padding: 0; list-style: none; }
.kpi { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: .9rem; text-align: center; }
.kpi b { display: block; font-size: 1.5rem; }
.kpi span { color: var(--texte-2); font-size: .88rem; }

.filtres { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; padding: 0; list-style: none; }
.filtres a { display: inline-flex; align-items: center; min-height: 2.25rem; border: 1px solid var(--bord); background: var(--surface); color: var(--texte); border-radius: 999px; padding: .3em .9em; font-size: .88rem; text-decoration: none; }
.filtres a:hover { border-color: var(--accent); }
.filtres a[aria-current="page"] { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); font-weight: 700; }

.carte-cat { display: flex; flex-direction: column; }
.carte-cat ul { margin: 0 0 1rem; padding-left: 1.15rem; font-size: .9rem; }
.carte-cat li { margin: .2em 0; }
.carte-cat .contexte { color: var(--texte-2); font-size: .82rem; font-style: italic; margin: 0 0 .5rem; }
.btn-fiche { margin-top: auto; justify-content: space-between; width: 100%; }
.btn-fiche .note-mini { display: inline-flex; align-items: center; gap: .4em; font-weight: 400; font-size: .85rem; white-space: nowrap; }
.btn-fiche .etoiles { --etoile-off: color-mix(in srgb, currentColor 35%, transparent); }
.carte-sur-mesure { border-style: dashed; border-top-style: dashed; background: transparent; box-shadow: none; }
.carte-sur-mesure .btn { margin-top: auto; }

/* Formation « À venir » ("statut": "a_venir" dans la fiche JSON) : ruban en coin */
.carte-a-venir { position: relative; overflow: hidden; }
.carte-a-venir > .carte-domaine, .carte-a-venir > .carte-titre, .carte-a-venir > h1 { padding-right: 3.2rem; }
.ruban-avenir { position: absolute; top: 1.15rem; right: -2.6rem; width: 10rem; margin: 0; transform: rotate(45deg);
  background: #b45309; color: #fff; text-align: center; font-size: .74rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: .28em 0; box-shadow: 0 1px 3px rgba(0,0,0,.25); pointer-events: none; z-index: 1; }
:root[data-contraste="eleve"] .ruban-avenir { background: var(--texte); color: var(--surface); box-shadow: none; }
.encart-avenir { display: flex; gap: .5em; align-items: flex-start; max-width: none; margin: .1em 0 .9em; padding: .6em .9em;
  background: #fff4e5; color: #7c2d12; border: 1px solid #f0b37a; border-radius: var(--rayon); font-size: .95rem; line-height: 1.45; }
.encart-avenir svg { flex: none; margin-top: .12em; }
:root[data-theme="dark"] .encart-avenir { background: #33210f; color: #fdba74; border-color: #7c4a1a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .encart-avenir { background: #33210f; color: #fdba74; border-color: #7c4a1a; } }
:root[data-contraste="eleve"] .encart-avenir { background: var(--surface); color: var(--texte); border: 2px solid var(--texte); }

/* Fiche formation */
.fiche-haut { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.fiche-haut .fil { margin: 0; }
.fiche-titre h1 { margin: .2em 0 .25em; font-size: 1.65rem; }
.fiche-ref { color: var(--texte-2); font-size: .9rem; margin: 0; }
.fiche-note { display: flex; align-items: center; gap: .6rem; margin-top: .75rem; flex-wrap: wrap; }
.fiche-note b { font-size: 1.35rem; }
.fiche-note .etoiles { font-size: 1.25rem; }
.fiche-note small { color: var(--texte-2); }
dl.infos { display: grid; grid-template-columns: 11rem 1fr; gap: .5rem 1rem; margin: 0; }
dl.infos dt { color: var(--texte-2); }
dl.infos dd { margin: 0; }
.panneau ul { margin: 0; padding-left: 1.25rem; }
.deroule { width: 100%; border-collapse: collapse; font-size: .95rem; }
.deroule th, .deroule td { text-align: left; padding: .55em .65em; border-bottom: 1px solid var(--bord); vertical-align: top; }
.deroule th { color: var(--texte-2); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.deroule .duree { white-space: nowrap; text-align: right; }
.deroule tr.jour td { background: var(--surface-2); font-weight: 700; }
.deroule .obj { color: var(--texte-2); font-size: .88rem; display: block; }
.colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.note-bas { color: var(--texte-2); font-size: .9rem; margin: .75rem 0 0; }

/* =====================================================================
   8. ESPACE APPRENANT
   ===================================================================== */
.accueil { max-width: 34rem; margin: 2rem auto 0; background: var(--surface); border: 1px solid var(--bord); border-radius: 14px; padding: 2rem 1.5rem; box-shadow: var(--ombre); }
.form-code label { display: block; font-weight: 700; margin-bottom: .35em; }
.form-ligne { display: flex; gap: .5rem; flex-wrap: wrap; }
.form-code input {
  flex: 1 1 12rem; font: inherit; font-size: 1.15em; letter-spacing: .12em; text-transform: uppercase;
  font-family: var(--mono);
  padding: .55em .75em; border: 2px solid var(--bord); border-radius: 8px; background: var(--fond); color: var(--texte); min-width: 0;
}
.form-code input::placeholder { text-transform: none; letter-spacing: .05em; color: var(--texte-2); opacity: .7; }
.form-code input:focus { border-color: var(--accent); }

/* Code masqué (étoiles) + bouton œil — utile quand l'écran est vidéoprojeté */
.champ-masque { position: relative; flex: 1 1 12rem; display: flex; min-width: 0; }
.champ-masque input { flex: 1 1 auto; width: 100%; padding-right: 3.2rem; }
.voir-code {
  position: absolute; right: .3rem; top: 50%; transform: translateY(-50%);
  width: 2.6rem; height: 2.6rem; display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 6px; color: var(--texte-2); cursor: pointer;
}
.voir-code:hover { color: var(--accent); background: var(--surface-2); }
.voir-code svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.voir-code .oeil-barre, .voir-code[aria-pressed="true"] .oeil-ouvert { display: none; }
.voir-code[aria-pressed="true"] .oeil-barre { display: block; }
.voir-code[aria-pressed="true"] { color: var(--accent); }

.case-partage { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; align-items: start; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--bord); }
.case-partage input { width: 1.35rem; height: 1.35rem; margin: .15rem 0 0; accent-color: var(--accent); cursor: pointer; }
.case-partage label { font-weight: 700; cursor: pointer; }
.case-partage .aide { grid-column: 2; margin: 0; }
.encart-partage { background: var(--nouveau-fond); border: 1px solid var(--nouveau); border-radius: var(--rayon); padding: .8rem 1rem; margin: 1rem 0 0; }
.encart-partage p { margin: 0 0 .4em; }
.encart-partage form { margin: 0; }
.encart-partage .btn-lien { color: var(--texte); font-weight: 700; }

.ajout, .suite { margin-top: 2.5rem; }
.ajout { background: var(--surface); border: 1px dashed var(--bord); border-radius: var(--rayon); padding: 1.2rem; }
.ajout h2 { margin-top: 0; font-size: 1.1rem; }
.liste-suite { padding-left: 1.2em; }
.liste-suite li { margin: .3em 0; }
.groupe-domaine { font-size: 1.05rem; color: var(--texte-2); text-transform: uppercase; letter-spacing: .07em; margin: 2rem 0 0; }
.groupe-domaine + .cartes { margin-top: .75rem; }
.groupe-domaine + .cartes .carte-domaine { display: none; }

/* Vue formateur des cartes : ruban « À venir » (même style que le catalogue) + pictos des supports */
.carte-ruban > .carte-domaine, .carte-ruban > .carte-titre { padding-right: 3.2rem; }
.ruban-cadre { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.filtre-nb { font-weight: 400; }
.supports-zone { position: relative; z-index: 2; margin-top: .75rem; padding-top: .55rem; border-top: 1px dashed var(--bord); }
.vue-formateur { display: flex; align-items: center; justify-content: space-between; gap: .5em; max-width: none; margin: 0 0 .4rem; font-size: .74rem; font-weight: 700; color: var(--formateur); }
.vue-formateur > span:first-child { display: inline-flex; align-items: center; gap: .3em; }
.vue-formateur svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.supports { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .15rem; }
.support { position: relative; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 6px; border: 0; }
.support svg { width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.support-ok { background: var(--succes-fond); color: var(--succes); }
a.support-ok:hover { background: var(--succes); color: var(--surface); }
.support-absent { color: var(--texte-2); background: var(--surface-2); }
.support-absent svg { stroke-width: 1.5; opacity: .75; }
.support-revoir { background: var(--alerte-fond); color: var(--alerte); }
a.support-absent:hover { color: var(--formateur); }
a.support-revoir:hover { background: var(--alerte); color: var(--alerte-fond); }
/* Diaporama : images citées dans le .md mais absentes (marron, prioritaire sur l'ambre) */
.support-images { background: #f1e4d8; color: #6b3a1a; }
a.support-images:hover { background: #6b3a1a; color: #f1e4d8; }
:root[data-theme="dark"] .support-images { background: #3b2a1f; color: #e3b98f; }
:root[data-theme="dark"] a.support-images:hover { background: #e3b98f; color: #3b2a1f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .support-images { background: #3b2a1f; color: #e3b98f; }
  :root:not([data-theme="light"]) a.support-images:hover { background: #e3b98f; color: #3b2a1f; }
}
/* Info-bulle au survol et au clavier (data-bulle) */
.support::after { content: attr(data-bulle); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  white-space: normal; width: max-content; max-width: 17rem; text-align: left; font-size: .76rem; font-weight: 700; line-height: 1.3; padding: .35em .6em; border-radius: 6px;
  background: var(--texte); color: var(--surface); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s; z-index: 5; }
.support:hover::after, .support:focus-visible::after { opacity: 1; visibility: visible; }
.supports li:first-child .support::after { left: 0; transform: none; }
.supports li:nth-child(n+6) .support::after { left: auto; right: 0; transform: none; }
.carte:has(.support:hover), .carte:has(.support:focus-visible) { z-index: 3; }
:root[data-contraste="eleve"] .support { border: 2px solid var(--texte); }
:root[data-contraste="eleve"] .support-absent { border-style: dashed; }
:root[data-contraste="eleve"] .support-absent svg { opacity: 1; }
:root[data-contraste="eleve"] .support-revoir { border-style: double; border-width: 4px; }
:root[data-contraste="eleve"] .support-images { background: var(--surface); color: var(--texte); border-style: dotted; border-width: 3px; }
/* Page formation : zone « Relecture et tests » */
.relecture h2 { font-size: 1.05rem; color: var(--formateur); margin: .7rem 0 .4rem; }
.relecture p { margin: .3em 0; }
.relecture .boutons { margin-top: .6rem; }
.rubrique-formateur.relecture-ok { border-left-color: var(--succes); }
.relecture-ok h2 { color: var(--succes); }
.rubrique-formateur.relecture-revoir { border-left-color: var(--alerte); background: var(--alerte-fond); }
.relecture-revoir h2, .relecture-revoir strong { color: var(--alerte); }
.rubrique[id], #t-relecture { scroll-margin-top: 1rem; }
:root[data-contraste="eleve"] .support-ok { background: var(--texte); color: var(--surface); border-color: var(--texte); }

/* Page d'une formation */
.fiche-entete { border-bottom: 1px solid var(--bord); padding-bottom: 1.25rem; }
.fiche-entete h1 { margin: .15em 0 .4em; }
.actions-fiche { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; }
.actions-fiche:empty { display: none; }
.rubrique { margin: 1.5em 0 .5em; color: var(--texte-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.rubrique-formateur { border-left: 4px solid var(--formateur); background: var(--formateur-fond); border-radius: 8px; padding: .1rem .8rem .8rem; margin: 1rem 0; }
.rubrique-formateur .rubrique { color: var(--formateur); }
/* Au_Formateur → « Modifiables » : zone repliable sous les autres fichiers */
.sous-liste { margin-top: .6rem; border-top: 1px dashed var(--formateur); padding-top: .4rem; }
.sous-liste > summary { cursor: pointer; display: flex; align-items: center; gap: .5em; padding: .45em .2em; font-weight: 700;
  color: var(--formateur); list-style: none; border-radius: 6px; }
.sous-liste > summary::-webkit-details-marker { display: none; }
.sous-liste > summary::before { content: "▸"; display: inline-block; width: 1em; transition: transform .15s; }
.sous-liste[open] > summary::before { transform: rotate(90deg); }
.sous-liste > summary:hover { background: color-mix(in srgb, var(--formateur) 10%, transparent); }
.sous-liste > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sous-liste-nb { font-weight: 400; color: var(--texte-2); font-size: .9em; }
.sous-liste > .fichiers { margin: .3rem 0 0 1.2rem; }
@media (prefers-reduced-motion: reduce) { .sous-liste > summary::before { transition: none; } }
.fichiers { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.fichier { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--bord); border-radius: 8px; padding: .6rem .8rem; flex-wrap: wrap; }
.fichier:hover { border-color: var(--accent); }
.fichier-nom { font-weight: 700; flex: 1 1 12rem; text-decoration: none; color: var(--texte); }
.fichier-nom:hover { color: var(--accent); text-decoration: underline; }
.fichier-actions { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.fichier-info { font-size: .8rem; color: var(--texte-2); white-space: nowrap; }
.ext { flex: none; min-width: 3.1rem; text-align: center; font: 700 .7rem/1 var(--mono); padding: .5em .3em; border-radius: 5px; background: var(--surface-2); color: var(--texte-2); border: 1px solid var(--bord); }
.ext-pdf { color: #b42318; }
.ext-xlsx, .ext-xlsm, .ext-xls, .ext-ods, .ext-csv { color: #1d7044; }
.ext-docx, .ext-doc, .ext-odt { color: #1f5fae; }
.ext-pptx, .ext-ppsx, .ext-odp { color: #b4501a; }
.ext-web { color: var(--formateur); }
.ext-lien { color: var(--accent); border-color: var(--accent); }
:root[data-theme="dark"] .ext, :root[data-contraste="eleve"] .ext { color: var(--texte); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ext { color: var(--texte); } }
.objectifs li { margin: .3em 0; }
.jour { background: var(--surface); border: 1px solid var(--bord); border-radius: 8px; margin: .5rem 0; padding: 0 1rem; }
.jour summary { cursor: pointer; font-weight: 700; padding: .7rem 0; min-height: 2.75rem; }
.sequences { margin: 0 0 .8rem; padding-left: 1.4em; }
.sequences li { margin: .25em 0; }
.zone-retrait { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--bord); }
.retrouver { background: var(--accent-doux); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1rem 1.2rem; margin: 1.5rem 0 0; }
.retrouver h2 { margin: 0 0 .4em; font-size: 1.05rem; }
.retrouver p { margin: .3em 0; }
.code-retrouver { font-size: 1.1em; font-weight: 700; color: var(--accent-fort); letter-spacing: .08em; white-space: nowrap; }

/* Bordures renforcées en contraste élevé */
:root[data-contraste="eleve"] .carte,
:root[data-contraste="eleve"] .panneau,
:root[data-contraste="eleve"] .fichier,
:root[data-contraste="eleve"] .kpi,
:root[data-contraste="eleve"] .badge { border-width: 2px; }
:root[data-contraste="eleve"] .carte { border-top-width: 4px; }

/* =====================================================================
   9. ADMINISTRATION (adminperso/apprenants.php)
   ===================================================================== */
.onglets { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 2px solid var(--bord); margin: 1rem 0 1.5rem; }
.onglets a { padding: .55em 1em; text-decoration: none; color: var(--texte-2); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.onglets a:hover { color: var(--accent); }
.onglets a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.encart-succes { background: var(--succes-fond); border: 1px solid var(--succes); border-radius: var(--rayon); padding: 1.1rem 1.2rem; margin: 0 0 1.5rem; }
.encart-succes h2 { margin-top: 0; font-size: 1.1rem; color: var(--succes); }
.form-grille { display: grid; gap: .8rem 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); align-items: start; margin-top: .8rem; }
.champ label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .25em; }
.champ-large { grid-column: 1 / -1; }
.champ-bouton { align-self: end; }
.champ input, .champ select, .filtre select {
  width: 100%; font: inherit; padding: .5em .65em; border: 2px solid var(--bord); border-radius: 8px;
  background: var(--fond); color: var(--texte); min-height: 2.75rem;
}
.champ input:focus, .champ select:focus, .filtre select:focus { border-color: var(--accent); }
.champ .aide { margin-top: .2em; }
.filtre { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0 1rem; }
.filtre label { font-weight: 700; }
.filtre select { width: auto; max-width: 100%; }
.table-defile { overflow-x: auto; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th, .tableau td { white-space: nowrap; text-align: left; padding: .55em .75em; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.tableau th { font-size: .82em; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-2); background: var(--surface-2); }
.tableau tr:last-child td { border-bottom: 0; }
.tableau .actions { display: flex; flex-wrap: nowrap; gap: .35rem; align-items: center; }
.tableau .actions form { margin: 0; }
.etat { font-weight: 700; font-size: .85em; }
.etat-ok { color: var(--succes); }
.etat-ko { color: var(--texte-2); }
.liste-simple { padding-left: 1.2em; margin: 0; }
.liste-simple li { margin: .3em 0; }
.journal { background: var(--surface-2); border: 1px solid var(--bord); border-radius: 8px; padding: .8rem 1rem; font-size: .78rem; line-height: 1.5; overflow-x: auto; max-height: 24rem; }
.partage { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1rem; margin: .5rem 0 .8rem; }
.partage-txt { flex: 1 1 16rem; min-width: 0; }
.partage-titre { margin: 0 0 .3em; font-weight: 700; }
.code-geant { display: block; font: 700 2.2em/1.2 var(--mono); letter-spacing: .12em; color: var(--accent-fort); margin: .1em 0 .2em; }
.lien-texte { font-family: var(--mono); font-size: .82em; word-break: break-all; color: var(--texte-2); margin: 0 0 .7em; }

/* Projection en salle */
.mode-projection .entete, .mode-projection .pied { display: none; }
.mode-projection .page { max-width: 72rem; padding-top: 3vh; }
.projection { text-align: center; }
.projection p { max-width: none; }
.proj-formation { font-size: 1.6em; font-weight: 700; color: var(--accent); margin: 0; }
.proj-titre { font-size: 2.6em; margin: .2em 0 .8em; }
.proj-etapes { display: inline-block; text-align: left; font-size: 2em; line-height: 1.5; padding-left: 1.3em; margin: 0; }
.proj-etapes li { margin: .5em 0; }
.proj-adresse { color: var(--accent-fort); }
.proj-etapes .code-geant { font-size: 2.4em; }
.proj-note { font-size: 1.3em; color: var(--texte-2); max-width: 46rem; margin: 2rem auto 0; }
.proj-actions { margin-top: 2.5rem; display: flex; gap: 1.2rem; justify-content: center; align-items: center; }
:fullscreen .proj-actions { display: none; }
/* Projection du questionnaire : tout tient dans la fenêtre, le QR code prend la place restante */
.proj-qr .page { height: 100vh; height: 100dvh; max-width: none; padding: 2vh 3vw; box-sizing: border-box;
  display: flex; flex-direction: column; overflow: hidden; }
.proj-qr .projection { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; }
.proj-qr .proj-formation { font-size: clamp(.95rem, 3vh, 1.6em); }
.proj-qr .proj-titre { font-size: clamp(1.2rem, 5.5vh, 2.6em); margin: .1em 0 .5em; }
.proj-sondage { flex: 1; min-height: 0; width: 100%; display: flex; gap: 4vw; justify-content: center; align-items: center; }
.qr-geant { height: 100%; aspect-ratio: 1 / 1; max-width: 55vw; line-height: 0; }
.qr-geant svg { width: 100%; height: 100%; display: block; }
.proj-qr .proj-sondage .proj-etapes { font-size: clamp(.95rem, 3.6vh, 1.8em); max-width: 32rem; padding-left: 1.2em; }
.proj-qr .proj-note { font-size: clamp(.85rem, 2.4vh, 1.3em); margin: 1.5vh auto 0; }
.proj-qr .proj-actions { margin-top: 1.5vh; }
@media (max-aspect-ratio: 1/1) {          /* écran en portrait : consignes sous le QR code */
  .proj-sondage { flex-direction: column; gap: 2vh; }
  .qr-geant { flex: 1 1 0; height: auto; min-height: 0; max-width: 92vw; }
  .proj-qr .proj-sondage .proj-etapes { font-size: clamp(.85rem, 2.4vh, 1.3em); }
}

/* =====================================================================
   10. PETITS ÉCRANS, ANIMATIONS, IMPRESSION
   ===================================================================== */
@media (max-width: 45rem) {
  .portes, .colonnes { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .score { border-left: 0; border-top: 1px solid var(--bord); padding: 1rem 0 0; }
  dl.infos { grid-template-columns: 1fr; }
  dl.infos dt { margin-top: .4rem; }
}
@media (max-width: 34rem) {
  h1 { font-size: 1.55rem; }
  .presentation { flex-direction: column; text-align: center; }
  .outil-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .accueil { padding: 1.5rem 1rem; }
  .fichier-info { width: 100%; padding-left: 3.85rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  :root, :root[data-theme], :root[data-contraste], :root[data-contraste][data-theme] {
    --fond: #fff; --surface: #fff; --surface-2: #f0f0f0; --texte: #000; --texte-2: #444; --bord: #ccc;
    --accent: #000; --img-filtre: none; --ombre: none; --echelle: 100%;
  }
  body { font-size: 11pt; }
  .entete, .outils, .evitement, .pied-contact, .message, .fil, .ajout, .zone-retrait, .no-print { display: none !important; }
  .pied { border: 0; padding: .5rem 0 0; }
  .carte, .panneau { box-shadow: none; }
  .page { padding: 0; max-width: none; }
  .panneau { border: 0; padding: 0 0 .75rem; break-inside: avoid; }
  .carte-a-venir { overflow: visible; }
  .encart-avenir { background: none; color: #000; border: 1px solid #000; }
  .sous-liste > .fichiers { display: grid !important; }
  .ruban-avenir { position: static; transform: none; display: inline-block; width: auto; padding: .1em .6em;
    background: none; color: #000; border: 1px solid #000; box-shadow: none; margin: 0 0 .4em; }
}
