/* ==========================================
   Portail clients AUCHO — feuille de style
   ==========================================
   Thème clair « local technique » : fond calcaire, encre ardoise, orange AUCHO réservé à la marque
   et aux actions. Barlow (signalétique industrielle) pour le texte, Barlow Semi Condensed pour les
   titres et les valeurs. Polices hébergées ici : aucune ressource externe (RGPD, CSP stricte). */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
    --fond: #EEF1F2;          /* calcaire */
    --surface: #FFFFFF;
    --encre: #1E2A33;         /* ardoise */
    --encre-2: #52626D;
    --trait: #D6DDE1;
    --trait-fin: #E6EBEE;
    --orange: #E8731A;        /* AUCHO */
    --orange-texte: #A44C0B;
    --ok: #2F7D55;
    --attention: #9A6200;
    --alerte: #B8402B;
    --maint: #3D63B0;
    --inconnu: #6B7A84;
    --titre: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
    --texte: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
    --rayon: 10px;
    --largeur: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--fond); color: var(--encre);
    font: 400 1rem/1.5 var(--texte); font-variant-numeric: tabular-nums;
    min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--orange-texte); }
a:hover { color: var(--encre); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--titre); line-height: 1.15; margin: 0; }
h2 { font-size: 1.45rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
.discret { color: var(--encre-2); }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- En-tête ---------- */
.entete { background: var(--surface); border-bottom: 1px solid var(--trait); }
.entete-interieur { max-width: var(--largeur); margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.marque { display: flex; align-items: center; gap: .55rem; color: var(--encre); text-decoration: none; margin-right: auto; }
.marque img { width: 26px; height: auto; }
.marque span { font: 700 1.25rem/1 var(--titre); letter-spacing: .06em; }
.nav { display: flex; align-items: center; gap: 1.1rem; font-size: .95rem; flex-wrap: wrap; }
.nav a { color: var(--encre-2); text-decoration: none; padding: .35rem 0; }
.nav a:hover { color: var(--encre); text-decoration: underline; text-underline-offset: 3px; }
.nav .qui { color: var(--encre); font-weight: 500; }

main { flex: 1 0 auto; width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.pied { max-width: var(--largeur); width: 100%; margin: 0 auto; padding: 1.25rem; color: var(--encre-2); font-size: .85rem; border-top: 1px solid var(--trait); }

/* ---------- Verdict (haut de page d'un site) ---------- */
.lieu { color: var(--encre-2); font-size: 1rem; margin: 0 0 .35rem; }
.lieu strong { color: var(--encre); font-weight: 600; }
.verdict { position: relative; background: var(--surface); border-radius: var(--rayon); padding: 1.6rem 1.6rem 1.4rem 2.1rem; margin-bottom: 2rem; border: 1px solid var(--trait); }
.verdict::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; border-radius: var(--rayon) 0 0 var(--rayon); background: var(--inconnu); }
.verdict.n-ok::before { background: var(--ok); }
.verdict.n-attention::before { background: var(--attention); }
.verdict.n-alerte::before { background: var(--alerte); }
.verdict.n-maintenance::before { background: var(--maint); }
.verdict h1 { font-size: clamp(2rem, 6.2vw, 3.4rem); font-weight: 600; letter-spacing: -.01em; line-height: 1.02; max-width: 22ch; }
.verdict .detail { margin: .6rem 0 0; font-size: 1.1rem; max-width: 60ch; }
.verdict .releve { margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; color: var(--encre-2); font-size: .95rem; }
.verdict .releve span { display: inline-flex; align-items: center; gap: .45rem; }

/* Pastille d'état (point coloré + mot : la couleur n'est jamais seule porteuse du sens) */
.point { width: .62rem; height: .62rem; border-radius: 50%; background: var(--inconnu); flex: none; display: inline-block; }
.e-ok .point, .point.e-ok { background: var(--ok); }
.e-attention .point, .point.e-attention { background: var(--attention); }
.e-alerte .point, .point.e-alerte, .e-defaut .point { background: var(--alerte); }
.e-maintenance .point { background: var(--maint); }

/* ---------- Sections ---------- */
.section { margin-top: 2.25rem; }
.section > header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.section > header p { margin: 0; color: var(--encre-2); font-size: .95rem; }
.panneau { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); }

/* ---------- Circuits (synoptique) ---------- */
.circuits { list-style: none; margin: 0; padding: 0; }
.circuit { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, .9fr); gap: .5rem 1.25rem;
           align-items: center; padding: 1rem 1.25rem; border-top: 1px solid var(--trait-fin); }
