/* =====================================================================
   THIER UNIVERS — PILOTAGE (4e pilier : diriger son entreprise)
   Feuille de style propre à cette page : elle ne touche à rien d'autre.
   Repères : nuit marine (fond), sarcelle (validé), ambre (tu es ici).
   ===================================================================== */

:root,
[data-theme="dark"] {
    --fond: #0c1a27;
    --surface: #12263a;
    --surface-2: #183049;
    --trait: #26435d;
    --texte: #e7eef5;
    --texte-doux: #93a9bd;
    --balise: #2ec4b6;
    --balise-fonce: #179a8e;
    --sur-balise: #04221f;
    --fanal: #f4b942;
    --alerte: #ff7b72;
    --grille: rgba(147, 169, 189, 0.07);
    --ombre: 0 18px 40px rgba(0, 0, 0, 0.35);
    --police-ui: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --police-lecture: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
    color-scheme: dark;
}

[data-theme="light"] {
    --fond: #f2f5f8;
    --surface: #ffffff;
    --surface-2: #e7eef4;
    --trait: #cdd8e2;
    --texte: #10212f;
    --texte-doux: #4c6378;
    --balise: #0f8f84;
    --balise-fonce: #0b7168;
    --sur-balise: #ffffff;
    --fanal: #b7791f;
    --alerte: #c53030;
    --grille: rgba(16, 33, 47, 0.05);
    --ombre: 0 12px 30px rgba(16, 33, 47, 0.08);
    color-scheme: light;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--fond);
    color: var(--texte);
    font-family: var(--police-ui);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

[hidden] {
    display: none !important;
}

a {
    color: var(--balise);
}

button {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--fanal);
    outline-offset: 3px;
    border-radius: 4px;
}

.visuellement-cache {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.evitement {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--fanal);
    color: #1a1204;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
}

.evitement:focus {
    top: 12px;
}

.conteneur {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 40px);
}

/* ---------- Barre du haut ---------- */
.barre {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--fond) 86%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--trait);
}

.barre-interieur {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 60px;
}

.barre-retour {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--texte-doux);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 10px 8px 4px;
    border-radius: 6px;
}

.barre-retour:hover {
    color: var(--texte);
}

.barre-retour svg {
    width: 18px;
    height: 18px;
}

.barre-nom {
    display: none;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.barre-nom.visible {
    display: inline;
}

.statut {
    margin-left: auto;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--trait);
    color: var(--texte-doux);
    white-space: nowrap;
}

.statut.admin {
    border-color: var(--fanal);
    color: var(--fanal);
}

.statut.abonne {
    border-color: var(--balise);
    color: var(--balise);
}

