@font-face { font-family: "Inter Display"; src: url("/polices/display-black.woff") format("woff"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Inter Texte"; src: url("/polices/texte.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter Texte"; src: url("/polices/texte-gras.woff") format("woff"); font-weight: 600; font-display: swap; }

:root {
    --fond: #e8edef;
    --carte: #f8fafb;
    --encre: #15233b;
    --doux: #34445c;
    --gris: #56657a;
    --trait: #c6d0d7;
    --route: #b4316c;
    --ok: #187a4f;
    --ok-pale: #dff2e8;
    --attention: #9a5b00;
    --attention-pale: #fbecd3;
    --panne: #b03a28;
    --panne-pale: #fbe3de;
    --vide: #d5dde2;
    --serie-1: #2a78d6;
    --serie-2: #eb6834;
    --serie-3: #1baf7a;
    --serie-4: #6250d6;
    --serie-5: #e87ba4;
    --serie-6: #008300;
    --serie-7: #eda100;
    --serie-8: #e34948;
    --titre: "Inter Display", "Segoe UI", system-ui, sans-serif;
    --texte: "Inter Texte", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --fond: #0e1624;
        --carte: #152034;
        --encre: #e8edf4;
        --doux: #bac6d6;
        --gris: #8e9cb2;
        --trait: #273650;
        --route: #e65d95;
        --ok: #4cc38a;
        --ok-pale: #14302a;
        --attention: #f0b450;
        --attention-pale: #3a2c12;
        --panne: #f07a63;
        --panne-pale: #3d1f1a;
        --vide: #2a3851;
        --serie-1: #3987e5;
        --serie-2: #d95926;
        --serie-3: #199e70;
        --serie-4: #9085e9;
        --serie-5: #d55181;
        --serie-6: #008300;
        --serie-7: #c98500;
        --serie-8: #e66767;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 400 1rem/1.55 var(--texte); }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
a { color: inherit; }
code { padding: 0.05rem 0.35rem; border-radius: 4px; background: color-mix(in srgb, var(--trait) 45%, transparent); font: 0.86em var(--mono); }
:focus-visible { outline: 3px solid var(--route); outline-offset: 2px; }

.sauter { position: absolute; left: 1rem; top: -4rem; padding: 0.6rem 1rem; border-radius: 8px; background: var(--encre); color: var(--fond); z-index: 10; }
.sauter:focus { top: 1rem; }

/* ---------- Connexion ---------- */
.connexion { display: grid; min-height: 100vh; place-items: center; padding: 1.5rem 1rem; }
.connexion-carte { display: grid; gap: 0.9rem; width: min(100%, 24rem); padding: 2rem 1.75rem; border: 1px solid var(--trait); border-radius: 18px; background: var(--carte); box-shadow: 0 30px 60px -40px rgb(21 35 59 / 0.6); }
.connexion-carte img { border-radius: 12px; }
.connexion-carte h1 { font: 900 1.9rem/1.05 var(--titre); letter-spacing: -0.03em; }
.sous-titre { margin-top: -0.5rem; color: var(--gris); }
.connexion form { display: grid; gap: 0.45rem; margin-top: 0.4rem; }
.connexion label { margin-top: 0.4rem; font-weight: 600; }
.connexion label span { display: block; color: var(--gris); font-size: 0.85rem; font-weight: 400; }
.connexion input { width: 100%; padding: 0.75rem 0.9rem; border: 1.5px solid var(--trait); border-radius: 10px; background: var(--fond); color: var(--encre); font: inherit; }
.connexion input#code { font: 600 1.4rem var(--mono); letter-spacing: 0.35em; text-align: center; }
.connexion input:focus { border-color: var(--route); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--route) 30%, transparent); }
.connexion button { margin-top: 0.9rem; padding: 0.85rem; border: 0; border-radius: 10px; background: var(--route); color: #fff; font: 600 1rem var(--texte); cursor: pointer; }
.connexion button:hover { filter: brightness(1.08); }
.message { padding: 0.7rem 0.9rem; border-radius: 10px; font-size: 0.93rem; }
.message-erreur { background: var(--panne-pale); color: var(--panne); }
.message-info { background: var(--attention-pale); color: var(--encre); }

/* ---------- En-tête ---------- */
.entete { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--trait); background: color-mix(in srgb, var(--fond) 88%, transparent); backdrop-filter: blur(10px); }
.entete-dedans { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.2rem; width: min(100% - 2rem, 72rem); margin: 0 auto; padding: 0.75rem 0; }
.marque { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; text-decoration: none; }
.marque img { border-radius: 8px; }
.maj { margin-right: auto; color: var(--gris); font-size: 0.88rem; }
.bouton-discret { padding: 0.45rem 0.9rem; border: 1px solid var(--trait); border-radius: 999px; background: transparent; color: var(--doux); font: 600 0.88rem var(--texte); cursor: pointer; }
.bouton-discret:hover { border-color: var(--encre); color: var(--encre); }

/* ---------- Tableau ---------- */
.tableau { display: grid; gap: 2.2rem; width: min(100% - 2rem, 72rem); margin: 0 auto; padding: 1.8rem 0 3.5rem; }
h2 { font: 900 1.55rem/1.1 var(--titre); letter-spacing: -0.025em; }
.explication { margin: 0.35rem 0 0.9rem; color: var(--gris); font-size: 0.92rem; }
section > h2 + .carte, section > h2 + .grille-sites { margin-top: 0.9rem; }
.carte { padding: 1.25rem 1.35rem; border: 1px solid var(--trait); border-radius: 16px; background: var(--carte); }

.bilan { display: grid; gap: 0.8rem; padding: 1.5rem 1.6rem; border-radius: 18px; border: 1px solid var(--trait); background: var(--carte); }
.bilan-ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--trait)); background: var(--ok-pale); }
.bilan-attention { border-color: color-mix(in srgb, var(--attention) 45%, var(--trait)); background: var(--attention-pale); }
.bilan-panne { border-color: color-mix(in srgb, var(--panne) 45%, var(--trait)); background: var(--panne-pale); }
.bilan h1 .pastille { padding: 0; background: none; font: 900 clamp(1.7rem, 4vw, 2.3rem)/1.05 var(--titre); letter-spacing: -0.03em; }
.bilan h1 .point { width: 0.85rem; height: 0.85rem; }
.bilan p { color: var(--doux); }
.problemes { display: grid; gap: 0.35rem; padding-left: 1.2rem; }
.problemes li::marker { color: var(--panne); }
.probleme-attention::marker { color: var(--attention) !important; }

