/* Page de statut OKWIND, à la charte de l'Espace partenaire (Montserrat, palette MUI).
   Une colonne de 960 px : état général, incidents en cours, maintenances, services avec leurs
   barres de disponibilité, historique. Thème clair et sombre selon le navigateur. */

@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/montserrat/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/montserrat/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/montserrat/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/montserrat/montserrat-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #f3f1f1;
  --surface: #ffffff;
  --ink: #121926;
  --muted: #5d6573;
  --line: #e4e1e1;
  --soft: #f1efef;
  --link: #044589;
  --primary: #044589;
  --primary-ink: #ffffff;
  /* Niveaux : remplissage (barres, points), texte et fond des pastilles */
  --ok: #35ba07;        --ok-ink: #23780a;        --ok-bg: #eaf6e4;
  --deg: #f7b32b;       --deg-ink: #7a5200;       --deg-bg: #fdf3dc;
  --part: #e8742a;      --part-ink: #a14a0e;      --part-bg: #fcebdd;
  --maj: #d72638;       --maj-ink: #a51b2a;       --maj-bg: #fbe7e9;
  --maint: #044589;     --maint-ink: #044589;     --maint-bg: #e5eef7;
  --nodata: #dcd8d8;
  --radius: 10px;
  --font: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1e1e1e;
    --ink: #eceef1;
    --muted: #a3a9b3;
    --line: #2e2e2e;
    --soft: #262626;
    --link: #8fb7e6;
    --primary: #5b8fd1;
    --primary-ink: #0b1220;
    --ok-ink: #6fd24a;   --ok-bg: #1c2b16;
    --deg-ink: #f7c55c;  --deg-bg: #2f2612;
    --part-ink: #f39a5f; --part-bg: #33200f;
    --maj-ink: #f07783;  --maj-bg: #33191c;
    --maint: #5b8fd1;    --maint-ink: #8fb7e6;  --maint-bg: #17222f;
    --nodata: #3a3a3a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--link); outline-offset: 2px; border-radius: 6px;
}
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* Barre supérieure */
.bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar__inner, .page, .foot__inner {
  max-width: 960px;
  margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.bar__inner { padding-block: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: 112px; height: auto; }
.brand__label { font-size: 13px; font-weight: 500; color: var(--muted); padding-left: 14px; border-left: 1px solid var(--line); line-height: 20px; }
.bar__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent;
  font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Mise en page */
.page { padding-block: 28px 56px; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.card.list { padding: 0; }
.card__title { font-size: 18px; margin-bottom: 14px; }
.section { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.section__head h2 { font-size: 18px; font-weight: 700; }
.section__month { font-size: 16px; font-weight: 600; }
.page__title { font-size: 26px; font-weight: 700; line-height: 1.25; }
.back { font-size: 14px; font-weight: 600; }
.more { align-self: flex-start; font-size: 14px; font-weight: 600; }
.narrow { max-width: 640px; display: flex; flex-direction: column; gap: 18px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* Pastilles, badges, points */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill .icon { flex: none; }
.pill--ok { color: var(--ok-ink); background: var(--ok-bg); }
.pill--degradee { color: var(--deg-ink); background: var(--deg-bg); }
.pill--partielle { color: var(--part-ink); background: var(--part-bg); }
.pill--majeure { color: var(--maj-ink); background: var(--maj-bg); }
.pill--maintenance { color: var(--maint-ink); background: var(--maint-bg); }
.pill--step { color: var(--ink); background: var(--soft); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot--degradee { background: var(--deg); } .dot--partielle { background: var(--part); }
.dot--majeure { background: var(--maj); } .dot--maintenance { background: var(--maint); } .dot--ok { background: var(--ok); }

/* Bandeau d'état général */
.banner { display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-radius: var(--radius); color: #fff; }
.banner .icon { width: 28px; height: 28px; flex: none; }
.banner__title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.banner__sub { font-size: 13px; font-weight: 500; opacity: .92; }
.banner--ok { background: #2f9e0a; }
.banner--maintenance { background: #044589; }
.banner--degradee { background: #f7b32b; color: #2b2100; }
.banner--partielle { background: #c2570f; }
.banner--majeure { background: #c21f30; }

/* Incident en cours et maintenance à venir */
.incident { display: flex; flex-direction: column; gap: 12px; }
.incident__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.incident__tags .muted { font-size: 13px; }
.incident__title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.incident__title a { color: var(--ink); }
.incident__text { max-width: 72ch; }
.incident__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.incident__meta strong { color: var(--ink); }
.incident__meta a { font-weight: 600; font-size: 14px; }
.upcoming { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.upcoming > div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.upcoming__title { font-size: 16px; font-weight: 600; }
.upcoming__title a { color: var(--ink); }
.upcoming__when { font-size: 13px; font-weight: 600; color: var(--maint-ink); }

/* Services et barres de disponibilité */
.service { padding: 18px 24px; display: flex; flex-direction: column; gap: 10px; }
.service + .service { border-top: 1px solid var(--line); }
.service__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.service__head > :first-child { min-width: 0; flex: 1 1 320px; }
.service__name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; line-height: 32px; }
.service__desc { display: block; }
.service__status { display: flex; align-items: center; gap: 14px; min-height: 32px; }
.service__more summary { list-style: none; cursor: pointer; }
.service__more summary::-webkit-details-marker { display: none; }
.chev { transition: transform .15s; }
.service__more[open] .chev { transform: rotate(90deg); }
.components { list-style: none; margin: 12px 0 2px 6px; padding: 0 0 0 16px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.components li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 500; }
.bars { display: flex; gap: 2px; height: 30px; }
.bar { flex: 1 1 0; min-width: 2px; border-radius: 2px; }
.bar:hover { opacity: .7; }
.bar--ok { background: var(--ok); } .bar--degradee { background: var(--deg); }
.bar--partielle { background: var(--part); } .bar--majeure { background: var(--maj); }
.bar--maintenance { background: var(--maint); } .bar--nodata { background: var(--nodata); }
.bars__axis { display: flex; justify-content: space-between; gap: 12px; }
.bars__detail { color: var(--ink); font-weight: 500; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.sq { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Historique */
.filter { display: inline-flex; align-items: center; gap: 8px; }
.filter select { font: 500 14px var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-height: 40px; padding: 0 10px; }
.day { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr); gap: 4px 20px; padding: 14px 24px; }
.day + .day { border-top: 1px solid var(--line); }
.day__label { font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.day__items { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.day__item a { font-weight: 600; color: var(--ink); }
.day__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 4px; }
.day__meta .pill { font-size: 12px; padding: 2px 9px; }

/* Page d'un incident */
.detail { display: flex; flex-direction: column; gap: 16px; }
.detail__title { font-size: 26px; font-weight: 700; line-height: 1.25; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; margin: 0; }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-size: 14px; }
.detail__services { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.prose h2 { font-size: 18px; margin-bottom: 10px; }
.prose p + p { margin-top: 10px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { position: relative; padding: 0 0 22px 32px; }
.timeline__item::before { content: ""; position: absolute; left: 5px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--nodata); }
.timeline__item::after { content: ""; position: absolute; left: 10px; top: 25px; bottom: 2px; width: 2px; background: var(--line); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item:last-child::after { display: none; }
.timeline__item--current::before { box-shadow: 0 0 0 4px var(--soft); }
.timeline__item--partielle::before { background: var(--part); }
.timeline__item--degradee::before { background: var(--deg); }
.timeline__item--majeure::before { background: var(--maj); }
.timeline__item--maintenance::before { background: var(--maint); }
.timeline__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 4px; }
.timeline p { max-width: 72ch; }

/* Abonnement */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .checks legend { font-size: 14px; font-weight: 600; }
.field input { font: 500 15px var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-height: 44px; padding: 0 12px; }
.checks { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checks legend { margin-bottom: 8px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.check > span { display: flex; flex-direction: column; }
.form__foot { display: flex; justify-content: flex-end; }
.notice { color: var(--maint-ink); background: var(--maint-bg); padding: 10px 14px; border-radius: 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.done { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.done[hidden] { display: none; }
.done p { margin: 0; }
.done__title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--ok-ink); }

/* Pied de page */
.foot { border-top: 1px solid var(--line); }
.foot__inner { padding-block: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: 13px; color: var(--muted); }
.foot__inner strong { color: var(--ink); }
.foot__links { display: inline-flex; flex-wrap: wrap; gap: 16px; }

@media (max-width: 560px) {
  .brand__label { display: none; }
  .bar__actions .btn--ghost { display: none; }
  .page { padding-block: 20px 40px; }
  .card, .service, .day { padding-left: 16px; padding-right: 16px; }
  .day { grid-template-columns: 1fr; }
  .bars { gap: 1px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
.done__title--neutral { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