/* Sur téléphone, la barre tient sur une ligne : le titre rétrécit, le badge reste entier (v1.8) */
@media (max-width: 520px) {
    .barre-interieur { gap: 10px; }
    .barre-nom.visible { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .statut { flex: none; font-size: 0.72rem; padding: 4px 8px; white-space: nowrap; }
}

/* ---------- Boutons ---------- */
.bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.97rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.bouton-principal {
    background: var(--balise);
    color: var(--sur-balise);
}

.bouton-principal:hover {
    background: var(--balise-fonce);
}

.bouton-secondaire {
    background: transparent;
    border-color: var(--trait);
    color: var(--texte);
}

.bouton-secondaire:hover {
    border-color: var(--texte-doux);
}

.bouton[disabled],
.bouton[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}

.lien-retour {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    padding: 6px 0;
    color: var(--texte-doux);
    font-weight: 500;
    cursor: pointer;
}

.lien-retour:hover {
    color: var(--texte);
}

.lien-retour svg {
    width: 16px;
    height: 16px;
}

/* ---------- Chargement et messages ---------- */
.chargement {
    padding: 120px 0;
    text-align: center;
    color: var(--texte-doux);
}

.panneau-message {
    margin: 48px 0;
    padding: 28px;
    border: 1px solid var(--trait);
    border-radius: 10px;
    background: var(--surface);
    max-width: 640px;
}

.panneau-message h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.panneau-message p {
    margin: 0 0 18px;
    color: var(--texte-doux);
}

.panneau-message p:last-child {
    margin-bottom: 0;
}

/* =====================================================================
   VUE 1 : LE PARCOURS
   ===================================================================== */
.entete {
    position: relative;
    padding: 56px 0 44px;
    background-image:
        linear-gradient(var(--grille) 1px, transparent 1px),
        linear-gradient(90deg, var(--grille) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: -1px -1px;
    border-bottom: 1px solid var(--trait);
}

.entete-titre {
    margin: 0;
    font-size: clamp(3.2rem, 11vw, 7rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 0.92;
}

.entete-phrase {
    margin: 14px 0 0;
    font-family: var(--police-lecture);
    font-size: clamp(1.15rem, 2.4vw, 1.45rem);
    color: var(--texte-doux);
    max-width: 34ch;
}

/* La route : 10 balises reliées, une par formation */
.route {
    list-style: none;
    margin: 52px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(var(--nb-bornes, 10), minmax(0, 1fr));
}

.borne {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.borne::before {
    content: '';
    position: absolute;
    top: 22px;
    right: 50%;
    width: 100%;
    height: 3px;
    background: var(--trait);
    transform-origin: left center;
}

.borne:first-child::before {
    display: none;
}

.borne.chemin-fait::before {
    background: var(--balise);
}

.route.anime .borne.chemin-fait::before {
    animation: tracer 0.45s ease-out both;
    animation-delay: calc(var(--rang, 0) * 80ms);
}

@keyframes tracer {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.borne-bouton {
    position: relative;
    z-index: 1;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--texte-doux);
    background:
        radial-gradient(closest-side, var(--fond) 82%, transparent 84% 100%),
        conic-gradient(var(--balise) calc(var(--pct, 0) * 1%), var(--trait) 0);
    cursor: pointer;
}

.borne.validee .borne-bouton {
    background: var(--balise);
    color: var(--sur-balise);
}

.borne.en-cours .borne-bouton {
    color: var(--texte);
}

.borne.preparation .borne-bouton {
    background: var(--fond);
    border: 2px dashed var(--trait);
    cursor: default;
}

.borne.actuelle .borne-bouton {
    box-shadow: 0 0 0 4px var(--fond), 0 0 0 7px var(--fanal);
}

.borne-bouton svg {
    width: 20px;
    height: 20px;
}

.borne-libelle {
    margin-top: 12px;
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--texte-doux);
    max-width: 11ch;
}

.borne.actuelle .borne-libelle {
    color: var(--texte);
    font-weight: 600;
}

.bilan {
    margin-top: 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 28px;
}

.bilan-texte {
    margin: 0;
    font-size: 1.05rem;
}

.bilan-texte strong {
    font-variant-numeric: tabular-nums;
}

.bilan-ici {
    color: var(--texte-doux);
    font-size: 0.95rem;
}

/* Le registre des formations */
.section-titre {
    margin: 52px 0 6px;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

.section-aide {
    margin: 0 0 20px;
    color: var(--texte-doux);
    max-width: 62ch;
}

/* Les formations en cartes (comme le catalogue des autres piliers) */
.cartes {
    list-style: none;
    margin: 0 0 64px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 22px;
}

.cartes-vide {
    grid-column: 1 / -1;
}

.carte {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--trait);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s;
}

.carte:hover {
    border-color: var(--balise);
    transform: translateY(-2px);
}

.carte:has(.carte-ouvrir:focus-visible) {
    outline: 2px solid var(--fanal);
    outline-offset: 3px;
}

.carte.validee {
    border-color: color-mix(in srgb, var(--balise) 55%, var(--trait));
}

.carte.preparation:hover {
    border-color: var(--trait);
    transform: none;
}

/* Couverture : la photo, ou un grand numéro sur fond sarcelle */
.carte-couverture {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid var(--trait);
    background:
        radial-gradient(120% 140% at 100% 100%, color-mix(in srgb, var(--balise) 30%, transparent) 0%, transparent 62%),
        linear-gradient(160deg, var(--surface-2), var(--surface));
}

/* « En préparation » : des hachures discrètes, comme un chantier */
.carte.preparation .carte-couverture {
    background: repeating-linear-gradient(135deg, var(--surface) 0 14px, var(--surface-2) 14px 28px);
}

.carte-numero {
    position: absolute;
    right: 12px;
    bottom: -0.2em;
    font-size: 6.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--balise);
    font-variant-numeric: tabular-nums;
    opacity: 0.92;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.3s;
}

.carte.preparation .carte-numero {
    color: var(--texte-doux);
    opacity: 0.45;
}

.carte-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.35s;
}

.carte.a-couverture .carte-image {
    opacity: 1;
}

.carte.a-couverture .carte-numero {
    opacity: 0;
}

/* Léger voile en haut de la photo pour garder l'étiquette lisible */
.carte.a-couverture .carte-couverture::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 45%);
    pointer-events: none;
}