.pastille { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.86rem; font-weight: 600; white-space: nowrap; }
.pastille .point { width: 0.55rem; height: 0.55rem; flex: none; border-radius: 50%; background: currentColor; }
.pastille-ok { background: var(--ok-pale); color: var(--ok); }
.pastille-attention { background: var(--attention-pale); color: var(--attention); }
.pastille-panne { background: var(--panne-pale); color: var(--panne); }
.pastille-panne .point { animation: pouls 1.6s ease-in-out infinite; }
@keyframes pouls { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .pastille-panne .point { animation: none; } }

.grille-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.site { display: grid; gap: 0.7rem; }
.carte-haut { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.carte-haut h3 { font-size: 1.15rem; }
.lien-site { margin-top: -0.45rem; color: var(--gris); font-size: 0.9rem; text-decoration: none; overflow-wrap: anywhere; }
.lien-site:hover { color: var(--route); text-decoration: underline; }
.chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.chiffres div { display: grid; gap: 0.1rem; }
.chiffres dt { color: var(--gris); font-size: 0.78rem; }
.chiffres dd { font-weight: 600; }
.chiffres.grands { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1rem; }
.chiffres.grands dd { font: 900 2.2rem/1 var(--titre); letter-spacing: -0.03em; }
.heures { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 1.6rem; }
.heure { border-radius: 3px; background: var(--vide); }
.heure-ok { background: var(--ok); }
.heure-panne { background: var(--panne); }
.legende { display: flex; justify-content: space-between; margin-top: -0.35rem; color: var(--gris); font-size: 0.75rem; }

.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 2.2rem 1.4rem; }
.deux-colonnes .carte { display: grid; align-content: start; gap: 1rem; margin-top: 0.9rem; }
.mesure { display: grid; gap: 0.4rem; }
.mesure p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1rem; }
.mesure p span { color: var(--gris); font-size: 0.88rem; }
.jauge { height: 0.6rem; overflow: hidden; border-radius: 999px; background: var(--vide); }
.jauge span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.jauge-attention span { background: var(--attention); }
.jauge-panne span { background: var(--panne); }
.faits { display: grid; gap: 0.5rem; padding: 0.9rem 0 0; border-top: 1px solid var(--trait); list-style: none; }
.petit-titre { color: var(--gris); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.liste-attaques { display: grid; gap: 0.1rem; padding: 0; list-style: none; }
.liste-attaques li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px dashed var(--trait); }
.liste-attaques li:last-child { border-bottom: 0; }

