/* style.css — repris de la maquette du 3/11. Une frise d'atelier : le planning d'alternance est le seul geste fort de la page, aux couleurs de LEA pour qu'on s'y retrouve
   (école jaune, entreprise bleu, mobilité mauve). Le reste est calme : des rangées séparées par des traits, pas de cartes, pas d'ombres.
   Aucune police à télécharger : DIN sur Mac (école d'ingénieurs oblige), sinon ce que le système propose. Rien ne part vers un tiers. */
:root {
  color-scheme: light dark;
  --papier: #f1f4f2; --surface: #ffffff; --encre: #15302b; --encre-2: #4c5f5a; --trait: #d3dbd7; --trait-fort: #9fb0aa;
  --action: #0f5c4d; --sur-action: #ffffff; --du: #b4235a; --du-fond: #fbe9f0; --ok: #1b6e4b;
  --ecole: #eed782; --entreprise: #bdd6f8; --mobilite: #aeb6f7; --ferme: #e6ebe8; --semaine-vide: #eef1ef;
  --titres: "DIN Alternate", "Bahnschrift", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --texte: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gouttiere: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --papier: #101a18; --surface: #17231f; --encre: #e4ece9; --encre-2: #a2b3ad; --trait: #2c3b36; --trait-fort: #4a5d57;
    --action: #5fc7ae; --sur-action: #0c1a16; --du: #f07aa6; --du-fond: #3a1a28; --ok: #6fd3a5;
    --ecole: #a8913c; --entreprise: #47698f; --mobilite: #5d62a6; --ferme: #1e2a26; --semaine-vide: #1a2622;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* sinon le display de button l'emporte, et un bouton « caché » s'affiche */
html { font-size: 100%; }
body { margin: 0; background: var(--papier); color: var(--encre); font: 1rem/1.5 var(--texte); }
h1, h2, h3 { font-family: var(--titres); font-weight: 700; line-height: 1.15; margin: 0; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.08rem; }
p { margin: 0; }
a { color: var(--action); }
:focus-visible { outline: 3px solid var(--du); outline-offset: 2px; }
.sourdine { color: var(--encre-2); }
.petit { font-size: .875rem; }
.du { color: var(--du); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }

.barre { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px var(--gouttiere); background: var(--encre); color: var(--papier); }
.barre a.marque { color: inherit; font: 700 1.2rem var(--titres); text-decoration: none; margin-right: auto; }
.voir-comme { display: flex; align-items: center; gap: 8px; font-size: .875rem; }
.voir-comme select { max-width: 210px; }
.barre .discret { background: transparent; color: inherit; border: 1px solid currentColor; }
.etat-sync { font-size: .8125rem; opacity: .85; }
.mini-etiquette { display: inline-block; padding: 3px 9px; font-size: .8125rem; font-weight: 400; margin: 0; border: 1px solid var(--trait-fort); border-radius: 6px; background: var(--surface); color: var(--encre); cursor: pointer; }
code { font-size: .9em; }

button, .bouton { font: inherit; font-size: .9375rem; padding: 7px 13px; border-radius: 6px; border: 1px solid var(--trait-fort); background: var(--surface); color: var(--encre); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .bouton:hover { border-color: var(--encre); }
button.principal, .bouton.principal { background: var(--action); color: var(--sur-action); border-color: var(--action); font-weight: 600; }
button.mini { padding: 3px 9px; font-size: .8125rem; }
input, select, textarea { font: inherit; color: var(--encre); background: var(--surface); border: 1px solid var(--trait-fort); border-radius: 6px; padding: 7px 9px; width: 100%; }
select { width: auto; }
textarea { min-height: 76px; resize: vertical; }
label { font-size: .9375rem; font-weight: 600; display: block; margin-bottom: 3px; }

main { max-width: 1180px; margin: 0 auto; padding: 22px var(--gouttiere) 56px; }
.tete { margin-bottom: 20px; }
.tete .resume { font-size: 1.125rem; max-width: 62ch; margin-top: 6px; }
section.bloc { margin-top: 38px; }
section.bloc > h2 { margin-bottom: 4px; }
section.bloc > .aide { color: var(--encre-2); max-width: 70ch; margin-bottom: 14px; }

/* La frise : le geste de la page */
.frise-cadre { overflow-x: auto; margin: 0 calc(-1 * var(--gouttiere)); padding: 0 var(--gouttiere) 6px; }
.frise { display: grid; grid-template-columns: minmax(150px, 210px) repeat(var(--n), minmax(34px, 1fr)); min-width: 720px; row-gap: 5px; }
.frise .mois { font: 700 .9375rem var(--titres); padding: 0 0 2px 4px; border-left: 1px solid var(--trait-fort); }
.frise .num { font: .75rem var(--titres); color: var(--encre-2); text-align: center; padding-bottom: 3px; }
.frise .num.ici { color: var(--du); font-weight: 700; }
.frise .qui { position: sticky; left: 0; z-index: 2; background: var(--papier); padding: 3px 10px 3px 0; align-self: center; }
.frise .qui a { font-weight: 600; color: var(--encre); text-decoration: none; display: block; line-height: 1.2; }
.frise .qui a:hover { text-decoration: underline; }
.frise .qui span { font-size: .8125rem; color: var(--encre-2); display: block; line-height: 1.25; }
.frise .case { height: 46px; border: 0; padding: 0; border-radius: 0; margin-right: 1px; background: var(--semaine-vide); position: relative; font-size: .8125rem; cursor: pointer; color: var(--encre); }
.frise .case:hover { box-shadow: inset 0 0 0 2px var(--encre); }
.frise .case.centre { background: var(--ecole); }
.frise .case.structure { background: var(--entreprise); }
.frise .case.mobilite { background: var(--mobilite); }
.frise .case.suppose { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .45) 6px 9px); }
.frise .case.ici::before { content: ""; position: absolute; top: -3px; bottom: -3px; left: 0; width: 2px; background: var(--du); }
.frise .marque-rencontre { position: absolute; inset: 0; display: grid; place-items: center; font: 700 1.05rem var(--titres); }
.frise .drapeau { position: absolute; right: 2px; top: 1px; color: var(--du); font-size: .875rem; line-height: 1; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .875rem; color: var(--encre-2); margin-top: 8px; }
.legende i { display: inline-block; width: 15px; height: 15px; vertical-align: -3px; margin-right: 5px; font-style: normal; }
.legende i.centre { background: var(--ecole); } .legende i.structure { background: var(--entreprise); } .legende i.mobilite { background: var(--mobilite); }
.legende i.suppose { background: var(--entreprise); background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(255, 255, 255, .6) 5px 8px); }

