/* Installateur STMTV — aux jetons du site (stmtv.css) : bleu de porte, chaux, sable. */
:root {
  --porte: #0A5FB4;
  --porte-fonce: #08498B;
  --chaux: #F7FAFD;
  --surface: #FFFFFF;
  --encre: #0B1B33;
  --encre-2: #3D4E66;
  --encre-3: #5B6B80;
  --filet: #DCE5F0;
  --sable: #E3B055;
  --sable-fond: #FBF3E3;
  --ocre: #8A5A12;
  --alerte: #B42318;
  --bon: #0A5FB4;
  --console-fond: #07111E;
  --console-encre: #D7E3F2;
  --rayon: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --porte: #5AA8FF;
    --porte-fonce: #8CC2FF;
    --chaux: #06121F;
    --surface: #0C1D31;
    --encre: #EAF2FB;
    --encre-2: #B9C8DA;
    --encre-3: #8CA0B8;
    --filet: #1E3550;
    --sable: #E3B055;
    --sable-fond: #2A2114;
    --ocre: #E8C27A;
    --alerte: #FF8A80;
    --bon: #5AA8FF;
    --console-fond: #030A13;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--chaux);
  color: var(--encre);
  font: 16px/1.55 Cairo, system-ui, sans-serif;
  min-height: 100vh;
}
a { color: var(--porte); }
[hidden] { display: none !important; }

/* En-tête : le vantail */
.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: #0A5FB4;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 74px);
  color: #fff;
}
.entete__marque { display: flex; align-items: center; gap: 12px; }
.entete__clou { width: 14px; height: 14px; border-radius: 50%; background: var(--sable); box-shadow: inset -2px -2px 0 rgba(0,0,0,.25); }
.entete__nom { margin: 0; font-weight: 800; font-size: 20px; letter-spacing: .02em; line-height: 1.1; }
.entete__sous { margin: 0; font-size: 13px; opacity: .85; }
.entete__etat { margin: 0; font-size: 14px; padding: 4px 12px; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; }
.entete__etat.is-on { background: rgba(255,255,255,.14); }

.cadre {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px;
  max-width: 1320px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 64px;
}
@media (max-width: 900px) { .cadre { grid-template-columns: 1fr; gap: 16px; } }

/* Étapes */
.etapes { position: sticky; top: 24px; align-self: start; }
.etapes ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.etapes li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--rayon); color: var(--encre-3); font-weight: 600; }
.etapes__n { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--filet); font-size: 14px; flex: none; }
.etapes li.is-fait { color: var(--encre-2); }
.etapes li.is-fait .etapes__n { background: var(--porte); border-color: var(--porte); color: var(--surface); }
.etapes li.is-actif { color: var(--encre); background: var(--surface); box-shadow: inset 3px 0 0 var(--sable); }
.etapes li.is-actif .etapes__n { border-color: var(--sable); color: var(--encre); background: var(--sable-fond); }
@media (max-width: 900px) {
  .etapes { position: static; }
  .etapes ol { grid-auto-flow: column; overflow-x: auto; }
  .etapes li span:not(.etapes__n) { display: none; }
  .etapes li.is-actif span:not(.etapes__n) { display: inline; }
}

/* Panneaux */
.contenu { min-width: 0; }
.panneau { max-width: 860px; }
.panneau--large { max-width: none; }
h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.15; margin: 0 0 8px; font-weight: 800; }
h2 { font-size: 18px; margin: 24px 0 8px; }
.aide { color: var(--encre-2); margin: 0 0 16px; }
.aide.alerte { color: var(--ocre); }
.message { min-height: 1.5em; margin: 12px 0 0; font-weight: 600; }
.message.is-erreur { color: var(--alerte); }
.message.is-ok { color: var(--bon); }

.bloc { background: var(--surface); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 16px 20px; margin: 16px 0; }
.bloc h2 { margin-top: 0; }
.bloc--sable { background: var(--sable-fond); border-color: color-mix(in srgb, var(--sable) 55%, transparent); }
.ligne-etat { margin: 0 0 8px; color: var(--encre-2); }

