/* Réussir l'épreuve PSE Bac Pro — style commun de l'espace (mapse.fr) */
:root {
  --encre: #15213a;
  --doux: #5b6578;
  --fond: #f5f6fa;
  --papier: #ffffff;
  --trait: #e2e6ef;
  --p1: #0f766e;        /* partie 1 : santé et environnement */
  --p1-clair: #e6f4f2;
  --p2: #3730a3;        /* partie 2 : milieu professionnel */
  --p2-clair: #ecebfb;
  --accent: #b45309;
  --accent-clair: #fdf3e3;
  --ok: #15803d;
  --ok-clair: #e8f6ed;
  --ko: #b91c1c;
  --ko-clair: #fdecec;
  --ombre: 0 10px 30px rgba(21, 33, 58, .08);
  --rayon: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}
a { color: inherit; }
.cadre { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }

/* Bandeau de navigation : toujours un chemin de retour */
.nav {
  position: relative; z-index: 2;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--trait);
}
.nav .cadre { display: flex; align-items: center; gap: 10px; min-height: 54px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; font-weight: 700; font-size: .92rem;
  padding: 7px 12px; border-radius: 999px; background: var(--fond); border: 1px solid var(--trait);
}
.nav a:hover, .nav a:focus-visible { background: var(--p2-clair); border-color: var(--p2); }
.nav .titre-nav { margin-left: auto; font-size: .85rem; color: var(--doux); font-weight: 700; }

/* En-tête */
.tete { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #115e59 100%); color: #fff; padding: 38px 0 44px; }
.tete .sur { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; opacity: .8; margin: 0 0 8px; }
.tete h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1.15; margin: 0 0 12px; }
.tete p { margin: 0; max-width: 680px; font-size: 1.05rem; opacity: .92; }

/* Sommaire en pastilles */
.pastilles { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 6px; scrollbar-width: thin; }
.pastilles a {
  flex: 0 0 auto; text-decoration: none; font-weight: 700; font-size: .9rem;
  padding: 8px 14px; border-radius: 999px; background: var(--papier); border: 1px solid var(--trait);
}
.pastilles a:hover, .pastilles a:focus-visible { border-color: var(--p2); color: var(--p2); }

/* Sections */
section.bloc { background: var(--papier); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 26px 22px; margin: 22px 0; scroll-margin-top: 70px; }
section.bloc > h2 { margin: 0 0 6px; font-size: clamp(1.3rem, 3.6vw, 1.7rem); line-height: 1.2; }
section.bloc > h2 .num { color: var(--p2); margin-right: 6px; }
.chapeau { color: var(--doux); margin: 0 0 18px; }
h3 { font-size: 1.1rem; margin: 22px 0 10px; }