.carte-etiquette {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    max-width: calc(100% - 110px);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #e7eef5;
    background: rgba(4, 16, 26, 0.74);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.carte-etiquette.validee {
    background: #2ec4b6;
    color: #04221f;
}

.carte-etiquette.en-cours,
.carte-etiquette.apercu {
    color: #f4b942;
}

[data-theme="light"] .carte-etiquette {
    color: #10212f;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 2px 8px rgba(16, 33, 47, 0.1);
}

[data-theme="light"] .carte-etiquette.validee {
    background: #0f8f84;
    color: #ffffff;
}

[data-theme="light"] .carte-etiquette.en-cours,
[data-theme="light"] .carte-etiquette.apercu {
    color: #8a5a12;
}

/* Boutons de l'admin (photo de couverture) */
.carte-admin {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: flex;
    gap: 6px;
}

.carte-admin-bouton {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(4, 16, 26, 0.72);
    color: #ffffff;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.carte-admin-bouton svg {
    width: 17px;
    height: 17px;
}

.carte-admin-bouton:hover {
    background: #2ec4b6;
    border-color: #2ec4b6;
    color: #04221f;
}

.carte-admin-bouton.retirer:hover {
    background: #ff7b72;
    border-color: #ff7b72;
    color: #ffffff;
}

/* Corps de la carte */
.carte-corps {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px 18px;
}

.carte-titre {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Le bouton du titre couvre toute la carte : une seule zone cliquable */
.carte-ouvrir {
    all: unset;
    cursor: pointer;
    font-weight: 700;
    color: var(--texte);
}

.carte-ouvrir::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.carte-rang {
    color: var(--balise);
}

.carte.preparation .carte-rang,
.carte.preparation .carte-ouvrir {
    color: var(--texte-doux);
}

.carte-resume {
    margin: 0;
    font-family: var(--police-lecture);
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--texte-doux);
}

.carte-compte {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--texte-doux);
}

.carte-progression {
    margin-top: auto;
    padding-top: 12px;
}

.carte-ligne {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 7px;
    font-size: 0.82rem;
    color: var(--texte-doux);
    font-variant-numeric: tabular-nums;
}

.carte-pourcentage {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--texte);
    white-space: nowrap;
}

.carte-quiz {
    margin: 8px 0 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--texte-doux);
}

.carte-quiz.reussi {
    color: var(--balise);
}

/* Suivi des membres (admin) */
.suivi-admin {
    margin-bottom: 72px;
}

.tableau-defilant {
    overflow-x: auto;
    border: 1px solid var(--trait);
    border-radius: 10px;
}

.tableau-suivi {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
    font-variant-numeric: tabular-nums;
}

.tableau-suivi th,
.tableau-suivi td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--trait);
    white-space: nowrap;
}

.tableau-suivi th {
    font-weight: 600;
    color: var(--texte-doux);
    background: var(--surface);
}

.tableau-suivi tr:last-child td {
    border-bottom: 0;
}

/* =====================================================================
   VUE 2 : UNE FORMATION
   ===================================================================== */
.formation-entete {
    padding: 28px 0 30px;
    border-bottom: 1px solid var(--trait);
}

.formation-rang {
    margin: 18px 0 4px;
    color: var(--texte-doux);
    font-size: 0.95rem;
}

.formation-titre {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.formation-resume {
    margin: 10px 0 0;
    font-family: var(--police-lecture);
    color: var(--texte-doux);
    font-size: 1.1rem;
    max-width: 60ch;
}

.formation-jauge {
    margin-top: 22px;
    max-width: 520px;
}

.formation-jauge p {
    margin: 8px 0 0;
    font-size: 0.92rem;
    color: var(--texte-doux);
    font-variant-numeric: tabular-nums;
}

.formation-corps {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 48px;
    padding: 36px 0 80px;
    align-items: start;
}

/* Sommaire */
.sommaire {
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    padding-right: 4px;
}

.sommaire-details > summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    padding: 12px 0;
}

.sommaire-details > summary::-webkit-details-marker {
    display: none;
}

.module-bloc {
    margin: 0 0 22px;
}

.module-titre {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--texte);
}

.module-objectif {
    margin: -4px 0 10px;
    font-size: 0.85rem;
    color: var(--texte-doux);
}

.sommaire-etapes {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--trait);
}