/* Formulaires */
.grille { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.champ { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; grid-column: span 12; }
.champ--3 { grid-column: span 3; } .champ--4 { grid-column: span 4; } .champ--6 { grid-column: span 6; }
.champ--8 { grid-column: span 8; } .champ--12 { grid-column: span 12; }
@media (max-width: 700px) { .champ--3, .champ--4, .champ--6, .champ--8 { grid-column: span 12; } }
input, select {
  font: inherit; font-weight: 400; color: var(--encre); background: var(--surface);
  border: 1px solid var(--filet); border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%;
}
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible, .console:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--porte) 45%, transparent); outline-offset: 2px;
}
input[aria-invalid="true"] { border-color: var(--alerte); }
.champ__avec-bouton { display: flex; gap: 6px; }
.voir { border: 1px solid var(--filet); background: var(--surface); border-radius: 8px; width: 44px; cursor: pointer; color: var(--encre-2); }
fieldset { border: 0; border-top: 1px solid var(--filet); margin: 0 0 8px; padding: 16px 0 8px; }
legend { font-weight: 800; font-size: 18px; padding: 0 8px 0 0; }
.interrupteur { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-weight: 400; }
.interrupteur input { width: 18px; height: 18px; min-height: 0; accent-color: var(--porte); }
.interrupteur--petit { margin: 0; font-size: 13px; color: var(--console-encre); }
.options-cle { background: var(--surface); border: 1px dashed var(--filet); border-radius: var(--rayon); padding: 10px 14px; font-weight: 400; }
.options-cle summary { cursor: pointer; font-weight: 600; color: var(--porte); }
.options-cle .champ { margin-top: 10px; }

/* Boutons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.bouton {
  font: inherit; font-weight: 700; border-radius: 8px; padding: 10px 22px; min-height: 44px; cursor: pointer;
  background: var(--porte); color: var(--surface); border: 1px solid var(--porte);
}
.bouton:hover:not(:disabled) { background: var(--porte-fonce); border-color: var(--porte-fonce); }
.bouton:disabled { opacity: .45; cursor: not-allowed; }
.bouton--contour { background: transparent; color: var(--porte); }
.bouton--contour:hover:not(:disabled) { background: color-mix(in srgb, var(--porte) 10%, transparent); color: var(--porte); }
.bouton--petit { padding: 6px 14px; min-height: 34px; font-size: 14px; }
.bouton--sombre { background: #13263D; border-color: #24405F; color: var(--console-encre); }
.bouton--sombre:hover:not(:disabled) { background: #1B3352; border-color: #2E5076; }
.bouton.is-occupe { position: relative; color: transparent; }
.bouton.is-occupe::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* Listes de vérification */
.verifs { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 2px; }
.verifs li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--filet); }
.verifs--compact li { padding: 6px 0; font-size: 15px; }
.marque { flex: none; width: 22px; font-weight: 800; text-align: center; }
.is-ok .marque { color: var(--bon); }
.is-avert .marque { color: var(--ocre); }
.is-ko .marque { color: var(--alerte); }
.mini-console { background: var(--console-fond); color: var(--console-encre); font: 12.5px/1.5 "JetBrains Mono", monospace; padding: 12px; border-radius: 8px; max-height: 220px; overflow: auto; white-space: pre-wrap; }

/* Récapitulatif */
.recap { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 16px 0; }
.recap dt, .recap dd { padding: 10px 0; border-bottom: 1px solid var(--filet); margin: 0; }
.recap dt { color: var(--encre-3); padding-right: 24px; }
.recap dd { font-weight: 600; word-break: break-word; }

