/* Charte CYBERG : Rouge #C10016, Bleu Nuit #192839, Bleu Acier #7195BD, Bleu 2 #B2C9DD, Gris 1 #393D47, Gris 2 #545859 */
:root {
  --rouge: #C10016;
  --rouge-fonce: #A10012;
  --nuit: #192839;
  --acier: #7195BD;
  --bleu2: #B2C9DD;
  --fond: #FFFFFF;
  --surface: #F1F5F9;
  --encre: #141414;
  --titre: #192839;
  --doux: #545859;
  --trait: #CBD7E3;
  --accent-texte: #C10016;
  --juste: #17693F;
  --juste-fond: #E4F3EA;
  --faux: #A10012;
  --faux-fond: #FBE7E9;
  --titres: 'Montserrat', Arial, sans-serif;
  --texte: 'Lato', Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #101A26;
    --surface: #192839;
    --encre: #EEF2F6;
    --titre: #FFFFFF;
    --doux: #B2C9DD;
    --trait: #33475E;
    --accent-texte: #B2C9DD;
    --juste: #7FDCA9;
    --juste-fond: #143326;
    --faux: #FF9AA3;
    --faux-fond: #3A1519;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: 106.25%; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--texte); line-height: 1.55; }
h1, h2, legend, .etape-titre, .parcours-titre { font-family: var(--titres); color: var(--titre); }
h1 { font-weight: 900; font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); line-height: 1.12; margin: 0; max-width: 22ch; }
h1.geant { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.4rem); max-width: 18ch; }
h2 { font-weight: 700; font-size: 1.25rem; line-height: 1.25; margin: 0 0 .6rem; }
p { margin: 0 0 .8rem; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--acier); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--rouge); color: #FFFFFF; padding: .6rem 1rem; }
.skip:focus { left: 0; z-index: 5; }
.noscript { padding: 2rem; }

/* Structure */
.shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--nuit); color: #FFFFFF; padding: 2rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand img { display: block; width: 183px; height: 60px; }
.rail-title { font-family: var(--titres); font-weight: 700; font-size: 1rem; color: var(--bleu2); margin: 0; }
.rail-note { margin: auto 0 0; font-size: .85rem; color: var(--bleu2); }
main { padding: clamp(1.5rem, 4vw, 4rem); max-width: 1080px; outline: none; }

