/* Police Geist, servie par l'application elle-même (app/static/fonts/, SIL OFL
   1.1) : aucune requête vers un service de polices, et donc aucune trace laissée
   chez un tiers à chaque consultation d'un rapport. */
@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

/* Charte DomainExposure — reprise de la console de support BTBS.
   Jetons relevés sur https://support-proxmox.lab.cloud-start.fr/ :
   fond #04070c, accent orange Proxmox #e57000, bleu #3db8ff, police Geist.

   Les couleurs de gravité restent celles du moteur d'analyse : elles portent du
   sens et ne sont pas des éléments de marque. */

:root {
  --bg: #04070c;
  --bg2: #070b12;
  --panel: rgba(255, 255, 255, .025);
  --ink: #fff;
  --mut: #a9b7c6;
  --soft: #b4c4de;
  --dim: #5f7295;
  --line: rgba(255, 255, 255, .08);
  --line2: #2a3d5f;
  --px: #e57000;
  --px2: #ff9a3c;
  --blue: #3db8ff;

  /* Gravités — palette de statut, inchangée quelle que soit la marque. */
  --critique: #ff5a5a;
  --eleve: #ff9a3c;
  --moyen: #ffc83d;
  --faible: #8ba0bd;
  --info: #5f7295;
  --bon: #35d07f;
  --critique-piste: rgba(255, 90, 90, .16);
  --eleve-piste: rgba(255, 154, 60, .16);
  --moyen-piste: rgba(255, 200, 61, .16);
  --faible-piste: rgba(139, 160, 189, .16);
  --info-piste: rgba(95, 114, 149, .16);
  --bon-piste: rgba(53, 208, 127, .16);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
}

/* Halo discret, repris du site : il donne de la profondeur sans distraire. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 50% -10%, rgba(229, 112, 0, .10), transparent 60%),
    radial-gradient(900px 520px at 100% 100%, rgba(61, 184, 255, .06), transparent 60%);
  z-index: 0;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: "Geist Mono", ui-monospace, "SFMono-Regular", monospace; }

/* ------------------------------------------------------------- titres --- */
h1, h2, h3 { margin: 0; font-weight: 300; }
h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  letter-spacing: .14em;
  text-transform: uppercase;
  background: linear-gradient(92deg, #fff 18%, var(--px2) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 { font-size: 1.25rem; letter-spacing: .06em; text-transform: uppercase; }
h3 { font-size: 1rem; letter-spacing: .04em; font-weight: 500; }

.kick {
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--dim);
}
.mut { color: var(--mut); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }

/* ----------------------------------------------------------- surfaces --- */
.panel {
  position: relative;
  z-index: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 22px;
}
.panel + .panel { margin-top: 18px; }

/* -------------------------------------------------------- formulaires --- */
label { display: block; font-size: 12px; letter-spacing: .08em;
        text-transform: uppercase; color: var(--mut); margin-bottom: 7px; }

input, select {
  width: 100%;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line2);
  border-radius: 2px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  padding: 12px 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: #51607a; }
input:focus, select:focus {
  border-color: var(--px);
  background: rgba(229, 112, 0, .06);
  box-shadow: 0 0 0 3px rgba(229, 112, 0, .18);
}
input[type="checkbox"] { width: auto; accent-color: var(--px); }