.sommaire-lien {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 8px 10px 8px 14px;
    margin-left: -2px;
    border: 0;
    border-left: 2px solid transparent;
    background: none;
    text-align: left;
    font-size: 0.92rem;
    color: var(--texte-doux);
    cursor: pointer;
    line-height: 1.4;
}

.sommaire-lien:hover {
    color: var(--texte);
}

.sommaire-lien[aria-current="step"] {
    border-left-color: var(--fanal);
    color: var(--texte);
    font-weight: 600;
    background: color-mix(in srgb, var(--fanal) 8%, transparent);
}

.sommaire-lien .pastille {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    border: 2px solid var(--trait);
    display: grid;
    place-items: center;
}

.sommaire-lien.faite .pastille {
    background: var(--balise);
    border-color: var(--balise);
    color: var(--sur-balise);
}

.pastille svg {
    width: 11px;
    height: 11px;
}

.sommaire-quiz {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    margin-top: 6px;
    padding: 14px 16px;
    border: 1px solid var(--trait);
    border-radius: 8px;
    background: var(--surface);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.sommaire-quiz:hover {
    border-color: var(--texte-doux);
}

.sommaire-quiz small {
    font-weight: 500;
    color: var(--texte-doux);
}

/* Leçon */
.lecon {
    min-width: 0;
    max-width: 72ch;
}

.lecon {
    scroll-margin-top: 80px;
}

[tabindex="-1"]:focus {
    outline: none;
}

.lecon-contenu .bloc-texte,
.encadre p {
    white-space: pre-line;
}

.lecon-reperes {
    margin: 0 0 8px;
    color: var(--texte-doux);
    font-size: 0.92rem;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
}

.lecon-titre {
    margin: 0 0 26px;
    font-size: clamp(1.6rem, 3.6vw, 2.15rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.lecon-contenu {
    font-family: var(--police-lecture);
    font-size: 1.125rem;
    line-height: 1.72;
}

.lecon-contenu > * {
    margin: 0 0 1.15em;
}

.lecon-contenu strong {
    font-weight: 600;
}

.bloc-titre {
    font-family: var(--police-ui);
    font-size: 1.28rem;
    letter-spacing: -0.01em;
    margin-top: 1.8em !important;
    line-height: 1.3;
}

.bloc-liste,
.bloc-etapes {
    padding-left: 1.4em;
}

.bloc-liste li,
.bloc-etapes li {
    margin-bottom: 0.45em;
}

.bloc-liste li::marker {
    color: var(--balise);
}

.bloc-etapes li::marker {
    color: var(--balise);
    font-family: var(--police-ui);
    font-weight: 700;
}

.encadre {
    padding: 18px 22px;
    border-radius: 8px;
    border-left: 4px solid var(--trait);
    background: var(--surface);
}

.encadre-nom {
    display: block;
    margin-bottom: 6px;
    font-family: var(--police-ui);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.encadre p,
.encadre ul {
    margin: 0;
}

.encadre ul {
    padding-left: 1.2em;
}

.encadre li + li {
    margin-top: 0.35em;
}

.bloc-definition {
    border-left-color: var(--balise);
}

.bloc-definition .encadre-nom {
    color: var(--balise);
    font-size: 1rem;
}

.bloc-retenir {
    border-left-color: var(--balise);
    background: color-mix(in srgb, var(--balise) 10%, var(--surface));
}

.bloc-retenir .encadre-nom {
    color: var(--balise);
}

.bloc-exemple {
    border-left-color: var(--fanal);
}

.bloc-exemple .encadre-nom {
    color: var(--fanal);
}

.bloc-exemple p {
    font-style: italic;
}

.bloc-attention {
    border-left-color: var(--alerte);
    background: color-mix(in srgb, var(--alerte) 8%, var(--surface));
}

.bloc-attention .encadre-nom {
    color: var(--alerte);
}

.bloc-formule {
    font-family: var(--police-ui);
    font-size: 1.12rem;
    font-weight: 600;
    text-align: center;
    padding: 18px 20px;
    border-radius: 8px;
    background: var(--surface-2);
    font-variant-numeric: tabular-nums;
}

.bloc-tableau {
    overflow-x: auto;
    border: 1px solid var(--trait);
    border-radius: 8px;
}

.bloc-tableau table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--police-ui);
    font-size: 0.95rem;
    line-height: 1.45;
}

.bloc-tableau th,
.bloc-tableau td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--trait);
}

