/* Formation « Savoir-être et posture professionnelle » – variante HTML
   Charte : sobre, lisible, une couleur par partie (vert : quotidien, bleu : entreprise). */

:root {
  --fond: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --texte: #1f2328;
  --texte-doux: #5a5f66;
  --bordure: #dedbd2;
  --ombre: 0 1px 2px rgba(31, 35, 40, .06), 0 4px 16px rgba(31, 35, 40, .06);

  --p1: #1f7a63;         /* partie 1 – quotidien */
  --p1-clair: #e3f2ec;
  --p2: #2b5ea8;         /* partie 2 – entreprise */
  --p2-clair: #e5edf8;
  --accent: var(--p1);
  --accent-clair: var(--p1-clair);
  --sur-accent: #ffffff;        /* texte posé sur la couleur d'accent */

  --affirmee: #1f7a43;
  --affirmee-fond: #e6f4ea;
  --passive: #8a6100;
  --passive-fond: #fbf1d9;
  --agressive: #b3261e;
  --agressive-fond: #fbe7e5;

  --rayon: 14px;
  --rayon-petit: 8px;
  --police: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #16181b;
    --surface: #1f2226;
    --surface-2: #272b30;
    --texte: #e8e6e1;
    --texte-doux: #a7abb1;
    --bordure: #363a40;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --p1: #4fbf9b;
    --p1-clair: #1d3530;
    --p2: #7aa7ec;
    --p2-clair: #1e2a3d;
    --affirmee: #6fcf8f;
    --affirmee-fond: #1c3324;
    --passive: #e3b450;
    --passive-fond: #3a3018;
    --agressive: #f08a80;
    --agressive-fond: #3d2120;
    --sur-accent: #10201b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #16181b; --surface: #1f2226; --surface-2: #272b30; --texte: #e8e6e1; --texte-doux: #a7abb1;
  --bordure: #363a40; --ombre: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --p1: #4fbf9b; --p1-clair: #1d3530; --p2: #7aa7ec; --p2-clair: #1e2a3d;
  --affirmee: #6fcf8f; --affirmee-fond: #1c3324; --passive: #e3b450; --passive-fond: #3a3018;
  --agressive: #f08a80; --agressive-fond: #3d2120; --sur-accent: #10201b;
  color-scheme: dark;
}

body[data-partie="partie-2"] { --accent: var(--p2); --accent-clair: var(--p2-clair); }

*, *::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);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.5rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.lien-evitement { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.lien-evitement:focus { left: 1rem; }

.conteneur { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* ---------- En-tête ---------- */
.entete { background: var(--surface); border-bottom: 1px solid var(--bordure); }
.entete .conteneur { display: flex; align-items: center; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.marque { font-weight: 700; color: var(--texte); text-decoration: none; display: flex; align-items: center; gap: .6rem; }
.marque-logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--p1), var(--p2)); display: grid; place-items: center; color: #fff; font-size: .9rem; }
.fil { margin-left: auto; font-size: .9rem; color: var(--texte-doux); }
.fil a { color: var(--texte-doux); }

/* ---------- Bandeau ---------- */
.bandeau { padding: 2.5rem 0 2rem; }
.surtitre { display: inline-block; font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: .5rem; }
.chapo { font-size: 1.125rem; color: var(--texte-doux); max-width: 46rem; }
.meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.pastille { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .7rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--bordure); font-size: .875rem; color: var(--texte-doux); }
.pastille.forte { background: var(--accent-clair); color: var(--accent); border-color: transparent; font-weight: 600; }

/* ---------- Cartes génériques ---------- */
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre); }
.encadre { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 1.25rem 1.5rem; }
.objectifs { margin: 0 0 2rem; }
.objectifs ul { margin: .25rem 0 0; padding-left: 1.25rem; }
.objectifs li { margin: .2rem 0; }