.btn {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-block;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, .7);
  padding: 12px 24px;
  text-align: center;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover, .btn:focus-visible { background: #fff; color: var(--bg); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn[disabled]:hover { background: none; color: var(--ink); }

.btn.primaire { background: var(--px); border-color: var(--px); }
.btn.primaire:hover, .btn.primaire:focus-visible { background: var(--px2); border-color: var(--px2); color: var(--bg); }

.btn.mini { padding: 7px 13px; font-size: 11px; letter-spacing: .14em; }

/* ------------------------------------------------------------ alertes --- */
.alerte {
  border-left: 2px solid var(--critique);
  background: var(--critique-piste);
  padding: 11px 13px;
  font-size: 13.5px;
}

/* ===========================================================================
   Couche de composants — remplace l'utilitaire Tailwind chargé depuis un CDN.
   L'outil sert à auditer des expositions : il ne doit pas en créer une en
   dépendant d'un script tiers, et doit fonctionner sur un poste hors ligne.
   =========================================================================== */

/* Variables lues par la courbe d'évolution (app/chart.py). Le même SVG est
   embarqué dans le rapport imprimé, qui ne définit rien et garde donc ses
   couleurs d'encre sur papier. */
:root {
  --chart-grille: rgba(255, 255, 255, .09);
  --chart-encre: #8094b0;
  --chart-fond: #0b1018;
  --chart-trace: var(--blue);
}

/* --------------------------------------------------------------- gabarit --- */
.enveloppe { position: relative; z-index: 1; max-width: 1140px; margin: 0 auto; padding: 30px 22px 60px; }

.entete { display: flex; align-items: flex-start; justify-content: space-between;
          gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.entete .accroche { color: var(--mut); font-size: 13.5px; max-width: 62ch; margin: 9px 0 0; }

.barre { display: flex; align-items: baseline; justify-content: space-between;
         gap: 12px; flex-wrap: wrap; }
.rangee { display: flex; gap: 10px; flex-wrap: wrap; }
.rangee.serree { gap: 6px; }
.rangee.bas { align-items: flex-end; }
.rangee.centre { align-items: center; }
.pousse { margin-left: auto; }
.grille { display: grid; gap: 12px; }
@media (min-width: 720px) {
  .grille.deux { grid-template-columns: 1fr 1fr; }
  .grille.trois { grid-template-columns: repeat(3, 1fr); }
}
.pile > * + * { margin-top: 14px; }
.enveloppe > section + section { margin-top: 18px; }
.cachee { display: none !important; }
.nowrap { white-space: nowrap; }

/* --------------------------------------------------------------- sections -- */
/* Titre de section souligné d'un filet orange, comme les pages du rapport. */
.titre-section {
  position: relative;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px 16px; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
/* Filet orange sous l'amorce du titre : repris des pages du rapport. */
.titre-section > h2, .titre-section > h3 { position: relative; }
.titre-section > h2::after, .titre-section > h3::after {
  content: ""; position: absolute; left: 0; bottom: -11px; width: 46px; height: 2px;
  background: var(--px);
}

/* ------------------------------------------------------------ formulaires -- */
.champ { flex: 1 1 260px; min-width: 0; }
.aide { color: var(--dim); font-size: 12px; margin: 7px 0 0; }

.consentement {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13.5px; color: var(--soft);
  padding: 10px 12px;
  border: 1px solid var(--line); border-left: 2px solid var(--line2);
  background: rgba(255, 255, 255, .012);
}
.consentement:has(input:checked) { border-left-color: var(--bon); color: var(--ink); }
.consentement input { margin-top: 3px; flex: none; }
.consentement label { margin: 0; text-transform: none; letter-spacing: 0;
                      font-size: inherit; color: inherit; }
.consentement strong { color: var(--px2); font-weight: 500; }

/* ------------------------------------------------------------- étiquettes -- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line2); border-radius: 2px;
  padding: 4px 9px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mut);
}
.etiq { font-size: 11.5px; font-weight: 600; letter-spacing: .08em;
        text-transform: uppercase; white-space: nowrap; }

/* ---------------------------------------------------------------- chiffre -- */
/* Figure héroïque + jauge : le score se lit d'un coup d'œil, sans camembert. */
.hero { font-size: 60px; font-weight: 300; line-height: .92; letter-spacing: -.02em;
        font-variant-numeric: tabular-nums; }
.hero .sur { font-size: 17px; color: var(--dim); letter-spacing: .04em; }
.note {
  font-size: 22px; font-weight: 500; line-height: 1;
  padding: 10px 15px; border: 1px solid; border-radius: 2px;
  font-variant-numeric: tabular-nums;
}

.meter { height: 9px; border-radius: 5px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 0 4px 4px 0; transition: width .4s ease; }

/* Barre segmentée : 28 px de haut, écarts de 2 px dans la couleur du support. */
.segbar { display: flex; height: 28px; gap: 2px; }
.segbar > div { border-radius: 3px; line-height: 28px; padding-left: 7px; overflow: hidden;
                white-space: nowrap; font-size: 12px; font-weight: 600; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 9px;
           font-size: 12px; color: var(--mut); }
.legende > span { display: inline-flex; align-items: center; gap: 6px; }
.pastille { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }

/* --------------------------------------------------------------- tableaux -- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
  font-weight: 500; color: var(--soft);
  background: #16202f; border-bottom: 1px solid var(--line2);
  padding: 9px 10px; white-space: nowrap;
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top;
                color: var(--soft); }
table.data tbody tr:nth-child(even) { background: rgba(255, 255, 255, .014); }
table.data tbody tr:hover { background: rgba(229, 112, 0, .05); }
table.data td strong { color: var(--ink); font-weight: 500; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: none; }

/* --------------------------------------------------------------- constats -- */
details.module {
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px;
  padding: 14px 18px; position: relative; z-index: 1;
}
details.module + details.module { margin-top: 10px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details.module > summary { display: flex; align-items: center; justify-content: space-between;
                           gap: 12px; flex-wrap: wrap; }
details.module > summary .nom { font-size: 14.5px; letter-spacing: .04em; }
details.module > summary::before {
  content: "+"; color: var(--px2); font-size: 15px; width: 12px; flex: none;
}
details.module[open] > summary::before { content: "–"; }

.constat {
  border: 1px solid var(--line); border-left: 2px solid var(--info);
  background: rgba(255, 255, 255, .014);
  padding: 13px 15px;
}
.constat + .constat { margin-top: 10px; }
.constat .titre { display: flex; align-items: baseline; justify-content: space-between;
                  gap: 10px; flex-wrap: wrap; }
.constat .titre strong { font-size: 14px; font-weight: 500; }
.constat dl { margin: 11px 0 0; font-size: 13.5px; }
.constat dt { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
              color: var(--dim); margin-top: 9px; }
.constat dd { margin: 3px 0 0; color: var(--soft); }
.constat dd.implique { border-left: 2px solid var(--line2); padding-left: 10px; }
.constat .code { font-size: 11px; color: var(--dim); margin: 10px 0 0; }

/* ------------------------------------------------------------- chronologie -- */
.tl { list-style: none; margin: 0; padding-left: 20px; border-left: 1px solid var(--line2); }
.tl li { position: relative; padding: 0 0 15px 16px; font-size: 13.5px; color: var(--soft); }
.tl li::before {
  content: ""; position: absolute; left: -25px; top: 7px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--eleve); box-shadow: 0 0 0 3px var(--bg);
}
.tl li strong { color: var(--ink); font-weight: 500; }

/* ----------------------------------------------------------------- bulles -- */
.bulle { padding: 11px 14px; font-size: 13.5px; border-left: 2px solid var(--info);
         background: var(--info-piste); color: var(--soft); }
.bulle.bon { border-left-color: var(--bon); background: var(--bon-piste); }
.bulle.erreur { border-left-color: var(--critique); background: var(--critique-piste);
                color: var(--ink); }
.bulle strong { color: var(--ink); font-weight: 500; }

.vide { color: var(--dim); font-size: 13.5px; font-style: italic; }

/* -------------------------------------------------------------- pied de page */
.pied { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line);
        color: var(--dim); font-size: 12px; max-width: 90ch; }

/* Zone défilante pour les longues listes (sous-domaines). */
.defile { max-height: 340px; overflow: auto; }

/* Les listes à puces des comparaisons. */
ul.puces { margin: 6px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--soft); }
ul.puces li { margin-top: 3px; }
