/* Page d'état de Mes Potos. Charte trois couleurs (jaune Poto, rose, noir) et neutres chauds du site
   (src/styles/charte.css de mespotos) ; polices du site embarquées (Bricolage Grotesque, Mulish : SIL OFL 1.1).
   L'état n'est jamais porté par la seule couleur : un mot et une icône l'accompagnent toujours. */

@font-face { font-family: "MP Bricolage"; src: url("/polices/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Mulish"; src: url("/polices/mulish.ttf") format("truetype"); font-weight: 200 1000; font-style: normal; font-display: swap; }

:root {
  --encre: #0D0D0D; --creme: #FAFAF0; --surface: #FFFFFF; --surface-2: #F4F3E6; --bordure: #ECE9D4; --bordure-forte: #C4C1AC;
  --discret: #706E60; --jaune: #FFEE68; --jaune-doux: #FFF8C2; --rose: #FF3B7F; --rose-texte: #B01049; --rose-doux: #FFE9F1;
  --vert: #12907A; --vert-texte: #0A5A4D; --vert-doux: #E7F4F1; --or: #8A7A00; --or-texte: #6B5D00; --gris-doux: #F1F0E6; --gris-texte: #5E5C50;
  --titre: "MP Bricolage", "Mulish", system-ui, sans-serif;
  --texte: "Mulish", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rayon: 16px; --rayon-petit: 10px;
  --ombre: 0 1px 2px rgba(13, 13, 13, .04), 0 8px 24px -12px rgba(13, 13, 13, .10);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--creme); color: var(--encre); font: 400 16px/1.55 var(--texte); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, p { margin: 0; }

.evitement { position: absolute; left: 16px; top: -60px; z-index: 10; padding: 10px 16px; background: var(--encre); color: #fff; border-radius: var(--rayon-petit); font-weight: 700; text-decoration: none; }
.evitement:focus { top: 12px; }

.etroit { display: none; }

/* En-tête */
.entete { background: var(--creme); border-bottom: 1px solid var(--bordure); }
.entete__interieur { max-width: 800px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.marque { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; min-height: 44px; }
.marque img { display: block; height: 32px; width: auto; }
.marque__titre { padding-left: 14px; border-left: 1px solid var(--bordure-forte); font: 600 15px/1.2 var(--texte); color: var(--discret); white-space: nowrap; }
.lien-site { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; font-size: 15px; text-decoration: none; }
.lien-site svg { width: 18px; height: 18px; }
.lien-site:hover { text-decoration: underline; }
.entete__qui { font-size: 14px; color: var(--discret); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.contenu { max-width: 800px; margin: 0 auto; padding: 40px 24px 64px; }

/* Bandeau général */
.general { display: flex; align-items: center; gap: 20px; padding: 28px 32px; border-radius: 20px; background: var(--surface); border: 1px solid var(--bordure); box-shadow: var(--ombre); }
.general__icone { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; }
.general__icone svg { width: 28px; height: 28px; }
.general__titre { font: 700 clamp(24px, 3.2vw, 32px)/1.12 var(--titre); letter-spacing: -.02em; }
.general__complement { margin-top: 8px; font-weight: 700; font-size: 16px; }
.general__detail { margin-top: 6px; color: var(--discret); font-size: 15px; }
.general--operationnel .general__icone { background: var(--vert-doux); color: var(--vert-texte); }
.general--lent .general__icone { background: var(--jaune-doux); color: var(--or-texte); }
.general--perturbe .general__icone { background: var(--rose-doux); color: var(--rose-texte); }
.general--panne { background: var(--rose-texte); border-color: var(--rose-texte); color: #fff; }
.general--panne .general__icone { background: rgba(255, 255, 255, .16); color: #fff; }
.general--panne .general__detail { color: rgba(255, 255, 255, .86); }
.general--inconnu .general__icone { background: var(--gris-doux); color: var(--gris-texte); }

/* Blocs */
.bloc { margin-top: 48px; }
.bloc__entete { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.bloc__titre { font: 700 20px/1.2 var(--titre); letter-spacing: -.01em; margin-bottom: 16px; }
.bloc__entete .bloc__titre { margin-bottom: 0; }
.bloc__aide { color: var(--discret); font-size: 14px; }
.vide { padding: 20px 24px; border: 1px dashed var(--bordure-forte); border-radius: var(--rayon); color: var(--discret); }

/* Services */
.services { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre); }
.service { padding: 24px 28px; }
.service + .service { border-top: 1px solid var(--bordure); }
.service__tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.service__nom { font: 700 17px/1.3 var(--texte); }
.service__description { margin-top: 2px; color: var(--discret); font-size: 14px; }

.pastille { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 9px; border-radius: 999px; font: 700 14px/1.2 var(--texte); white-space: nowrap; }
.pastille svg { width: 18px; height: 18px; }
.pastille--operationnel { background: var(--vert-doux); color: var(--vert-texte); }
.pastille--lent { background: var(--jaune-doux); color: var(--or-texte); }
.pastille--perturbe { background: var(--rose-doux); color: var(--rose-texte); }
.pastille--panne { background: var(--rose-texte); color: #fff; }
.pastille--inconnu { background: var(--gris-doux); color: var(--gris-texte); }

/* Barre des 90 jours */
.historique { margin-top: 18px; }
.barre { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; height: 36px; }
.jour { position: relative; flex: 1 1 0; min-width: 0; border-radius: 2px; background: var(--bordure-forte); outline-offset: 2px; cursor: default; }
/* Assombrir sans `filter`, qui ferait du jour le cadre de l'info-bulle (largeur d'un jour sur téléphone). */
.jour:hover, .jour:focus-visible { box-shadow: inset 0 0 0 40px rgba(13, 13, 13, .22); }
.jour--operationnel { background: var(--vert); }
.jour--lent { background: var(--or); }
.jour--perturbe { background: var(--rose); }
.jour--panne { background: var(--rose-texte); }
.jour--aucune { background: #DAD7C4; }
/* Info-bulle d'un jour : au survol et au focus (clavier ou toucher), sans script. */
.jour::after {
  content: attr(aria-label); position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 260px; padding: 8px 12px; border-radius: var(--rayon-petit); background: var(--encre); color: #fff;
  font: 600 13px/1.45 var(--texte); text-align: left; white-space: normal; pointer-events: none; z-index: 5; display: none;
}
.jour--debut::after { left: 0; transform: none; }
.jour--fin::after { left: auto; right: 0; transform: none; }
.jour:hover::after, .jour:focus::after { display: block; }
.barre__legende { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: var(--discret); font-size: 13px; }
.barre__dispo { font-weight: 700; color: var(--encre); font-variant-numeric: tabular-nums; }

.legende { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--discret); font-size: 13px; }
.legende li { display: inline-flex; align-items: center; gap: 8px; }
.legende__case { width: 12px; height: 12px; border-radius: 3px; }

/* Incidents */
.incident { padding: 24px 28px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre); }
.incident + .incident { margin-top: 12px; }
.incident--ouvert { border-left: 4px solid var(--rose); }
.incident--ouvert.incident--maintenance { border-left-color: var(--encre); }
.incident__gravite { display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; background: var(--rose-doux); color: var(--rose-texte); font: 700 12px/1.4 var(--texte); letter-spacing: .02em; text-transform: uppercase; }
.incident--maintenance .incident__gravite { background: var(--gris-doux); color: var(--gris-texte); }
.incident--majeure .incident__gravite { background: var(--rose-texte); color: #fff; }
.incident__titre { font: 700 18px/1.3 var(--texte); }
.incident__meta { margin-top: 4px; color: var(--discret); font-size: 14px; }
.suivis { list-style: none; margin: 18px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--bordure); }
.suivi { position: relative; }
.suivi + .suivi { margin-top: 16px; }
.suivi::before { content: ""; position: absolute; left: -24px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--bordure-forte); }
.suivi:first-child::before { border-color: var(--encre); background: var(--encre); }
.suivi__tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 15px; }
.suivi__tete time { color: var(--discret); font-size: 13px; }
.suivi__message { margin-top: 4px; white-space: pre-line; }

/* Pied de page */
.pied { border-top: 1px solid var(--bordure); }
.pied__interieur { max-width: 800px; margin: 0 auto; padding: 28px 24px 40px; color: var(--discret); font-size: 14px; display: grid; gap: 6px; }
.pied a { color: var(--encre); font-weight: 600; }

/* Administration */
.carte { padding: 24px 28px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre); }
.formulaire { display: grid; gap: 16px; }
.formulaire--suivi { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--bordure); }
.champ { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.champ > label, .champ > legend { font-weight: 700; font-size: 14px; padding: 0; }
.champ input:not([type="checkbox"]), .champ select, .champ textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--bordure-forte); border-radius: var(--rayon-petit); background: #fff; color: var(--encre); font: 400 16px/1.4 var(--texte); }
.champ textarea { resize: vertical; }
.case { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.case input { width: 20px; height: 20px; accent-color: var(--encre); }
.aide { color: var(--discret); font-size: 13px; }
.bouton { justify-self: start; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--jaune); color: var(--encre); font: 800 15px/1 var(--texte); cursor: pointer; }
.bouton:hover { background: #F7E24A; }
.annonce { margin-bottom: 24px; padding: 14px 18px; border-radius: var(--rayon-petit); background: var(--vert-doux); color: var(--vert-texte); font-weight: 600; }
.annonce--erreur { background: var(--rose-doux); color: var(--rose-texte); }
.annonce ul { margin: 6px 0 0; padding-left: 20px; font-weight: 500; }

@media (max-width: 640px) {
  .large { display: none; }
  .etroit { display: inline; }
  .entete__interieur { padding: 12px 16px; min-height: 64px; }
  .marque { gap: 10px; }
  .marque img { height: 28px; }
  .marque__titre { padding-left: 10px; font-size: 14px; }
  .contenu { padding: 24px 16px 48px; }
  .general { padding: 20px; gap: 14px; align-items: flex-start; border-radius: var(--rayon); }
  .general__icone { width: 44px; height: 44px; }
  .general__icone svg { width: 24px; height: 24px; }
  .bloc { margin-top: 36px; }
  .bloc__entete { flex-direction: column; gap: 4px; }
  .service, .incident, .carte { padding: 20px; }
  .service__tete { flex-direction: column; gap: 10px; }
  /* 30 derniers jours seulement : 90 barres ne tiennent pas lisiblement dans 358 px. */
  .jour:nth-child(-n+60) { display: none; }
  .barre { gap: 3px; height: 32px; }
  /* Sur téléphone, l'info-bulle prend la largeur de la barre (jamais hors de l'écran, quel que soit le jour). */
  .barre { position: relative; }
  .jour { position: static; }
  .jour::after, .jour--debut::after, .jour--fin::after { left: 0; right: 0; width: auto; max-width: none; transform: none; }
  .pied__interieur { padding: 24px 16px 32px; }
  .lien-site { font-size: 14px; }
}


/* Page de refus de /admin : une carte sobre, une phrase, et toujours le retour à l'état des services. */
.refus { display: grid; gap: 16px; margin-top: 8px; }
.refus__titre { margin: 0; font-family: var(--titre, inherit); font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; }
.refus p { margin: 0; line-height: 1.6; color: var(--encre); }
.refus__ids { display: grid; gap: 8px; margin: 0; padding: 16px 20px; border: 1px solid var(--bordure); border-radius: 12px; background: var(--creme); }
.refus__ids div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: baseline; }
.refus__ids dt { color: var(--discret); font-size: 14px; }
.refus__ids dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; overflow-wrap: anywhere; }
.refus .bouton { display: inline-flex; align-items: center; justify-content: center; width: fit-content; color: var(--encre); font-weight: 700; text-decoration: none; }
.refus .bouton:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; }
