/* deploy/statut/page.css -- la page publique et la page « Publier un message ».
 *
 * L'habillage est celui des pages publiques du logiciel (www/scan.html) : fond
 * blanc, police du systeme, pastille du cabinet a l'accent. Maquette validee par
 * Tom le 2026-10-02.
 *
 * ⚠ L'ACCENT VIENT DU SITE SURVEILLE (son theme, lu dans /etat/<site>.json) : page.js
 * le pose sur --accent. Sans lui, la page prend l'encre du texte -- aucune couleur
 * de theme n'est ecrite ici.
 *
 * ⚠⚠ LES QUATRE COULEURS D'ETAT sont celles de palette.svg (la reference des
 * couleurs du logiciel) : vert 4CAF50, orange FFA000, rouge F4511E, bleu 4FC3F7.
 * Elles ne disent jamais seules l'etat : un mot les accompagne toujours.
 */
:root {
	--texte: #1f272e;
	--gris: #7c7c7c;
	--filet: #e2e2e2;
	--fond: #f4f5f6;
	--blanc: #ffffff;
	--accent: var(--texte);
	--sur-accent: #ffffff;
	--ok: #4CAF50;
	--ralenti: #FFA000;
	--arret: #F4511E;
	--maintenance: #4FC3F7;
	--vide: #EEEEEE;
	color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--blanc); color: var(--texte); }
body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
	font-size: 14px;
	line-height: 1.45;
}

.sp { max-width: 760px; margin: 0 auto; padding: 32px 20px 48px; display: flex; flex-direction: column; gap: 28px; }
#contenu { display: flex; flex-direction: column; gap: 28px; }
.sp-entete { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pastille { display: block; width: 40px; height: 40px; margin-bottom: 6px; }
.pastille svg { display: block; width: 100%; height: 100%; }
.pastille svg * { fill: var(--accent); }
h1 { margin: 0; font-size: 20px; font-weight: 600; }
.sp-entete p { margin: 0; color: var(--gris); font-size: 13px; }

/* La phrase d'etat, et son signe */
.global { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px; font-weight: 600; text-align: center; }
.signe { display: flex; color: var(--ok); }
.signe svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-etat="1"] .signe { color: var(--ralenti); }
[data-etat="2"] .signe { color: var(--arret); }
[data-etat="3"] .signe { color: var(--maintenance); }

/* Le fil de l'incident en cours */
.fil { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--filet); border-radius: 8px; }
.fil-ligne { display: flex; gap: 12px; }
.fil-ligne time { flex: 0 0 44px; color: var(--gris); font-variant-numeric: tabular-nums; }
.fil-ligne p { margin: 0; min-width: 0; overflow-wrap: anywhere; }

h2 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--gris); }

/* Les services : nom, bande de 90 jours, etat */
.services { display: flex; flex-direction: column; }
.service { display: grid; grid-template-columns: 215px minmax(0, 1fr) 175px; align-items: center; gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--filet); }
.service:last-child { border-bottom: 1px solid var(--filet); }
.service-nom { font-weight: 600; }
.service-nom span { display: block; font-weight: 400; color: var(--gris); font-size: 12px; }
.bande { display: flex; gap: 1px; height: 26px; min-width: 0; }
.bande i { flex: 1 1 0; min-width: 0; border-radius: 2px; background: var(--ok); }
.bande i[data-c="1"] { background: var(--ralenti); }
.bande i[data-c="2"] { background: var(--arret); }
.bande i[data-c="3"] { background: var(--maintenance); }
.bande i[data-c="-1"] { background: var(--vide); }
.bande i:hover { outline: 2px solid var(--texte); outline-offset: 1px; }
.service-etat { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; font-variant-numeric: tabular-nums; }
.service-etat small { color: var(--gris); font-size: 12px; white-space: nowrap; }
.mot { display: inline-flex; align-items: center; gap: 6px; }
.mot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.mot[data-c="1"]::before { background: var(--ralenti); }
.mot[data-c="2"]::before { background: var(--arret); }
.mot[data-c="3"]::before { background: var(--maintenance); }
.legende { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 8px; color: var(--gris); font-size: 12px; }
.legende div { display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* Les deux courbes de 24 heures */
.courbes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.courbe { min-width: 0; }
.courbe-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.courbe-tete b { font-weight: 600; }
.courbe-tete span { color: var(--gris); font-size: 12px; font-variant-numeric: tabular-nums; }
.courbe svg { display: block; width: 100%; height: auto; overflow: visible; }
.courbe .grille { stroke: var(--filet); stroke-width: 1; }
.courbe .trait { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.courbe .aire { fill: var(--accent); fill-opacity: 0.1; stroke: none; }
.courbe .bout { fill: var(--accent); stroke: var(--blanc); stroke-width: 2; }
.courbe .zone { fill: transparent; }
.courbe text { fill: var(--gris); font-size: 11px; }
.courbe .repere { stroke: var(--gris); stroke-width: 1; stroke-dasharray: 3 3; }

/* Maintenance prevue, incidents passes : une date, puis ce qui s'est passe */
.bloc { display: flex; flex-direction: column; }
.ligne { display: grid; grid-template-columns: 185px minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-top: 1px solid var(--filet); }
.ligne:last-child { border-bottom: 1px solid var(--filet); }
.ligne time { color: var(--gris); }
.ligne b { font-weight: 600; }
.ligne p { margin: 2px 0 0; color: var(--gris); overflow-wrap: anywhere; }
.sp-pied { margin: 0; text-align: center; color: var(--gris); font-size: 12px; }

.bulle { position: fixed; z-index: 20; pointer-events: none; padding: 5px 9px; border-radius: 6px; background: var(--texte); color: var(--blanc); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── La page « Publier un message » (message.html) ───────────────────────── */
.msg { max-width: 480px; margin: 0 auto; padding: 32px 20px; display: flex; flex-direction: column; gap: 14px; min-height: 100vh; font-size: 16px; }
.msg h1 { text-align: center; }
.msg .pastille { align-self: center; }
.msg textarea { width: 100%; min-height: 110px; padding: 10px 12px; border: 1px solid var(--filet); border-radius: 8px; font: inherit; color: var(--texte); background: var(--blanc); resize: vertical; }
.msg textarea:focus-visible, .msg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.msg button { font: inherit; cursor: pointer; border-radius: 8px; width: 100%; -webkit-tap-highlight-color: transparent; }
.phrases { display: flex; flex-direction: column; gap: 6px; }
.phrases button { text-align: left; font-size: 14px; padding: 10px 12px; color: var(--texte); background: var(--fond); border: 0; }
.principal { padding: 16px; font-weight: 600; background: var(--accent); color: var(--sur-accent); border: 0; }
.principal:disabled { opacity: 0.4; cursor: default; }
.msg-resultat { margin: 0; text-align: center; color: var(--gris); font-size: 14px; min-height: 20px; }
.msg-resultat a { color: var(--accent); }

@media (max-width: 620px) {
	.service { grid-template-columns: minmax(0, 1fr) auto; }
	.service .bande { grid-column: 1 / -1; order: 3; }
	.ligne { grid-template-columns: minmax(0, 1fr); }
	.sp { padding-inline: 14px; }
}