/* Grilles de cartes */
.grille { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grille.g2 { grid-template-columns: 1fr 1fr; } .grille.g3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grille.g4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 560px) and (max-width: 899px) { .grille.g4 { grid-template-columns: 1fr 1fr; } }
.carte { border: 1px solid var(--trait); border-radius: 14px; padding: 16px; background: var(--papier); }
.carte h4 { margin: 0 0 6px; font-size: 1rem; }
.carte p { margin: 0; color: var(--doux); }
.chiffre { font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--p2); }
.chiffre + .leg { color: var(--doux); font-size: .92rem; }
.carte.p1 { background: var(--p1-clair); border-color: #b5ded8; }
.carte.p2 { background: var(--p2-clair); border-color: #c9c6f2; }
.carte.p1 h4 { color: var(--p1); }
.carte.p2 h4 { color: var(--p2); }
.etiquette { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.75); margin-bottom: 8px; }

/* Avertissement, exemples */
.avertir { display: flex; gap: 12px; background: var(--accent-clair); border: 1px solid #f3d29b; border-radius: 14px; padding: 14px 16px; margin: 0 0 18px; }
.avertir strong { color: var(--accent); }
.exemple { border-left: 4px solid var(--p2); background: #fafaff; border-radius: 0 12px 12px 0; padding: 12px 16px; margin: 14px 0; }
.exemple .q { font-weight: 700; margin: 0 0 6px; }
.exemple .src { font-size: .85rem; color: var(--doux); margin: 6px 0 0; }
.duo { display: grid; gap: 10px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 700px) { .duo { grid-template-columns: 1fr 1fr; } }
.rep { border-radius: 12px; padding: 12px 14px; }
.rep .lib { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.rep.i { background: var(--ko-clair); border: 1px solid #f5c2c2; }
.rep.i .lib { color: var(--ko); }
.rep.m { background: var(--ok-clair); border: 1px solid #b9e3c7; }
.rep.m .lib { color: var(--ok); }
.pourquoi { font-size: .93rem; color: var(--doux); margin: 8px 0 0; }

/* Diagrammes en barres */
.barres { display: grid; gap: 10px; margin: 6px 0 4px; }
.barre { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 10px; align-items: center; }
@media (max-width: 520px) { .barre { grid-template-columns: 1fr; gap: 4px; } }
.barre .lib { font-size: .93rem; }
.barre .piste { position: relative; display: flex; align-items: center; background: #eef0f6; border-radius: 999px; height: 26px; overflow: hidden; }
.barre .val-dehors { margin-left: 8px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.barre .rempli { height: 100%; border-radius: 999px; background: var(--p2); min-width: 12px; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; color: #fff; font-weight: 700; font-size: .85rem; }
.barres.p1 .rempli { background: var(--p1); }
.barres.copies .rempli { background: var(--accent); }
.lire { font-size: .88rem; color: var(--doux); margin: 10px 0 0; padding: 10px 12px; background: var(--fond); border-radius: 10px; }
.lire strong { color: var(--encre); }

/* Anneau des compétences */
.anneau-zone { display: grid; gap: 18px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 640px) { .anneau-zone { grid-template-columns: 220px 1fr; } }
.anneau { width: 200px; height: 200px; border-radius: 50%; margin: 0 auto; position: relative; }
.anneau::after { content: ""; position: absolute; inset: 42px; border-radius: 50%; background: var(--papier); }
.anneau .centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; text-align: center; font-size: .85rem; color: var(--doux); }
.anneau .centre b { font-size: 1.5rem; color: var(--encre); }
.legende { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.legende li { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; }
.legende .pastille { width: 18px; height: 18px; border-radius: 5px; }
.legende b { font-variant-numeric: tabular-nums; }

/* Frise du temps */
.frise { display: flex; border-radius: 12px; overflow: hidden; height: 64px; margin: 8px 0 6px; }
.frise div { display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; font-weight: 700; font-size: .85rem; padding: 4px; line-height: 1.2; }
.frise .t0 { background: #64748b; }
.frise .t1 { background: var(--p1); }
.frise .t2 { background: var(--p2); }
.frise .t3 { background: var(--accent); }
.frise-leg { display: flex; justify-content: space-between; font-size: .8rem; color: var(--doux); }

/* Niveaux */
.niveaux { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .niveaux { grid-template-columns: repeat(4, 1fr); } }
.niv { border-radius: 12px; padding: 12px; border: 1px solid var(--trait); }
.niv b { display: block; font-size: 1.05rem; }
.niv.m { background: var(--ok-clair); } .niv.a { background: #eef6ff; } .niv.ins { background: var(--accent-clair); } .niv.nt { background: var(--ko-clair); }

/* Erreurs */
.erreur { border: 1px solid var(--trait); border-radius: 14px; padding: 16px; margin: 12px 0; }
.erreur h4 { margin: 0 0 4px; font-size: 1.02rem; }
.erreur h4 span { color: var(--accent); margin-right: 6px; }

/* Liste à puces sobre */
ul.sobre { margin: 6px 0 0; padding-left: 20px; }
ul.sobre li { margin: 4px 0; }

/* Accueil de l'espace : les étapes */
.etapes { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 22px; }
@media (min-width: 700px) { .etapes { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .etapes { grid-template-columns: repeat(3, 1fr); } }
.etape {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none;
  background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon);
  box-shadow: var(--ombre); padding: 20px; min-height: 170px; transition: transform .15s, border-color .15s;
}
a.etape:hover, a.etape:focus-visible { transform: translateY(-2px); border-color: var(--p2); }
.etape .n { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: var(--p2); }
.etape.ecriture .n { background: var(--accent); }
.etape.suivi .n { background: var(--p1); }
.etape h3 { margin: 6px 0 0; font-size: 1.15rem; }
.etape p { margin: 0; color: var(--doux); font-size: .95rem; }
.etape .bientot { margin-top: auto; font-size: .8rem; font-weight: 700; color: var(--doux); }
.etape .entrer { margin-top: auto; font-size: .85rem; font-weight: 700; color: var(--p2); }
.etape[aria-disabled="true"] { opacity: .72; box-shadow: none; }
.ressources a { display: block; text-decoration: none; font-weight: 700; padding: 12px 14px; border: 1px solid var(--trait); border-radius: 12px; background: var(--papier); }
.ressources a:hover, .ressources a:focus-visible { border-color: var(--p2); }

/* Bas de page : suite du parcours */
.suite { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin: 28px 0 40px; }
.suite a { text-decoration: none; font-weight: 700; padding: 12px 18px; border-radius: 12px; background: var(--p2); color: #fff; }
.suite a.second { background: var(--papier); color: var(--encre); border: 1px solid var(--trait); }
.pied { text-align: center; color: var(--doux); font-size: .82rem; padding: 0 0 30px; }

@media print {
  .nav, .pastilles, .suite, #pse-acces-bar { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  section.bloc { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .tete { background: #fff; color: #000; padding: 10px 0; }
}

/* Étape 4 : fiches de savoir-faire */
.titre-partie { font-size: 1.15rem; margin: 26px 0 0; padding-left: 12px; border-left: 5px solid var(--p2); }
.titre-partie.p1 { border-color: var(--p1); }
ul.consignes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.consignes li { background: var(--fond); border-radius: 12px; padding: 10px 14px; font-weight: 700; }
figure.schema { margin: 8px auto 0; max-width: 480px; }
figure.schema img { width: 100%; height: auto; display: block; }
dl.retenir { margin: 0; display: grid; gap: 10px; }
dl.retenir > div { border: 1px solid var(--trait); border-left: 5px solid var(--p2); border-radius: 12px; padding: 12px 14px; }
dl.retenir dt { font-weight: 700; }
dl.retenir dd { margin: 2px 0 0; color: var(--doux); }
ol.echelle { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
ol.echelle b { display: inline-block; width: 26px; color: var(--p2); }
.defile { overflow-x: auto; margin: 14px 0 0; }
table.matrice, table.duerp { border-collapse: collapse; font-size: .92rem; }
table.matrice th, table.matrice td { border: 1px solid var(--trait); padding: 8px 12px; text-align: center; }
table.matrice td { font-weight: 700; color: #fff; min-width: 46px; }
table.matrice td.p1 { background: #b91c1c; } table.matrice td.p2 { background: #d97706; } table.matrice td.p3 { background: #15803d; }
table.duerp { min-width: 760px; }
table.duerp th { background: var(--p2-clair); }
table.duerp th, table.duerp td { border: 1px solid var(--trait); padding: 8px; vertical-align: top; text-align: left; }
.exos .exo { border-top: 1px solid var(--trait); padding: 18px 0 6px; }
.exos .exo:first-of-type { border-top: 0; padding-top: 4px; }