/* ---------- Accueil ---------- */
.partie { margin: 0 0 2.5rem; }
.partie-titre { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; border-top: 4px solid var(--couleur); padding-top: 1rem; }
.partie-titre .num { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--couleur); }
.partie[data-partie="partie-1"] { --couleur: var(--p1); --couleur-clair: var(--p1-clair); }
.partie[data-partie="partie-2"] { --couleur: var(--p2); --couleur-clair: var(--p2-clair); }
.grille-seances { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 1rem; margin-top: 1rem; }
.seance-carte { position: relative; display: flex; flex-direction: column; padding: 1.1rem 1.2rem 1rem; color: var(--texte); text-decoration: none; min-height: 190px; transition: transform .15s, box-shadow .15s; }
a.seance-carte:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 10px 24px rgba(0,0,0,.08); }
.seance-carte .no { font-size: .8rem; font-weight: 700; color: var(--couleur); text-transform: uppercase; letter-spacing: .05em; }
.seance-carte h3 { margin: .3rem 0 .4rem; font-size: 1.05rem; }
.seance-carte p { font-size: .9rem; color: var(--texte-doux); margin: 0 0 .8rem; }
.seance-carte .pied { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--texte-doux); gap: .5rem; }
.seance-carte.indispo { opacity: .62; box-shadow: none; background: var(--surface-2); }
.etat { font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; background: var(--couleur-clair); color: var(--couleur); white-space: nowrap; }
.indispo .etat { background: transparent; border: 1px solid var(--bordure); color: var(--texte-doux); }
.barre { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: .25rem 0 .6rem; }
.barre > span { display: block; height: 100%; background: var(--couleur, var(--accent)); border-radius: inherit; transition: width .4s; }
.note-appareil { font-size: .9rem; color: var(--texte-doux); }

/* ---------- Séance ---------- */
.sommaire { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.sommaire a { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--bordure); background: var(--surface); text-decoration: none; color: var(--texte); font-size: .9rem; }
.sommaire a .coche { color: var(--accent); font-weight: 700; }
.progression-seance { margin: 0 0 1rem; font-size: .9rem; color: var(--texte-doux); }

.grain { margin: 0 0 2rem; scroll-margin-top: 1rem; }
.grain-tete { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--bordure); flex-wrap: wrap; }
.grain-tete .repere { font-weight: 700; font-size: .8rem; color: var(--sur-accent); background: var(--accent); border-radius: 6px; padding: .15rem .5rem; letter-spacing: .03em; }
.grain-tete h2 { margin: 0; font-size: 1.2rem; }
.grain-tete .duree { margin-left: auto; font-size: .875rem; color: var(--texte-doux); }
.grain-tete .fait { font-size: .8rem; font-weight: 600; color: var(--accent); background: var(--accent-clair); border-radius: 999px; padding: .1rem .6rem; }
.grain-corps { padding: 1.25rem 1.5rem 1.5rem; }
.consigne { margin: 0 0 1.25rem; }
.consigne p:last-child { margin-bottom: 0; }

/* Boutons */
.btn { font: inherit; font-size: .95rem; font-weight: 600; display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; background: var(--accent); color: var(--sur-accent); min-height: 44px; }
.btn:hover { filter: brightness(1.07); }
.btn.secondaire { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn.discret { background: transparent; color: var(--texte-doux); border-color: var(--bordure); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; align-items: center; }

/* ---------- Vidéo + script ---------- */
.video-attente { display: grid; place-items: center; text-align: center; aspect-ratio: 16 / 9; max-height: 340px; width: 100%; border-radius: var(--rayon-petit); background: linear-gradient(135deg, var(--accent-clair), var(--surface-2)); color: var(--texte-doux); padding: 1rem; margin-bottom: 1rem; }
.video-attente .icone { font-size: 2.2rem; color: var(--accent); }
.scenes { list-style: none; margin: 0; padding: 0; counter-reset: scene; }
.scene { display: grid; grid-template-columns: 4.2rem 1fr; gap: .25rem 1rem; padding: .75rem 0; border-top: 1px solid var(--bordure); }
.scene:first-child { border-top: 0; }
.scene .temps { font-size: .8rem; font-weight: 700; color: var(--accent); padding-top: .2rem; }
.scene .voix { margin: 0; }
.scene .ecran { grid-column: 2; font-size: .85rem; color: var(--texte-doux); margin: 0; }
details.script > summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: .4rem 0; }