/* Rail : les cinq étapes */
.etapes { list-style: none; margin: 1rem 0 0; padding: 0; }
.etapes li { position: relative; }
.etapes li + li::before { content: ""; position: absolute; left: 1.95rem; top: -.35rem; height: .7rem; width: 2px; background: #33475E; }
.etapes a { display: flex; gap: .8rem; align-items: center; padding: .65rem .8rem; border-radius: 8px; text-decoration: none; color: #FFFFFF; }
.etapes a:hover { background: #22364D; }
.etapes a[aria-current="page"] { background: #FFFFFF; color: var(--nuit); }
.pastille { flex: none; width: 2.3rem; height: 2.3rem; border-radius: 50%; border: 2px solid var(--acier); display: grid; place-items: center; font-family: var(--titres); font-weight: 700; }
.etapes li.ok .pastille { background: var(--rouge); border-color: var(--rouge); color: #FFFFFF; }
.etape-txt { display: flex; flex-direction: column; }
.etape-titre { font-weight: 700; font-size: .95rem; color: inherit; }
.etape-duree { font-size: .8rem; color: var(--bleu2); }
.etapes a[aria-current="page"] .etape-duree { color: var(--doux); }
@media (prefers-color-scheme: dark) { .etapes a[aria-current="page"] .etape-duree { color: #545859; } }
.lien-bilan { display: block; margin-top: 1rem; padding: .7rem .8rem; border: 2px solid var(--acier); border-radius: 8px; text-decoration: none; font-family: var(--titres); font-weight: 700; font-size: .95rem; color: #FFFFFF; }
.lien-bilan:hover { background: #22364D; }
.lien-bilan[aria-current="page"] { background: #FFFFFF; color: var(--nuit); border-color: #FFFFFF; }

/* En-têtes de vue */
.entete { margin-bottom: 2rem; }
.sur-titre { font-family: var(--titres); font-weight: 700; font-size: .9rem; color: var(--accent-texte); margin: 0 0 .5rem; }
.intro { font-size: 1.15rem; color: var(--doux); max-width: 62ch; margin: 1rem 0 0; }
.aide { font-size: .9rem; color: var(--doux); max-width: 66ch; }
.encart { border-left: 6px solid var(--rouge); background: var(--surface); padding: 1rem 1.2rem; border-radius: 0 8px 8px 0; max-width: 70ch; }

/* Blocs et champs */
.bloc { background: var(--surface); border-radius: 8px; padding: 1.5rem; margin: 0 0 1.5rem; max-width: 76ch; }
.bloc-prenom { max-width: 34rem; }
label, legend { font-family: var(--titres); font-weight: 700; font-size: .95rem; }
.champ { margin: 0 0 1rem; }
.champ label, .bloc > label { display: block; margin-bottom: .35rem; }
input[type="text"], textarea, select { width: 100%; font: inherit; color: var(--encre); background: var(--fond); border: 2px solid var(--trait); border-radius: 6px; padding: .6rem .75rem; }
input[type="text"]:focus, textarea:focus, select:focus { border-color: var(--acier); }
textarea { resize: vertical; min-height: 4.5rem; }
progress { width: 100%; height: .8rem; accent-color: var(--rouge); margin: .6rem 0; }
.duo { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 1rem; }

/* Boutons */
.btn { display: inline-block; font-family: var(--titres); font-weight: 700; font-size: .95rem; padding: .75rem 1.3rem; border-radius: 6px; border: 2px solid transparent; cursor: pointer; text-decoration: none; }
.btn-primaire { background: var(--rouge); color: #FFFFFF; }
.btn-primaire:hover { background: var(--rouge-fonce); }
.btn-secondaire { background: var(--nuit); color: #FFFFFF; border-color: var(--acier); }
.btn-secondaire:hover { background: #22364D; }
.btn-ghost { background: transparent; color: var(--titre); border-color: var(--acier); }
.btn-ghost:hover { background: var(--surface); }
.decision { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin: 1.2rem 0; }
.decision-q { font-family: var(--titres); font-weight: 700; margin: 0 .4rem 0 0; }
.alerte { color: var(--faux); font-weight: 700; margin: 0; flex-basis: 100%; }
.alerte:empty { display: none; }
.pied { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; border-top: 2px solid var(--trait); margin-top: 2.5rem; padding-top: 1.5rem; }
.pied p { margin: 0; font-weight: 700; }
.etat-ok { color: var(--juste); }
.etat-encours { color: var(--doux); }
.score { font-family: var(--titres); font-weight: 700; color: var(--titre); }

/* Accueil */
.avancement { max-width: 34rem; margin-bottom: 1.5rem; }
.parcours { list-style: none; padding: 0; margin: 0 0 2.5rem; border-top: 2px solid var(--titre); max-width: 76ch; }
.parcours li { border-bottom: 1px solid var(--trait); }
.parcours a { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto; align-items: baseline; gap: 1rem; padding: 1.05rem .4rem; text-decoration: none; }
.parcours a:hover { background: var(--surface); }
.parcours-num { font-family: var(--titres); font-weight: 900; font-size: 1.9rem; line-height: 1; color: var(--accent-texte); }
.parcours-titre { font-weight: 700; font-size: 1.2rem; }
.parcours-duree { color: var(--doux); font-size: .95rem; }
.parcours li.ok .parcours-duree { color: var(--juste); font-weight: 700; }
.regles { max-width: 66ch; }
.regles ul, .consignes { padding-left: 1.2rem; margin: 0 0 1rem; }
.regles li, .consignes li { margin-bottom: .45rem; }

/* Hygiène */
.taches { list-style: none; padding: 0; margin: 0 0 2rem; max-width: 76ch; }
.taches li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .6rem; padding: 1.1rem 0; border-bottom: 1px solid var(--trait); }
.taches input[type="checkbox"] { width: 1.5rem; height: 1.5rem; margin-top: .15rem; accent-color: var(--rouge); }
.taches label { font-size: 1.05rem; color: var(--titre); cursor: pointer; }
.taches p { margin: .3rem 0 .7rem; color: var(--doux); }
.taches li.ok label { text-decoration: line-through; text-decoration-color: var(--acier); }
.mdp-label { font-family: var(--titres); font-weight: 700; margin-bottom: .3rem; }
.mdp-resultat ul { margin: 0 0 1rem; padding-left: 1.2rem; }

/* Phishing : une vraie messagerie */
.messagerie { display: grid; grid-template-columns: 19rem minmax(0, 1fr); border: 2px solid var(--trait); border-radius: 8px; overflow: hidden; }
.boite { list-style: none; margin: 0; padding: 0; background: var(--surface); border-right: 2px solid var(--trait); }
.mail-ligne { display: grid; gap: .1rem; width: 100%; text-align: left; font: inherit; color: var(--encre); background: transparent; border: 0; border-bottom: 1px solid var(--trait); border-left: 6px solid transparent; padding: .7rem .8rem; cursor: pointer; }
.mail-ligne:hover { background: var(--fond); }
.mail-ligne.actif { background: var(--fond); border-left-color: var(--rouge); }
.mail-exp { font-weight: 700; font-size: .95rem; }
.mail-obj { font-size: .85rem; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-statut { font-size: .78rem; font-weight: 700; color: var(--doux); }
.mail-ligne.juste .mail-statut { color: var(--juste); }
.mail-ligne.faux .mail-statut { color: var(--faux); }
.volet { padding: 1.5rem; min-width: 0; }
.lecteur header { border-bottom: 1px solid var(--trait); padding-bottom: .9rem; margin-bottom: 1rem; }
.lecteur h2 { font-size: 1.3rem; }
.mail-de { margin: 0; overflow-wrap: anywhere; }
.mail-nom { font-weight: 700; }
.mail-adr { color: var(--doux); font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.mail-date { margin: 0; font-size: .85rem; color: var(--doux); }
.mail-corps { max-width: 62ch; }
.mail-lien { margin: 1rem 0; }
.faux-lien { font: inherit; font-weight: 700; color: #FFFFFF; background: #2F6FB3; border: 0; border-radius: 4px; padding: .6rem 1.1rem; cursor: pointer; }
.lien-cible { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; background: var(--surface); border-radius: 4px; padding: .5rem .7rem; overflow-wrap: anywhere; }
.lien-cible:empty { display: none; }
.mail-piece span { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; background: var(--surface); border: 1px solid var(--trait); border-radius: 4px; padding: .25rem .5rem; }
.correction { border-radius: 8px; padding: 1.1rem 1.3rem; margin-top: 1.2rem; }
.correction.juste { background: var(--juste-fond); }
.correction.faux { background: var(--faux-fond); }
.correction-titre { font-family: var(--titres); font-weight: 700; font-size: 1.1rem; }
.correction.juste .correction-titre { color: var(--juste); }
.correction.faux .correction-titre { color: var(--faux); }
.correction ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.correction li { margin-bottom: .35rem; }

/* Fiches et quiz */
fieldset { border: 2px solid var(--trait); border-radius: 8px; padding: 1.2rem 1.4rem; margin: 0 0 1.2rem; max-width: 76ch; min-width: 0; }
legend { padding: 0 .5rem; font-size: 1.02rem; }
.choix { display: grid; grid-template-columns: 1.8rem minmax(0, 1fr); align-items: start; padding: .35rem 0; }
.choix input { width: 1.2rem; height: 1.2rem; margin-top: .25rem; accent-color: var(--rouge); }
.choix label { font-family: var(--texte); font-weight: 400; font-size: 1rem; cursor: pointer; }
.choix.bon label { font-weight: 700; color: var(--juste); }
.question.juste { border-color: var(--juste); }
.question.faux { border-color: var(--faux); }
.pourquoi { margin: .7rem 0 0; padding-top: .7rem; border-top: 1px solid var(--trait); color: var(--doux); }

/* Bilan */
.recap { border-collapse: collapse; width: 100%; max-width: 76ch; margin: 0 0 1.5rem; }
.recap thead th { background: var(--nuit); color: #FFFFFF; font-family: var(--titres); text-align: left; padding: .7rem .9rem; }
.recap tbody th, .recap td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--trait); }
.recap tbody th { font-family: var(--titres); font-weight: 700; color: var(--titre); }

/* Petits écrans */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; padding: 1.2rem; }
  .rail-note { margin-top: .5rem; }
  .etapes { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem; }
  .etapes li + li::before { display: none; }
  .etapes a { white-space: nowrap; }
  .etape-duree { display: none; }
  .messagerie { grid-template-columns: minmax(0, 1fr); }
  .boite { border-right: 0; border-bottom: 2px solid var(--trait); max-height: 15rem; overflow-y: auto; }
  .duo { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .etapes a, .mail-ligne { transition: background-color .15s; }
}

/* Impression du bilan */
@media print {
  .rail, .skip, .sans-impression { display: none; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  body { background: #FFFFFF; color: #141414; }
  textarea { border: 1px solid #999999; }
}
