/* Atelier MVAESTECH · charte du site mvaestech.fr, thème clair.
   Montserrat très grasse pour les titres (la voix du logo), Figtree pour le texte ; bleu et jaune « capuche ». */

@font-face { font-family: "Figtree"; src: url("polices/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("polices/montserrat-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  color-scheme: light;
  --noir: #1A1C1E;
  --bleu: #3870A8;
  --bleu-fonce: #2D5D8A;
  --bleu-pale: #E8F0F9;
  --capuche: #E3B532;
  --capuche-pale: #FBF3DA;
  --ambre-texte: #7A5200;
  --rouge: #B3261E;
  --rouge-pale: #FCEBEA;
  --fond: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F4F6F9;
  --texte: #1A1C1E;
  --texte-doux: #50565E;
  --texte-faible: #6B727B;
  --filet: #D6DAE0;
  --filet-champ: #C9CED6;
  --accent-texte: #2D5D8A;
  --titre: "Montserrat", "Arial Black", system-ui, sans-serif;
  --corps: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: hidden; background: var(--fond); color: var(--texte); font: 16px/1.55 var(--corps); }
:focus-visible { outline: 3px solid var(--capuche); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
a { color: var(--accent-texte); }
button { font: inherit; }
.masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: -999px; top: 8px; background: var(--noir); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 10; }
.evitement:focus { left: 8px; }

/* ------------------------------------------------------------------ barre */
.barre { background: #fff; padding: 22px 16px 6px; }
.barre .in { max-width: 1120px; margin: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 12px; font: 800 15px var(--titre); color: var(--bleu); text-decoration: none; }
.logo img { height: 30px; width: auto; display: block; }
.logo span { padding-left: 12px; border-left: 2px solid var(--filet); }
.barre-droite { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.pastille { white-space: nowrap; background: var(--surface-2); border: 1px solid var(--filet); border-radius: 99px; padding: 4px 11px; color: var(--texte-doux); }
.pastille.quota { background: var(--capuche-pale); border-color: var(--capuche); color: var(--noir); font-weight: 600; }
.pastille.quota.epuise { background: var(--rouge-pale); border-color: var(--rouge); }
.btn-barre { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--filet-champ); border-radius: 99px; padding: 5px 13px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--texte); }
.btn-barre:hover { border-color: var(--bleu); }
.point { width: 9px; height: 9px; border-radius: 50%; background: var(--filet-champ); }
.point.ok { background: #2E7D4F; }
.point.ko { background: var(--rouge); }

/* ------------------------------------------------------------------ mise en page */
main { max-width: 1120px; margin: auto; padding: 0 16px 80px; }
.intro { padding: 40px 0 18px; }
h1 { font: 800 clamp(34px, 1.3rem + 4vw, 64px)/1.05 var(--titre); margin: 0 0 16px; letter-spacing: -0.02em; max-width: 17ch; }
h1 em { font-style: normal; color: var(--bleu); }
.chapo { color: var(--texte-doux); max-width: 38em; margin: 0; font-size: 1.2rem; }
.etapes { padding: 0; display: flex; gap: 6px; margin: 26px 0 0; flex-wrap: wrap; counter-reset: e; }
.etapes li { list-style: none; counter-increment: e; }
.etapes button { font-size: 14px; font-weight: 600; padding: 7px 14px 7px 8px; border-radius: 99px; background: var(--surface-2); color: var(--texte-doux); display: flex; gap: 8px; align-items: center; border: 0; cursor: pointer; }
.etapes button::before { content: counter(e); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--filet); font-size: 12px; }
.etapes button:disabled { cursor: default; opacity: .6; }
.etapes button.fait::before { content: "✓"; background: var(--bleu); color: #fff; }
.etapes button[aria-current="step"] { background: var(--bleu); color: #fff; }
.etapes button[aria-current="step"]::before { background: var(--capuche); color: var(--noir); }

section.etape { border-top: 1px solid var(--filet); padding: 34px 0 10px; margin-top: 18px; }
h2 { font: 800 22px/1.2 var(--titre); margin: 0 0 6px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
h2 small { font: 600 13px var(--corps); color: var(--texte-faible); text-transform: uppercase; letter-spacing: .08em; }
h3 { font: 700 15px var(--corps); margin: 0 0 10px; }
.titre-section { margin-top: 30px; }
.sous { color: var(--texte-doux); margin: 0 0 20px; max-width: 760px; }
.grille2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; }
.grille2 > *, .mix > *, .directions > *, .trois > * { min-width: 0; }
.colonne { display: flex; flex-direction: column; gap: 16px; }
.carte { background: var(--surface); border: 1px solid var(--filet); border-radius: 12px; padding: 18px; }
.petit { font-size: 14px; color: var(--texte-doux); margin: 0 0 12px; }
.note { font-size: 13px; color: var(--texte-faible); margin: 10px 0 0; }

/* ------------------------------------------------------------------ formulaires */
label, legend { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.aide { font-weight: 400; color: var(--texte-faible); font-size: 13px; }
p.aide { margin: 6px 0 0; }
input[type=text], input[type=password], input[type=number], input[type=date], textarea, select {
  width: 100%; font: inherit; color: var(--texte); background: var(--surface); border: 1px solid var(--filet-champ); border-radius: 8px; padding: 10px 12px;
}
input:focus, textarea:focus, select:focus { border-color: var(--bleu); outline: none; box-shadow: 0 0 0 3px var(--bleu-pale); }
textarea { min-height: 148px; resize: vertical; }
textarea.code { font: 12.5px/1.5 var(--mono); min-height: 260px; }
.champ { margin-bottom: 16px; }
.ligne { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compteur { text-align: right; font-size: 12px; color: var(--texte-faible); margin: 4px 0 0; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { font-size: 13px; border: 1px solid var(--filet-champ); border-radius: 99px; padding: 5px 11px; background: var(--surface); cursor: pointer; color: var(--texte); }
.puce[aria-pressed="true"] { background: var(--bleu-pale); border-color: var(--bleu); color: var(--accent-texte); font-weight: 600; }
.case { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 4px 0; }
.case input { accent-color: var(--bleu); width: 16px; height: 16px; }
.reglages { margin: 4px 0 14px; }
.reglages summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent-texte); margin-bottom: 12px; }
.structures { display: flex; flex-direction: column; gap: 10px; }
.structure { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid transparent; cursor: pointer; font-size: 14px; font-weight: 400; margin: 0; }
.structure:has(input:checked) { border-color: var(--bleu); background: var(--bleu-pale); }
.structure input { margin-top: 3px; accent-color: var(--bleu); }

.btn { font: 700 15px var(--corps); border: 0; border-radius: 8px; padding: 11px 18px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-p { background: var(--capuche); color: var(--noir); }
.btn-p:hover:not(:disabled) { background: #F0C64A; }
.btn-s { background: transparent; border: 1px solid var(--filet-champ); color: var(--texte); }
.btn-s:hover:not(:disabled) { border-color: var(--bleu); }
.btn-petit { padding: 6px 11px; font-size: 13px; }
.lien { background: none; border: 0; color: var(--accent-texte); text-decoration: underline; cursor: pointer; padding: 0; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.info { font-size: 13px; color: var(--texte-faible); }
.erreur { color: var(--rouge); font-weight: 600; margin: 10px 0 0; min-height: 0; }
.erreur:empty { display: none; }

ul.garde { margin: 0; padding: 0; list-style: none; font-size: 14px; }
ul.garde li { padding: 8px 0 8px 26px; border-bottom: 1px solid var(--filet); position: relative; }
ul.garde li:last-child { border: 0; }
ul.garde li::before { content: ""; position: absolute; left: 4px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--bleu); }
ul.garde li.non::before { background: var(--capuche); }

/* ------------------------------------------------------------------ attente */
.attente { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 12px; background: var(--bleu-pale); margin-bottom: 18px; }
.roue { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--filet); border-top-color: var(--bleu); animation: tourne 0.9s linear infinite; flex: none; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .roue { animation-duration: 3s; } }

/* ------------------------------------------------------------------ directions */
.directions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.dir { border: 1px solid var(--filet); border-radius: 12px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.dir.choisie { outline: 3px solid var(--capuche); outline-offset: 2px; }
.dir header { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-height: 76px; }
.dir header b { font: 800 15px var(--titre); }
.dir header span { font-size: 12.5px; color: var(--texte-faible); }
.apercu { border-top: 1px solid var(--filet); border-bottom: 1px solid var(--filet); height: 430px; overflow: hidden; position: relative; }
.dir .meta { padding: 12px 14px; font-size: 13px; color: var(--texte-doux); }
.dir .ton { font-style: italic; margin-top: 4px; }
.nuancier { display: flex; gap: 4px; margin-bottom: 8px; }
.nuancier i { width: 22px; height: 22px; border-radius: 5px; border: 1px solid rgba(0,0,0,.12); }
.dir footer { padding: 0 14px 14px; display: flex; gap: 8px; margin-top: auto; }
.dir footer .btn { flex: 1; font-size: 14px; padding: 9px; }
.relance { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 18px; }
.relance .champ { flex: 1 1 320px; margin: 0; }

/* Mini page : rendue avec les réglages de la direction (variables posées en JavaScript, sans style en ligne). */
.page {
  --p-fond: #fff; --p-alt: #eee; --p-surface: #fff; --p-texte: #222; --p-doux: #555; --p-accent: #a33; --p-sur: #fff;
  --p-titre: serif; --p-corps: sans-serif; --p-rayon: 0px; --p-medaillon: 50%;
  background: var(--p-fond); color: var(--p-texte); font-family: var(--p-corps); font-size: 12px; line-height: 1.5; height: 100%; overflow: hidden;
}
.page nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; font-size: 10.5px; border-bottom: 1px solid color-mix(in srgb, var(--p-texte) 12%, transparent); }
.page nav b { font: 700 13px var(--p-titre); color: var(--p-accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page nav span { display: flex; gap: 10px; color: var(--p-doux); white-space: nowrap; }
.p-hero { padding: 26px 16px 22px; text-align: center; background: var(--p-alt); }
.p-hero small { text-transform: uppercase; letter-spacing: .14em; font-size: 9.5px; color: var(--p-accent); }
.p-hero h4 { font: 700 21px/1.15 var(--p-titre); margin: 6px 0 8px; }
.p-hero p { margin: 0 auto 12px; max-width: 260px; color: var(--p-doux); font-size: 11px; }
.p-btn { display: inline-block; background: var(--p-accent); color: var(--p-sur); padding: 6px 13px; border-radius: var(--p-rayon); font-size: 10.5px; font-weight: 700; }
.p-manif { padding: 16px 18px; text-align: center; font: italic 500 13px/1.45 var(--p-titre); }
.p-manif em { display: block; font: 10px var(--p-corps); color: var(--p-doux); margin-top: 6px; font-style: normal; }
.p-coll { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 6px 14px 16px; text-align: center; font-size: 10.5px; }
.p-coll i { display: block; aspect-ratio: 4 / 5; border-radius: var(--p-medaillon); margin-bottom: 5px; background: linear-gradient(160deg, color-mix(in srgb, var(--p-accent) 35%, var(--p-alt)), var(--p-alt)); }
.p-appel { margin: 0 14px; padding: 14px; background: var(--p-accent); color: var(--p-sur); border-radius: var(--p-rayon); display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 600 11.5px var(--p-titre); }
.p-appel span { background: var(--p-sur); color: var(--p-accent); padding: 5px 10px; border-radius: var(--p-rayon); font: 700 10px var(--p-corps); white-space: nowrap; }
.bascule-nuit { position: absolute; right: 8px; bottom: 8px; font-size: 11px; border-radius: 99px; border: 1px solid var(--filet-champ); background: #fff; padding: 3px 9px; cursor: pointer; }

/* ------------------------------------------------------------------ ajustement */
.mix { display: grid; grid-template-columns: 1fr 1.1fr; gap: 22px; }
.melange { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 16px; }
.melange td, .melange th { padding: 9px 6px; border-bottom: 1px solid var(--filet); text-align: left; vertical-align: middle; }
.melange th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-faible); font-weight: 600; }
.radios { display: flex; gap: 4px; }
.radios button { width: 34px; height: 28px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--filet-champ); font-weight: 700; font-size: 13px; background: #fff; cursor: pointer; }
.radios button[aria-pressed="true"] { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.apercu-mix { height: 470px; border: 1px solid var(--filet); border-radius: 12px; overflow: hidden; position: relative; }
.apercu-mix .apercu { height: 100%; border: 0; }

/* ------------------------------------------------------------------ thème */
.journal { font: 13px/1.7 var(--mono); background: var(--surface-2); color: var(--texte); border: 1px solid var(--filet); border-radius: 10px; padding: 14px 16px; margin: 0; overflow-x: auto; white-space: pre-wrap; min-height: 120px; }
.journal .ok { color: var(--bleu); font-weight: 700; }
.journal .att { color: var(--ambre-texte); font-weight: 700; }
.journal .ko { color: var(--rouge); font-weight: 700; }
.livre { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px; border-radius: 10px; background: var(--capuche-pale); margin-top: 14px; }
.livre .fic { font: 600 14px var(--mono); overflow-wrap: anywhere; }
.livre .exp { font-size: 13px; color: var(--texte-doux); }
.arbo { font: 12.5px/1.6 var(--mono); color: var(--texte-doux); margin: 0; white-space: pre; overflow-x: auto; }
.trois { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.trois p, .trois li { font-size: 14px; color: var(--texte-doux); }
.trois p { margin: 0 0 10px; }
.trois ul { padding-left: 18px; margin: 0 0 10px; }

/* ------------------------------------------------------------------ historique */
.tete-historique { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.table-defilante { overflow-x: auto; }
.historique, .tableau { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
.historique td, .historique th, .tableau td, .tableau th { padding: 8px 6px; border-bottom: 1px solid var(--filet); text-align: left; vertical-align: middle; }
.historique th, .tableau th { font-size: 12px; color: var(--texte-faible); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.historique tr.cliquable { cursor: pointer; }
.historique tr.cliquable:hover { background: var(--surface-2); }
.etat { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); white-space: nowrap; }
.etat.dispo, .etat.etat-actif { background: var(--bleu-pale); color: var(--accent-texte); }
.etat.encours { background: var(--capuche-pale); color: var(--ambre-texte); }
.etat.ko, .etat.etat-revoque, .etat.etat-expire { background: var(--rouge-pale); color: var(--rouge); }
.vide { color: var(--texte-faible); font-size: 14px; }
.mono { font-family: var(--mono); font-size: 13px; }

/* ------------------------------------------------------------------ dialogues */
.dialogue { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 24px 60px rgba(26, 28, 30, .25); color: var(--texte); }
.dialogue-large { width: min(1000px, calc(100vw - 32px)); }
.dialogue::backdrop { background: rgba(26, 28, 30, .45); }
.dialogue-corps { padding: 22px; overflow-y: auto; }
.dialogue h2 { margin-bottom: 10px; }
.dialogue-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fermer { border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.explication { font-size: 14px; color: var(--texte-doux); margin: 4px 0 12px; }
.explication summary { cursor: pointer; font-weight: 600; color: var(--accent-texte); }
.resultat-test { font-size: 14px; margin: 8px 0 0; }
.resultat-test.ok { color: #2E7D4F; }
.resultat-test.ko { color: var(--rouge); }
.avis { background: var(--capuche-pale); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.avis p { margin: 0; }
.onglets { display: flex; gap: 4px; margin: 6px 0 16px; }
.onglets button { padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; background: var(--surface-2); color: var(--texte-doux); border: 0; cursor: pointer; }
.onglets button[aria-selected="true"] { background: var(--bleu); color: #fff; }
.nouveau-client { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; align-items: end; }
.nouveau-client .champ { margin: 0; }
.cle-creee { background: var(--capuche-pale); border-radius: 10px; padding: 12px 14px; margin-top: 14px; font-size: 14px; }
.cle-ligne { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cle-ligne code { font: 13px var(--mono); background: #fff; padding: 6px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.quota-saisie { width: 70px !important; padding: 4px 6px !important; }
.actions-ligne { display: flex; gap: 6px; flex-wrap: wrap; }
tr.revoque td { color: var(--texte-faible); }
.envoi-structure { margin-top: 18px; border-top: 1px solid var(--filet); padding-top: 16px; }
.depot { border: 2px dashed var(--filet-champ); border-radius: 10px; padding: 16px; text-align: center; color: var(--texte-doux); font-size: 14px; cursor: pointer; font-weight: 400; }
.envoi-structure input[type=file] { margin-top: 8px; font-size: 13px; }
.controles { list-style: none; padding: 0; margin: 14px 0; font-size: 14px; }
.controles li { padding: 6px 0 6px 24px; position: relative; border-bottom: 1px solid var(--filet); }
.controles li::before { content: "✓"; position: absolute; left: 2px; color: var(--bleu); font-weight: 700; }
.controles li.ko::before { content: "✗"; color: var(--rouge); }

.pied { border-top: 1px solid var(--filet); text-align: center; padding: 20px 16px 30px; font-size: 13px; color: var(--texte-faible); }

/* ------------------------------------------------------------------ petits écrans */
@media (max-width: 900px) {
  .grille2, .mix, .directions, .trois { grid-template-columns: 1fr; }
  .apercu { height: 400px; }
  .nouveau-client { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .ligne { grid-template-columns: 1fr; }
  .logo img { height: 22px; }
  .barre-droite { margin-left: 0; width: 100%; }
  .pastille { font-size: 11.5px; }
  .col-direction { display: none; }
  .historique td:nth-child(3) { display: none; }
  .nouveau-client { grid-template-columns: 1fr; }
}