.circuit:first-child { border-top: 0; }
.c-nom strong { display: block; font-weight: 600; font-size: 1.05rem; }
.c-nom small { color: var(--encre-2); font-size: .82rem; }
.c-temp { display: flex; align-items: baseline; gap: .3rem; flex-wrap: wrap; }
.c-temp .valeur { font: 600 2rem/1 var(--titre); }
.c-temp .unite { font: 500 1.05rem/1 var(--titre); color: var(--encre-2); }
.c-temp small { flex-basis: 100%; color: var(--encre-2); font-size: .82rem; }
.c-pompe { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; font-size: .95rem; }
.c-pompe small { color: var(--encre-2); }
.pompe { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .6rem; border-radius: 999px; font-weight: 500; font-size: .9rem;
         border: 1px solid var(--trait); color: var(--encre-2); }
.pompe.marche { border-color: #9CC7AE; background: #EDF6F0; color: #1F5E3E; }
.pompe svg { width: 14px; height: 14px; }
.pompe.marche svg { animation: tourne 2.4s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.c-etat { display: flex; align-items: center; gap: .45rem; font-size: .92rem; justify-content: flex-end; text-align: right; }
.e-alerte.c-etat, .e-defaut.c-etat { color: var(--alerte); font-weight: 600; }

/* ---------- Manomètre en bande ---------- */
.manometres { display: grid; gap: 1rem; }
.manometre { padding: 1.1rem 1.25rem 1rem; }
.m-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.m-tete .valeur { font: 600 2rem/1 var(--titre); }
.m-tete .valeur span { font-size: 1.05rem; color: var(--encre-2); font-weight: 500; }
.m-piste { position: relative; height: 14px; margin: 1rem 0 .45rem; border-radius: 7px; background: #E3E8EB; }
.m-plage { position: absolute; top: 0; bottom: 0; background: #BFDCCB; border-left: 2px solid var(--ok); border-right: 2px solid var(--ok); }
.m-aiguille { position: absolute; top: -6px; width: 4px; height: 26px; margin-left: -2px; border-radius: 2px; background: var(--encre); }
.e-alerte .m-aiguille { background: var(--alerte); }
.m-echelle { display: flex; justify-content: space-between; color: var(--encre-2); font-size: .82rem; gap: .5rem; }

/* ---------- Points à vérifier ---------- */
.anomalies { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.anomalie { background: var(--surface); border: 1px solid var(--trait); border-left: 5px solid var(--attention); border-radius: 6px; padding: .8rem 1rem; }
.anomalie p { margin: 0; }
.anomalie small { color: var(--encre-2); }

/* ---------- Historique ---------- */
.periodes { display: inline-flex; border: 1px solid var(--trait); border-radius: 8px; overflow: hidden; background: var(--surface); }
.periodes button { font: 500 .95rem var(--texte); color: var(--encre-2); background: none; border: 0; padding: .45rem .95rem; cursor: pointer; min-height: 40px; }
.periodes button + button { border-left: 1px solid var(--trait); }
.periodes button[aria-pressed="true"] { background: var(--encre); color: #fff; }
.graphes { display: grid; gap: 1rem; }
.graphe { padding: 1rem 1.1rem .75rem; }
.graphe h3 { margin-bottom: .2rem; }
.graphe p { margin: 0 0 .5rem; color: var(--encre-2); font-size: .88rem; }
.graphe .zone { position: relative; height: 260px; }

/* ---------- Configuration ---------- */
details.panneau { padding: 0; }
details.panneau > summary { cursor: pointer; padding: 1rem 1.25rem; font: 600 1.15rem var(--titre); list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.panneau > summary::-webkit-details-marker { display: none; }
details.panneau > summary::after { content: "+"; font: 500 1.4rem/1 var(--texte); color: var(--encre-2); }
details.panneau[open] > summary::after { content: "–"; }
.details-corps { padding: 0 1.25rem 1.25rem; }
table.tableau { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tableau th { text-align: left; font-weight: 600; color: var(--encre-2); font-size: .85rem; padding: .5rem .6rem; border-bottom: 1px solid var(--trait); }
.tableau td { padding: .55rem .6rem; border-bottom: 1px solid var(--trait-fin); vertical-align: top; }
.tableau td.num { white-space: nowrap; }
.code { font-size: .82rem; color: var(--encre-2); }

/* ---------- Liste des sites ---------- */
.titre-page { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 600; margin-bottom: .4rem; }
.recherche { width: 100%; max-width: 380px; font: inherit; padding: .6rem .8rem; border: 1px solid var(--trait); border-radius: 8px; background: var(--surface); margin: 1rem 0; }
.sites { list-style: none; margin: 0; padding: 0; }
.sites li + li { border-top: 1px solid var(--trait-fin); }
.sites a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1rem; padding: 1rem 1.25rem; color: var(--encre); text-decoration: none; }
.sites a:hover { background: #F6F8F9; }
.sites .s-nom { font-weight: 600; font-size: 1.05rem; }
.sites .s-lieu { color: var(--encre-2); font-size: .9rem; grid-column: 1; }
.sites .s-etat { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; gap: .45rem; font-size: .92rem; }
.vide { padding: 2rem 1.25rem; color: var(--encre-2); }

/* ---------- Connexion / formulaires ---------- */
.page-connexion main { display: flex; align-items: center; justify-content: center; }
.carte-connexion { width: 100%; max-width: 420px; padding: 2rem 2rem 1.75rem; }
.carte-connexion .marque { margin-bottom: 1.5rem; }
.carte-connexion h1 { font-size: 2rem; font-weight: 600; margin-bottom: .35rem; }
.carte-connexion > p { margin: 0 0 1.4rem; color: var(--encre-2); }
.champ { margin-bottom: 1rem; }
.champ label { display: block; font-weight: 500; margin-bottom: .3rem; }
.champ input { width: 100%; font: inherit; padding: .7rem .8rem; border: 1px solid #BAC5CC; border-radius: 8px; background: #fff; color: var(--encre); }
.champ input:focus { border-color: var(--encre); }
.champ small { display: block; color: var(--encre-2); margin-top: .3rem; }
.bouton { width: 100%; font: 600 1.05rem var(--texte); color: #fff; background: var(--encre); border: 0; border-radius: 8px; padding: .8rem 1rem; cursor: pointer; min-height: 48px; }
.bouton:hover { background: #2E3F4B; }
.message { border-radius: 8px; padding: .7rem .9rem; margin-bottom: 1rem; font-size: .95rem; }
.message.erreur { background: #FBECE9; color: #7E2A1B; border: 1px solid #EDC2B9; }
.message.info { background: #EAF0F8; color: #233F70; border: 1px solid #C5D3EA; }
.message.succes { background: #EDF6F0; color: #1F5E3E; border: 1px solid #B9D9C6; }
.aide { font-size: .9rem; color: var(--encre-2); margin: 1.2rem 0 0; }

.chargement { color: var(--encre-2); padding: 1rem 0; }

/* ---------- Petits écrans ---------- */
@media (max-width: 760px) {
    main { padding: 1rem .85rem 2.5rem; }
    .verdict { padding: 1.25rem 1.1rem 1.1rem 1.6rem; }
    .circuit { grid-template-columns: minmax(0, 1fr) auto; padding: .9rem 1rem; }
    .c-nom { grid-column: 1 / -1; }
    .c-temp { grid-column: 1; }
    .c-etat { grid-column: 2; grid-row: 2; }
    .c-pompe { grid-column: 1 / -1; }
    .graphe .zone { height: 220px; }
    .tableau .col-option { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pompe.marche svg { animation: none; }
}