/* ---------- Cartes à retourner ---------- */
.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .9rem; }
.retournable { perspective: 900px; min-height: 190px; }
.retournable button.face-btn { all: unset; display: block; width: 100%; height: 100%; cursor: pointer; border-radius: var(--rayon-petit); }
.retournable button.face-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
/* Les deux faces partagent la même cellule de grille : la carte prend la hauteur de la plus haute */
.retournable .interieur { display: grid; width: 100%; min-height: 190px; transition: transform .5s; transform-style: preserve-3d; }
.retournable.retournee .interieur { transform: rotateY(180deg); }
.retournable .face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--rayon-petit); padding: 1rem; display: flex; flex-direction: column; border: 1px solid var(--bordure); background: var(--surface); }
.retournable .recto { justify-content: center; align-items: center; text-align: center; background: var(--accent-clair); border-color: transparent; }
.retournable .recto strong { font-size: 1.15rem; color: var(--accent); }
.retournable .recto .q { font-size: .9rem; color: var(--texte-doux); margin-top: .3rem; }
.retournable .recto .tourner { margin-top: auto; font-size: .8rem; color: var(--texte-doux); }
.retournable .verso { transform: rotateY(180deg); font-size: .92rem; }
.retournable .verso p { margin: 0 0 .5rem; }
.retournable .verso em { color: var(--texte-doux); }
.indice { font-size: .85rem; margin-top: .4rem; }
.indice summary { cursor: pointer; color: var(--accent); }
.compteur { font-size: .9rem; color: var(--texte-doux); }
@media (prefers-reduced-motion: reduce) {
  .retournable .interieur, a.seance-carte, .barre > span { transition: none; }
}