.bloc-tableau th {
    background: var(--surface);
    font-weight: 600;
}

.bloc-tableau tr:last-child td {
    border-bottom: 0;
}

.bloc-lien a {
    font-family: var(--police-ui);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bloc-lien svg {
    width: 15px;
    height: 15px;
}

.lecon-vide {
    color: var(--texte-doux);
    font-style: italic;
}

/* Verrou (visiteurs et membres non abonnés) */
.verrou {
    padding: 28px;
    border: 1px dashed var(--trait);
    border-radius: 10px;
    background: var(--surface);
    font-family: var(--police-ui);
}

.verrou h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
}

.verrou p {
    margin: 0 0 18px;
    color: var(--texte-doux);
}

/* Validation et navigation */
.lecon-actions {
    margin-top: 40px;
    padding-top: 26px;
    border-top: 1px solid var(--trait);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.bouton-valider {
    min-height: 52px;
    padding: 12px 26px;
    font-size: 1.02rem;
    border-color: var(--balise);
    background: transparent;
    color: var(--balise);
}

.bouton-valider:hover {
    background: color-mix(in srgb, var(--balise) 12%, transparent);
}

.bouton-valider[aria-pressed="true"] {
    background: var(--balise);
    color: var(--sur-balise);
}

.bouton-valider svg {
    width: 20px;
    height: 20px;
}

.valider-aide {
    width: 100%;
    margin: -6px 0 0;
    font-size: 0.85rem;
    color: var(--texte-doux);
}

.lecon-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* =====================================================================
   VUE 3 : LE QUIZ
   ===================================================================== */
.quiz {
    max-width: 720px;
    padding: 28px 0 90px;
}

.quiz-titre {
    margin: 18px 0 6px;
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.quiz-sous-titre {
    margin: 0 0 30px;
    color: var(--texte-doux);
}

.quiz-question {
    border: 0;
    margin: 0;
    padding: 0;
}

.quiz-question legend {
    padding: 0;
    margin-bottom: 6px;
    color: var(--texte-doux);
    font-size: 0.95rem;
}

.quiz-enonce {
    margin: 0 0 22px;
    font-family: var(--police-lecture);
    font-size: 1.3rem;
    line-height: 1.5;
}

.choix-liste {
    display: grid;
    gap: 10px;
}

.choix {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--trait);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    line-height: 1.45;
}

.choix:hover {
    border-color: var(--texte-doux);
}

.choix input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choix-repere {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 50%;
    border: 2px solid var(--trait);
}

.choix input:checked + .choix-repere {
    border-color: var(--balise);
    background: radial-gradient(circle, var(--balise) 45%, transparent 50%);
}

.choix:has(input:checked) {
    border-color: var(--balise);
}

.choix input:focus-visible + .choix-repere {
    outline: 2px solid var(--fanal);
    outline-offset: 3px;
}

.quiz-pied {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
}

.quiz-jauge {
    margin-bottom: 28px;
}

.resultat-chiffre {
    margin: 10px 0 0;
    font-size: clamp(3.4rem, 12vw, 5.5rem);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.resultat-chiffre.reussi {
    color: var(--balise);
}

.resultat-chiffre.rate {
    color: var(--fanal);
}

.resultat-verdict {
    margin: 12px 0 30px;
    font-size: 1.12rem;
}

.corrections {
    list-style: none;
    margin: 0 0 32px;
    padding: 0;
    border-top: 1px solid var(--trait);
}

.correction {
    padding: 20px 0;
    border-bottom: 1px solid var(--trait);
}

.correction-question {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    display: flex;
    gap: 10px;
}

.correction-icone {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-top: 3px;
}

.correction.juste .correction-icone {
    color: var(--balise);
}

.correction.faux .correction-icone {
    color: var(--alerte);
}

.correction p:not(.correction-question) {
    margin: 4px 0 0 32px;
    font-size: 0.95rem;
}

.correction .doux {
    color: var(--texte-doux);
}

/* ---------- Annonces (messages temporaires) ---------- */
.annonces {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 50;
    display: grid;
    gap: 10px;
    width: min(92vw, 460px);
    pointer-events: none;
}

.annonce {
    padding: 14px 18px;
    border-radius: 8px;
    border-left: 4px solid var(--balise);
    background: var(--surface-2);
    color: var(--texte);
    box-shadow: var(--ombre);
    font-weight: 500;
}

.annonce.erreur {
    border-left-color: var(--alerte);
}

/* =====================================================================
   PETITS ÉCRANS
   ===================================================================== */
@media (max-width: 980px) {
    .formation-corps {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .sommaire {
        position: static;
        max-height: none;
        overflow: visible;
        border: 1px solid var(--trait);
        border-radius: 10px;
        padding: 0 16px;
        background: var(--surface);
    }

    .sommaire-details > summary::after {
        content: '+';
        float: right;
        font-weight: 700;
        color: var(--texte-doux);
    }

    .sommaire-details[open] > summary::after {
        content: '−';
    }

}

@media (max-width: 640px) {
    .entete {
        padding: 36px 0 32px;
    }

    .route {
        margin-top: 36px;
    }

    .borne::before {
        top: 15px;
    }

    .borne-bouton {
        width: 32px;
        height: 32px;
        font-size: 0.82rem;
    }

    .borne.actuelle .borne-bouton {
        box-shadow: 0 0 0 3px var(--fond), 0 0 0 5px var(--fanal);
    }

    .borne-libelle {
        display: none;
    }


    .lecon-contenu {
        font-size: 1.06rem;
    }

    .lecon-actions,
    .bouton-valider {
        width: 100%;
    }

    .lecon-nav {
        width: 100%;
    }

    .lecon-nav .bouton {
        flex: 1 1 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- Les outils du pilier ---------- */
.outils-pilier {
    margin-top: 40px;
}
.outil {
    display: grid;
    gap: 4px;
    max-width: 560px;
    padding: 16px 18px;
    border: 1px solid var(--trait);
    border-left: 4px solid var(--fanal);
    border-radius: 12px;
    background: var(--surface);
    color: var(--texte);
    text-decoration: none;
}
.outil:hover {
    border-color: var(--texte-doux);
    border-left-color: var(--fanal);
}
.outil:focus-visible {
    outline: 3px solid var(--balise);
    outline-offset: 2px;
}
/* Outils regroupés par usage (v1.7) */
.outils-groupe-titre { margin: 28px 0 10px; font-size: 1.05rem; font-weight: 700; color: var(--texte-doux); }
.outils-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; }
.outils-grille .outil { max-width: none; align-content: start; }
.outil-question { color: var(--fanal); font-weight: 700; font-size: 0.92rem; line-height: 1.35; }
.outil-titre {
    font-weight: 600;
    font-size: 1.05rem;
}
.outil-texte {
    color: var(--texte-doux);
    font-size: 0.92rem;
}

/* =====================================================================
   v1.3 — OUTIL DE LA FORMATION, PAGES DE PRÉSENTATION, MÉDIAS, ÉCHANGES
   ===================================================================== */

/* ---------- Le gros lien vers l'outil de la formation ---------- */
.outil-banniere {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 28px;
    padding: 20px 24px;
    border: 1px solid color-mix(in srgb, var(--fanal) 45%, var(--trait));
    border-left: 6px solid var(--fanal);
    border-radius: 12px;
    background: color-mix(in srgb, var(--fanal) 9%, var(--surface));
    color: var(--texte);
    text-decoration: none;
}
.outil-banniere:hover { border-color: var(--fanal); }
.outil-banniere:focus-visible { outline: 3px solid var(--balise); outline-offset: 3px; }
.outil-banniere-texte { display: grid; gap: 4px; min-width: 0; }
.outil-banniere-texte strong { font-size: 1.25rem; line-height: 1.25; }
.outil-banniere-texte span { color: var(--texte-doux); font-size: 0.95rem; line-height: 1.5; }
.outil-banniere-action {
    flex: 0 0 auto;
    padding: 12px 20px;
    border-radius: 8px;
    background: var(--fanal);
    color: #2b1d00;
    font-weight: 700;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .outil-banniere { flex-direction: column; align-items: stretch; padding: 18px; }
    .outil-banniere-action { text-align: center; }
}

/* ---------- Sommaire : présentation et modules cliquables ---------- */
.sommaire-presentation {
    display: block;
    width: 100%;
    margin: 4px 0 14px;
    padding: 10px 14px;
    border: 1px solid var(--trait);
    border-radius: 8px;
    background: var(--surface);
    color: var(--texte);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.sommaire-presentation[aria-current="page"] { border-color: var(--fanal); background: color-mix(in srgb, var(--fanal) 10%, var(--surface)); }
.module-lien {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.module-lien:hover { color: var(--balise); }
.module-lien[aria-current="page"] { color: var(--fanal); }

/* ---------- Pages de présentation ---------- */
.page-intro {
    margin: 0 0 22px;
    font-size: 1.15rem;
    color: var(--texte-doux);
}
.page-sous-titre {
    margin: 28px 0 10px;
    font-family: var(--police-ui);
    font-size: 1rem;
}
.page-etapes {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
    font-family: var(--police-ui);
}
.page-etape {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--trait);
    border-radius: 8px;
    background: var(--surface);
    color: var(--texte);
    font-size: 0.97rem;
    text-align: left;
    cursor: pointer;
}
.page-etape:hover { border-color: var(--balise); }
.page-etape-titre { flex: 1; }
.page-etape small { color: var(--texte-doux); }
.page-etape.faite .pastille { border-color: var(--balise); background: var(--balise); color: var(--sur-balise); }
.page-etape .pastille svg { width: 12px; height: 12px; }

/* ---------- Médias ---------- */
.medias {
    display: grid;
    gap: 22px;
    margin: 0 0 8px;
    font-family: var(--police-ui);
}
.media { margin: 0; }
.media-cadre {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}
.media-cadre iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media-lecteur { display: block; width: 100%; max-height: 72vh; border-radius: 10px; background: #000; }
.media-image { display: block; max-width: 100%; height: auto; border-radius: 10px; }
.media-audio { display: block; width: 100%; }
.media figcaption { margin-top: 8px; font-size: 0.92rem; color: var(--texte-doux); }
.media-message {
    margin: 0;
    padding: 18px;
    border: 1px dashed var(--trait);
    border-radius: 10px;
    color: var(--texte-doux);
    font-size: 0.95rem;
}
.media-pdf svg { width: 16px; height: 16px; }
.media-admin { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.media-admin-bouton {
    padding: 6px 12px;
    border: 1px solid var(--trait);
    border-radius: 6px;
    background: transparent;
    color: var(--texte);
    font-size: 0.85rem;
    cursor: pointer;
}
.media-admin-bouton:disabled { opacity: 0.4; cursor: default; }
.media-admin-bouton.retirer { color: var(--alerte); border-color: color-mix(in srgb, var(--alerte) 50%, var(--trait)); }

.ajout-media {
    padding: 18px 20px;
    border: 1px dashed var(--fanal);
    border-radius: 10px;
    background: color-mix(in srgb, var(--fanal) 5%, transparent);
}
.ajout-media h3 { margin: 0 0 6px; font-size: 1rem; }
.ajout-media-aide { margin: 0 0 14px; font-size: 0.88rem; color: var(--texte-doux); line-height: 1.5; }
.ajout-media-champ { display: grid; gap: 6px; margin-bottom: 12px; }
.ajout-media-champ label { font-size: 0.88rem; color: var(--texte-doux); }
.ajout-media-ligne { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.ajout-media-champ .ajout-media-ligne { margin-bottom: 0; }
.ajout-media input[type="text"],
.ajout-media input[type="url"],
.ajout-media textarea {
    flex: 1 1 260px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--trait);
    border-radius: 8px;
    background: var(--surface);
    color: var(--texte);
    font: inherit;
    font-size: 0.95rem;
}
.ajout-media input[aria-invalid="true"],
.ajout-media textarea[aria-invalid="true"] { border-color: var(--alerte); }
.ajout-media textarea { width: 100%; resize: vertical; min-height: 64px; line-height: 1.45; }
.ajout-media.survol { border-style: solid; background: color-mix(in srgb, var(--fanal) 14%, transparent); }
.envoi { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--texte-doux); }
.envoi progress { flex: 1; height: 10px; accent-color: var(--balise); }

/* ---------- Échanges : j'aime, commentaires, partage ---------- */
.echanges {
    margin-top: 32px;
    padding: 18px 20px;
    border: 1px solid var(--trait);
    border-radius: 12px;
    background: var(--surface);
    font-family: var(--police-ui);
}
.echanges-titre { margin: 0 0 12px; font-size: 0.9rem; color: var(--texte-doux); }
.echanges-barre { display: flex; flex-wrap: wrap; gap: 10px; }
.echange-bouton {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--trait);
    border-radius: 999px;
    background: transparent;
    color: var(--texte);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
}
.echange-bouton svg { width: 18px; height: 18px; }
.echange-bouton:hover { border-color: var(--texte-doux); }
.echange-bouton:disabled { opacity: 0.6; cursor: progress; }
.echange-bouton.aimer[aria-pressed="true"] { border-color: var(--alerte); color: var(--alerte); }
.echange-bouton.aimer[aria-pressed="true"] svg { fill: currentColor; }
.echange-compte { color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.echanges-fil { margin-top: 16px; display: grid; gap: 10px; }
.echanges-vide { margin: 0; font-size: 0.92rem; color: var(--texte-doux); }
.commentaire {
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--surface-2);
}
.commentaire.reponse { margin-left: 28px; border-left: 3px solid var(--trait); }
.commentaire-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin: 0 0 4px; font-size: 0.85rem; }
.commentaire-meta time { color: var(--texte-doux); }
.commentaire-texte { margin: 0; font-size: 0.97rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.commentaire-actions { display: flex; gap: 14px; margin-top: 6px; }
.lien-discret {
    padding: 0;
    border: 0;
    background: none;
    color: var(--balise);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.lien-discret.danger { color: var(--alerte); }
.formulaire-commentaire { display: grid; gap: 8px; margin-top: 6px; }
.formulaire-commentaire textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--trait);
    border-radius: 8px;
    background: var(--surface);
    color: var(--texte);
    font: inherit;
    font-size: 0.97rem;
    resize: vertical;
}
.formulaire-commentaire .bouton { justify-self: start; }

/* ---------- v1.4 : accès admin aux médias ---------- */
.barre-admin {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    padding: 10px 14px;
    border: 1px dashed var(--fanal);
    border-radius: 10px;
    background: color-mix(in srgb, var(--fanal) 7%, transparent);
    font-family: var(--police-ui);
}
.barre-admin-titre {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--fanal);
    margin-right: 4px;
}
.barre-admin-bouton {
    padding: 7px 14px;
    border: 1px solid color-mix(in srgb, var(--fanal) 60%, var(--trait));
    border-radius: 999px;
    background: var(--surface);
    color: var(--texte);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}
.barre-admin-bouton:hover { border-color: var(--fanal); }
.sommaire-admin-medias {
    margin: -4px 0 10px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--fanal);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.sommaire-admin-medias:hover { text-decoration: underline; }
.module-lien:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- v1.5 : les médias du module sur chaque étape ---------- */
.module-medias {
    margin: 0 0 26px;
    border: 1px solid var(--trait);
    border-radius: 12px;
    background: var(--surface);
    overflow: hidden;
    font-family: var(--police-ui);
}
.module-medias-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
}
.module-medias-titre { margin: 0; display: grid; gap: 2px; min-width: 0; font-size: 0.92rem; }
.module-medias-titre span { color: var(--texte-doux); font-size: 0.85rem; }
.module-medias-bascule {
    flex: 0 0 auto;
    padding: 7px 14px;
    border: 1px solid var(--trait);
    border-radius: 999px;
    background: transparent;
    color: var(--texte);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}
.module-medias-bascule:hover { border-color: var(--texte-doux); }
.module-medias-corps { display: grid; gap: 16px; padding: 0 14px 14px; }
.module-medias-corps[hidden] { display: none; }
.module-medias .media-cadre,
.module-medias .media-lecteur,
.module-medias .media-image { border-radius: 8px; }

/* ---------- v1.6 : plusieurs outils pour une formation ---------- */
.outils-formation { display: grid; gap: 12px; margin: 0 0 28px; }
.outils-formation .outil-banniere { margin: 0; }

/* =====================================================================
   ACADÉMIE FINANCE & COMPTABILITÉ (v1.9) : intertitres de cycle entre les
   cartes, et route compacte pour 26 formations (qui passe à la ligne).
   La page Pilotage n'est pas concernée.
   ===================================================================== */
.cartes-cycle {
    grid-column: 1 / -1;
    margin: 26px 0 2px;
    padding-top: 18px;
    border-top: 1px solid var(--trait);
}
.cartes-cycle:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
.cartes-cycle-titre {
    margin: 0 0 4px;
    font-size: 1.15rem;
    color: var(--texte);
}
.cartes-cycle-texte {
    margin: 0;
    font-size: 0.95rem;
    color: var(--texte-doux);
}
body[data-pilier="compta"] .route {
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    row-gap: 14px;
    margin-top: 36px;
}
body[data-pilier="compta"] .borne::before {
    display: none;
}
body[data-pilier="compta"] .borne-bouton {
    width: 40px;
    height: 40px;
}
body[data-pilier="compta"] .borne-libelle {
    display: none;
}