/* Les rangées d'apprentis : des traits, pas des cartes */
.rangees { border-top: 2px solid var(--encre); }
.rangee { display: grid; grid-template-columns: minmax(180px, 1.15fr) minmax(170px, 1fr) minmax(150px, .8fr) minmax(170px, 1fr) auto; gap: 8px 22px; padding: 13px 0; border-bottom: 1px solid var(--trait); align-items: start; }
.rangee h3 a { color: inherit; text-decoration: none; }
.rangee h3 a:hover { text-decoration: underline; }
.rangee .action { align-self: center; }
.pastilles { font-size: 1.05rem; letter-spacing: 2px; }
.a-verifier { color: var(--du); font-size: .875rem; }

/* La carte et la tournée */
.deux { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.carte { height: 390px; background: var(--ferme); border: 1px solid var(--trait); }
.carte-basse { height: 260px; }
.tournee { display: grid; gap: 16px; }
.tournee h3 { margin-bottom: 2px; }
.etapes { margin: 6px 0 0; padding-left: 20px; }
.marqueur { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #15302b; }
.marqueur.ecole { background: #15302b; border-radius: 2px; }
.marqueur.an1 { background: #d9b92e; } .marqueur.an2 { background: #b4235a; } .marqueur.an3 { background: #3158c9; }

/* Le dossier */
.ariane { font-size: .9375rem; margin-bottom: 6px; display: block; }
.sommaire { display: flex; flex-wrap: wrap; gap: 4px 16px; position: sticky; top: 0; background: var(--papier); padding: 9px 0; border-bottom: 1px solid var(--trait); z-index: 500; font-size: .9375rem; }
.parcours { display: grid; grid-template-columns: repeat(6, minmax(112px, 1fr)); border-top: 2px solid var(--encre); overflow-x: auto; }
.semestre { padding: 9px 10px 11px; border-right: 1px solid var(--trait); min-width: 112px; }
.semestre:last-child { border-right: 0; }
.semestre.courant { background: var(--surface); box-shadow: inset 0 3px 0 var(--du); }
.semestre strong { font: 700 1.05rem var(--titres); display: block; }
.semestre .petit { display: block; }
.bande { display: grid; grid-template-columns: repeat(var(--n), minmax(9px, 1fr)); margin-top: 12px; gap: 1px; min-width: 520px; }
.bande span { height: 18px; background: var(--semaine-vide); position: relative; }
.bande span.centre { background: var(--ecole); } .bande span.structure { background: var(--entreprise); } .bande span.mobilite { background: var(--mobilite); }
.bande span.ici { box-shadow: inset 2px 0 0 var(--du); }
.bande-mois { display: grid; grid-template-columns: repeat(var(--n), minmax(9px, 1fr)); font-size: .75rem; color: var(--encre-2); min-width: 520px; }
.grille-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
.champ { margin-bottom: 12px; }
.gestes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.cr { border-top: 2px solid var(--encre); }
.rubrique { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 8px 24px; padding: 14px 0; border-bottom: 1px solid var(--trait); }
.rubrique .tete-rubrique { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 5px; }
.rubrique label { margin: 0; }
.apport { font-size: .9375rem; }
.apport .source { color: var(--encre-2); font-size: .8125rem; display: block; }
.apport blockquote { margin: 3px 0 5px; padding-left: 10px; border-left: 3px solid var(--entreprise); white-space: pre-wrap; }
.liste-simple { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--trait); }
.liste-simple li { padding: 8px 0; border-bottom: 1px solid var(--trait); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.liste-simple li.clos { color: var(--encre-2); }
.encart { background: var(--surface); border-left: 4px solid var(--encre); padding: 11px 14px; max-width: 72ch; }

/* Les espaces apprenti et tuteur : une colonne, pensée pour le téléphone */
.espace { max-width: 640px; margin: 0 auto; }
.espace section.bloc { margin-top: 30px; }
.bandeau-vue { background: var(--du-fond); color: var(--encre); font-size: .875rem; padding: 7px 12px; margin-bottom: 16px; }
.creneau { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--trait); }
.creneau input { width: auto; }
.creneau label { margin: 0; font-weight: 400; }

dialog { border: 1px solid var(--encre); border-radius: 8px; padding: 20px; width: min(620px, calc(100vw - 32px)); background: var(--papier); color: var(--encre); }
dialog::backdrop { background: rgba(10, 25, 21, .45); }
dialog h2 { margin-bottom: 12px; }
dialog pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; background: var(--surface); padding: 10px; border: 1px solid var(--trait); max-height: 44vh; overflow: auto; margin: 8px 0; }
.annonce { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--encre); color: var(--papier); padding: 8px 15px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 2000; font-size: .9375rem; }
.annonce.vu { opacity: 1; }
.pied { max-width: 1180px; margin: 0 auto; padding: 14px var(--gouttiere) 28px; color: var(--encre-2); font-size: .875rem; border-top: 1px solid var(--trait); display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; }

body.designer * { cursor: crosshair !important; }
body.designer main *:hover { outline: 2px dashed var(--du); outline-offset: 1px; }

@media (max-width: 860px) {
  .rangee { grid-template-columns: 1fr; gap: 3px; }
  .rangee .action { margin-top: 6px; }
  .deux, .rubrique { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 1.8rem; }
  .voir-comme select { max-width: 150px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