/* ---------- Mises en situation ---------- */
.etapes { display: flex; gap: .35rem; margin: 0 0 1rem; padding: 0; list-style: none; flex-wrap: wrap; }
.etapes li { width: 2rem; height: 6px; border-radius: 99px; background: var(--surface-2); }
.etapes li.faite { background: var(--accent); opacity: .45; }
.etapes li.courante { background: var(--accent); }
.situation-img { border-radius: var(--rayon-petit); margin: 0 0 1rem; width: 100%; max-height: 380px; object-fit: cover; background: var(--surface-2); }
.situation .question { font-weight: 700; }
.choix { display: grid; gap: .6rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.choix button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: .85rem 1rem; border: 1px solid var(--bordure); border-radius: var(--rayon-petit); background: var(--surface); cursor: pointer; line-height: 1.5; }
.choix button:hover:not([disabled]) { border-color: var(--accent); background: var(--accent-clair); }
.choix button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.choix button[disabled] { cursor: default; }
.choix button.choisi { border-width: 2px; }
.choix button.style-affirmee.revele { border-color: var(--affirmee); }
.choix button.style-passive.revele { border-color: var(--passive); }
.choix button.style-agressive.revele { border-color: var(--agressive); }
.retour-reaction { border-radius: var(--rayon-petit); padding: 1rem 1.2rem; margin-top: 1rem; border-left: 5px solid; }
.retour-reaction.affirmee { background: var(--affirmee-fond); border-color: var(--affirmee); }
.retour-reaction.passive { background: var(--passive-fond); border-color: var(--passive); }
.retour-reaction.agressive { background: var(--agressive-fond); border-color: var(--agressive); }
.retour-reaction .titre { font-weight: 700; margin: 0 0 .35rem; }
.retour-reaction.affirmee .titre { color: var(--affirmee); }
.retour-reaction.passive .titre { color: var(--passive); }
.retour-reaction.agressive .titre { color: var(--agressive); }
.retour-reaction p { margin: 0 0 .4rem; }
.retour-reaction p:last-child { margin: 0; }
.autres { margin-top: 1rem; }
.autres > summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.bilan { text-align: center; padding: 1rem 0; }
.score { font-size: 2.6rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.a-retenir { text-align: left; background: var(--accent-clair); border-radius: var(--rayon-petit); padding: 1rem 1.2rem; margin-top: 1rem; }

/* ---------- Rédaction ---------- */
.zone-texte { width: 100%; min-height: 240px; font: inherit; font-size: 1rem; line-height: 1.55; padding: .8rem 1rem; border-radius: var(--rayon-petit); border: 1px solid var(--bordure); background: var(--surface); color: var(--texte); resize: vertical; }
.zone-texte:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.info-saisie { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; font-size: .85rem; color: var(--texte-doux); margin-top: .35rem; }
.alerte { background: var(--passive-fond); color: var(--texte); border-left: 4px solid var(--passive); padding: .6rem .9rem; border-radius: 6px; margin-top: .75rem; }
.verif { margin-top: 1.25rem; }
.verif h3 { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.verif .points { font-size: .95rem; color: var(--accent); }
.criteres { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .5rem; }
.criteres li { display: grid; grid-template-columns: 1.6rem 1fr; gap: .5rem; padding: .6rem .8rem; border-radius: var(--rayon-petit); background: var(--surface-2); }
.criteres li.ok { background: var(--affirmee-fond); }
.criteres .sym { font-weight: 800; text-align: center; }
.criteres li.ok .sym { color: var(--affirmee); }
.criteres li.manque .sym { color: var(--texte-doux); }
.modele { margin-top: 1.25rem; }
.lettre { white-space: pre-wrap; background: var(--surface-2); border-radius: var(--rayon-petit); padding: 1rem 1.2rem; font-size: .95rem; margin-top: .75rem; }
.note { font-size: .9rem; color: var(--texte-doux); font-style: italic; }

/* ---------- Pied de page ---------- */
.nav-seances { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 2rem 0; }
.pied-page { border-top: 1px solid var(--bordure); padding: 1.5rem 0 2rem; font-size: .85rem; color: var(--texte-doux); }
.pied-page .conteneur { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.lien-bouton { all: unset; cursor: pointer; text-decoration: underline; color: var(--texte-doux); }
.lien-bouton:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lien-discret { color: var(--texte-doux); }
.pied-page .session { display: inline-flex; gap: .75rem; flex-wrap: wrap; }
.etat-envoi.ok { color: var(--affirmee); }
.etat-envoi.envoi { color: var(--texte-doux); }
.etat-envoi.horsligne, .etat-envoi.refus { color: var(--agressive); font-weight: 600; }

/* ---------- Entrée avec le code personnel ---------- */
.conteneur-etroit { max-width: 560px; }
.connexion { margin: 2.5rem 0; padding: 1.75rem; display: flex; flex-direction: column; gap: .6rem; }
.connexion h1 { margin: 0 0 .25rem; }
.connexion .libelle { font-weight: 700; margin-top: .5rem; }
.code-saisie { font: inherit; font-size: 1.5rem; letter-spacing: .12em; text-transform: uppercase; min-height: 56px; padding: .4rem .9rem; border: 1px solid var(--bordure); border-radius: var(--rayon-petit); background: var(--surface); color: var(--texte); width: 100%; }
.code-saisie:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.connexion .aide { font-size: .88rem; color: var(--texte-doux); margin: 0; }
.connexion .case { display: flex; gap: .6rem; align-items: flex-start; min-height: 44px; padding-top: .5rem; }
.connexion .case input { width: 20px; height: 20px; margin-top: .1rem; flex: none; }
.chargement { padding: 3rem 16px; text-align: center; color: var(--texte-doux); }

/* ---------- Anti-triche (séance) ---------- */
body.seance-protegee *:not(input):not(textarea) { -webkit-user-select: none; user-select: none; }
.avertissement-triche { position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 1rem); max-width: min(92vw, 560px);
  background: var(--texte); color: var(--fond); padding: .75rem 1.1rem; border-radius: var(--rayon-petit); box-shadow: var(--ombre);
  font-size: .95rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.avertissement-triche.visible { opacity: 1; transform: translate(-50%, 0); }
.aide-triche { font-size: .85rem; color: var(--texte-doux); margin: .4rem 0 0; }
@media (prefers-reduced-motion: reduce) { .avertissement-triche { transition: none; } }

/* ---------- Bilan imprimable par l'apprenant ---------- */
.bilan-apprenant { margin-top: 2rem; display: flex; flex-direction: column; gap: .5rem; }
.bilan-apprenant .libelle { font-weight: 700; margin-top: .25rem; }
.champ-texte { font: inherit; min-height: 44px; padding: .4rem .8rem; border: 1px solid var(--bordure); border-radius: var(--rayon-petit); background: var(--surface); color: var(--texte); width: 100%; max-width: 420px; }
#bilan-impression { display: none; }
@media print {
  body.impression-bilan > *:not(#bilan-impression) { display: none !important; }
  body.impression-bilan #bilan-impression { display: block; color: #000; background: #fff; font-size: 11pt; }
  #bilan-impression h1 { font-size: 16pt; margin: .2rem 0 .5rem; }
  #bilan-impression h2 { font-size: 12pt; margin: 1rem 0 .4rem; }
  #bilan-impression table { width: 100%; border-collapse: collapse; }
  #bilan-impression th, #bilan-impression td { border: 1px solid #999; padding: 4px 6px; text-align: left; vertical-align: top; }
  #bilan-impression .lettre { background: none; border: 1px solid #999; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .grain-tete, .grain-corps { padding-left: 1rem; padding-right: 1rem; }
  .grain-tete .duree { margin-left: 0; width: 100%; }
  .encadre { padding: 1rem; }
  .scene { grid-template-columns: 1fr; }
  .scene .ecran { grid-column: 1; }
  .fil { margin-left: 0; width: 100%; padding-bottom: .5rem; }
}
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