.tableau-defile { padding: 0.4rem 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { padding: 0.6rem 1.1rem; text-align: left; white-space: nowrap; }
thead th { color: var(--gris); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
tbody tr + tr { border-top: 1px solid var(--trait); }
tbody th { font-weight: 600; }
td code { font-size: 0.8rem; }

.vide { display: grid; gap: 1rem; padding: 4rem 1rem; text-align: center; }

@media (max-width: 40rem) {
    .chiffres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .chiffres dd { font-size: 0.95rem; }
    .maj { order: 3; width: 100%; }
    .entete-dedans { justify-content: space-between; }
}
.tableau > *, .deux-colonnes > * { min-width: 0; }
@media (max-width: 40rem) {
    .mesure p { display: grid; }
}
.mesure p span { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Tentatives de connexion ---------- */
.tentatives td.nombre { font-variant-numeric: tabular-nums; text-align: right; }
.tentatives td.comptes { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; color: var(--doux); }
.tentatives td.etats { display: flex; gap: 0.35rem; }
.tentatives th code { font-size: 0.85rem; }
.voir-plus { margin-top: 0.8rem; }
.voir-plus summary { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.1rem; border: 1px solid var(--trait); border-radius: 999px; background: var(--carte); color: var(--encre); font-weight: 600; cursor: pointer; list-style: none; }
.voir-plus summary::-webkit-details-marker { display: none; }
.voir-plus summary::after { content: "▾"; transition: transform 0.2s; }
.voir-plus[open] summary::after { transform: rotate(180deg); }
.voir-plus summary:hover { border-color: var(--route); color: var(--route); }
.voir-plus .carte { margin-top: 0.8rem; max-height: 32rem; overflow-y: auto; }
.voir-plus thead th { position: sticky; top: 0; background: var(--carte); }
.pastille-neutre { background: color-mix(in srgb, var(--trait) 55%, transparent); color: var(--doux); }
.tentatives td.etats { flex-wrap: wrap; white-space: normal; min-width: 8rem; }

/* ---------- Cartes des sites : 4 chiffres en 2 × 2 ---------- */
.site .chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 0.7rem; }

/* ---------- Graphique du temps de réponse (7 jours) ---------- */
.graphique { display: grid; gap: 0.9rem; margin: 0.9rem 0 0; }
.graphique-legende { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; padding: 0; list-style: none; font-weight: 600; font-size: 0.92rem; }
.graphique-legende li { display: inline-flex; align-items: center; gap: 0.5rem; }
.trait-legende { width: 1.1rem; height: 3px; border-radius: 2px; background: var(--couleur); }
.legende-valeur { color: var(--gris); font-weight: 400; font-size: 0.84rem; }
.serie-1 { --couleur: var(--serie-1); } .serie-2 { --couleur: var(--serie-2); } .serie-3 { --couleur: var(--serie-3); } .serie-4 { --couleur: var(--serie-4); }
.serie-5 { --couleur: var(--serie-5); } .serie-6 { --couleur: var(--serie-6); } .serie-7 { --couleur: var(--serie-7); } .serie-8 { --couleur: var(--serie-8); }
.graphique-zone { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; }
.graphique-axe-y { position: relative; width: 3.6rem; color: var(--gris); font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.graphique-axe-y span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; }
.graphique-trace { position: relative; height: clamp(12rem, 30vw, 17rem); touch-action: pan-y; cursor: crosshair; }
.graphique-trace svg { display: block; width: 100%; height: 100%; overflow: visible; }
.graphique-trace line { stroke: var(--trait); stroke-width: 1; vector-effect: non-scaling-stroke; }
.graphique-trace line.minuit { stroke-dasharray: 2 4; }
.graphique-trace line.base { stroke: var(--gris); }
.graphique-trace path { fill: none; stroke: var(--couleur); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.graphique-axe-x { position: relative; height: 1.2rem; margin-left: 4.2rem; color: var(--gris); font-size: 0.76rem; }
.graphique-axe-x span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.graphique-curseur { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--gris); pointer-events: none; }
.graphique-bulle { position: absolute; top: 0.4rem; z-index: 2; display: grid; gap: 0.2rem; min-width: 11rem; padding: 0.6rem 0.75rem; border: 1px solid var(--trait); border-radius: 10px; background: var(--carte); box-shadow: 0 12px 30px -14px rgb(0 0 0 / 0.45); font-size: 0.84rem; pointer-events: none; }
.graphique-bulle strong { margin-bottom: 0.15rem; }
.graphique-bulle span { display: flex; align-items: center; gap: 0.45rem; }
.graphique-bulle b { margin-left: auto; padding-left: 1rem; font-variant-numeric: tabular-nums; }
.graphique-bulle i { width: 0.7rem; height: 3px; border-radius: 2px; background: var(--couleur); }
.graphique .voir-plus { margin-top: 0; }
.graphique .voir-plus table td { font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) {
    .graphique-axe-y { width: 2.9rem; font-size: 0.68rem; }
    .graphique-axe-x { margin-left: 3.5rem; font-size: 0.68rem; }
    .graphique-axe-x span:nth-child(even) { display: none; }
}

/* ---------- Sauvegardes ---------- */
.liste-sauvegardes { display: grid; gap: 0.2rem; padding: 0; list-style: none; }
.liste-sauvegardes li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.6rem 0; border-bottom: 1px dashed var(--trait); }
.liste-sauvegardes li:last-child { border-bottom: 0; }
.liste-sauvegardes strong { flex: 1 1 14rem; }
.muet { color: var(--gris); font-size: 0.86rem; }