/* Installation */
.titre-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.chrono { font: 600 18px "JetBrains Mono", monospace; color: var(--encre-2); margin: 0; }
.progression { height: 6px; background: var(--filet); border-radius: 999px; overflow: hidden; margin: 8px 0 20px; }
.progression__barre { height: 100%; width: 0; background: var(--porte); transition: width .4s ease; }
.progression__barre.is-ko { background: var(--alerte); }
.install { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .install { grid-template-columns: 1fr; } }
.phases { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.phases li { display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14.5px; color: var(--encre-3); align-items: center; }
.phases .temoin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--filet); flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.phases li.is-actif { color: var(--encre); background: var(--surface); font-weight: 700; }
.phases li.is-actif .temoin { border-color: var(--sable); border-top-color: transparent; animation: tourne 1s linear infinite; }
.phases li.is-fait { color: var(--encre-2); }
.phases li.is-fait .temoin { background: var(--porte); border-color: var(--porte); color: var(--surface); }
.phases li.is-fait .temoin::after { content: "✓"; }
.phases li.is-avert .temoin { background: var(--sable); border-color: var(--sable); color: #2A2114; }
.phases li.is-avert .temoin::after { content: "!"; }
.phases li.is-ko { color: var(--alerte); font-weight: 700; }
.phases li.is-ko .temoin { background: var(--alerte); border-color: var(--alerte); color: #fff; animation: none; }
.phases li.is-ko .temoin::after { content: "✕"; }
.console-cadre { background: var(--console-fond); border-radius: var(--rayon); overflow: hidden; border: 1px solid #142A44; min-width: 0; }
.console-outils { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 10px 12px; background: #0B1A2B; border-bottom: 1px solid #142A44; }
.console {
  margin: 0; padding: 14px 16px; height: min(62vh, 640px); overflow: auto;
  font: 12.5px/1.55 "JetBrains Mono", ui-monospace, monospace; color: var(--console-encre);
  white-space: pre-wrap; word-break: break-word;
}
.console .l-titre { color: #8CC2FF; font-weight: 600; display: block; margin-top: 8px; }
.console .l-ok { color: #7FD1A8; }
.console .l-avert { color: #F2C66D; }
.console .l-ko { color: #FF8A80; font-weight: 600; }
.console .l-pale { color: #6E829B; }
.console.is-essentiel .l-pale, .console.is-essentiel .l-brut { display: none; }

/* Résultat */
.liens { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.lien-carte { display: block; padding: 14px 16px; border: 1px solid var(--filet); border-radius: var(--rayon); background: var(--surface); text-decoration: none; color: var(--encre); }
.lien-carte strong { display: block; color: var(--porte); }
.lien-carte span { font-size: 14px; color: var(--encre-2); word-break: break-all; }
.services { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; }
.services li { display: flex; gap: 8px; font-size: 14.5px; padding: 6px 0; border-bottom: 1px solid var(--filet); }

@media (prefers-reduced-motion: reduce) {
  *, *::after { animation: none !important; transition: none !important; }
}

/* Outils de maintenance */
.etapes__outils { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 10px 12px;
  border: 1px dashed var(--filet); border-radius: var(--rayon); background: transparent; color: var(--encre-2);
  font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.etapes__outils.is-actif { background: var(--surface); color: var(--encre); border-style: solid; box-shadow: inset 3px 0 0 var(--sable); }
.outils { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 16px 0 20px; }
.outil-groupe { background: var(--surface); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.outil-groupe h2 { margin: 0 0 4px; }
.outil-groupe .aide { margin: 0; font-size: 14px; }
.outil-ligne { display: flex; gap: 10px; flex-wrap: wrap; }
.outil-ligne .bouton { flex: 1 1 auto; }
.console-titre { color: var(--console-encre); font-weight: 700; margin-right: auto; }
.console--outil { height: min(48vh, 480px); }

/* Mise à jour */
.maj-etapes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 8px 0 20px; }
.recap--versions { max-width: 560px; }

/* Authentification */
.cadre--auth { display: block; max-width: 620px; }
.cadre--auth .panneau { max-width: none; }
.entete__droite { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.entete__compte { font-size: 14px; }
.bouton-deconnexion {
  font: inherit; font-size: 14px; font-weight: 600; padding: 6px 14px; min-height: 36px; cursor: pointer;
  color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 999px;
}
.bouton-deconnexion:hover { background: color-mix(in srgb, currentColor 12%, transparent); }

/* Serveurs connus */
.serveurs-connus { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.serveur-connu {
  width: 100%; display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
  padding: 10px 12px; border: 1px solid var(--filet); border-radius: 8px;
  background: var(--surface); color: var(--encre); font: inherit;
}
.serveur-connu:hover { border-color: var(--porte); }
.serveur-connu strong { color: var(--porte); }
.serveur-connu span { font-size: 14px; color: var(--encre-2); }
.serveur-connu .serveur-connu__coffre { color: var(--porte); font-weight: 600; }
.serveurs-connus li { display: grid; gap: 4px; justify-items: start; }
.lien-discret {
  border: 0; background: none; padding: 2px 4px; font: inherit; font-size: 14px;
  color: var(--encre-2); text-decoration: underline; cursor: pointer;
}
.lien-discret:hover { color: var(--alerte); }

/* Historique */
.filtres-historique { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; margin: 16px 0; align-items: end; }
.tableau-cadre { overflow-x: auto; border: 1px solid var(--filet); border-radius: var(--rayon); background: var(--surface); }
.historique { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.historique th, .historique td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--filet); vertical-align: top; }
.historique th { font-size: 12.5px; color: var(--encre-3); text-transform: uppercase; letter-spacing: .04em; }
.historique tbody tr { cursor: pointer; }
.historique tbody tr:hover, .historique tbody tr:focus-visible { background: var(--chaux); }
.historique tbody tr:last-child td { border-bottom: 0; }
.resultat-operation.is-reussi { color: var(--porte); font-weight: 700; }
.resultat-operation.is-en-cours, .resultat-operation.is-annule { color: var(--ocre); font-weight: 700; }
.resultat-operation.is-echec { color: var(--alerte); font-weight: 700; }
.historique-detail { margin-top: 20px; }
.detail-champs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0 16px; }
.detail-champs dt { color: var(--encre-3); }
.detail-champs dd { margin: 0; word-break: break-word; }
.liste-comptes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.liste-comptes li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--filet); font-size: 14px; }
.liste-comptes li:last-child { border-bottom: 0; }


/* Versions publiées et console du serveur */
.versions { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--filet); }
.versions h3 { margin: 0 0 4px; font-size: 16px; }
.versions__choix { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.versions__choix .champ { flex: 1 1 240px; margin: 0; }
.versions__nouvelle { color: var(--porte); font-weight: 600; }
.lien-console { font-weight: 600; color: var(--porte); word-break: break-all; }
.serveur-connu .serveur-connu__console { color: var(--encre); }
