/* Feuille de style du portail client.
 *
 * Refonte graphique v0.1 (Cedric GIBERT, 10 septembre 2026), reprise telle
 * quelle a quatre exceptions pres : les quatre styles que la maquette portait
 * en attribut `style=` sont ici, parce que la CSP du service declare
 * `style-src 'self'` et bloque donc tout style en ligne. La maquette embarquait
 * aussi la feuille dans un <style> de la page, ce que la meme directive
 * interdit : elle est servie comme fichier, et le cache du navigateur rend le
 * gain d'une requete negligeable.
 */

@font-face {
  font-family: "Jost";
  src: url("/static/Jost-Variable.woff2") format("woff2-variations"),
       url("/static/Jost-Variable.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Chemin de la banniere. Dans la maquette il etait pose en attribut
     style= sur <html> ; il n'a rien de dynamique. */
  --hero-banner: url("/static/img/hero-banner.jpg");

  --paper:      #ffffff;
  --surface:    #fdf9f5;
  --panel:      #fff6ee;
  --line:       #ecdfd2;
  --line-soft:  #f4e9de;
  --ink:        #17130e;
  --muted:      #6d635a;

  --brand:      #e95d0f;
  --brand-ink:  #b8460a;
  --brand-soft: #fdece0;

  --night:      #100d0a;
  --night-2:    #1b1611;

  --ok:         #157f47;
  --ok-soft:    #e7f4ec;
  --down:       #cf1124;
  --down-soft:  #fdeaec;
  --idk:        #6b625a;
  --idk-soft:   #f0edea;
  --on-state:   #ffffff;

  --r-lg: 18px;
  --r-md: 14px;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #100d0a; --surface: #1a1511; --panel: #221a13;
    --line: #352a20; --line-soft: #2a2118;
    --ink: #f6f1eb; --muted: #a89c90;
    --brand: #f4771f; --brand-ink: #f89b4f; --brand-soft: #2c1a0e;
    --ok: #3fbf7c; --ok-soft: #16281e; --down: #f5555f; --down-soft: #2b1518;
    --idk: #978d83; --idk-soft: #221e1a; --on-state: #100d0a;
  }
}
:root[data-theme="dark"] {
  --paper: #100d0a; --surface: #1a1511; --panel: #221a13;
  --line: #352a20; --line-soft: #2a2118;
  --ink: #f6f1eb; --muted: #a89c90;
  --brand: #f4771f; --brand-ink: #f89b4f; --brand-soft: #2c1a0e;
  --ok: #3fbf7c; --ok-soft: #16281e; --down: #f5555f; --down-soft: #2b1518;
  --idk: #978d83; --idk-soft: #221e1a; --on-state: #100d0a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- Bandeau -- */
.hero {
  position: relative;
  overflow: hidden;
  color: #f6f1eb;
  border-bottom: 3px solid var(--brand);
  background-color: var(--night);
  background-image: var(--hero-banner);
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  min-height: 204px;
  display: flex;
}
/* Voile degrade a gauche : garantit la lisibilite du texte quelle que soit la
   largeur de la fenetre, sans recadrer la banniere. */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg,
    rgba(16,13,10,.96) 0%,
    rgba(16,13,10,.88) 34%,
    rgba(16,13,10,.60) 56%,
    rgba(16,13,10,.28) 100%);
}
.hero-inner {
  position: relative;
  max-width: 1020px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 24px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}
.hero-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}
.logo { width: 138px; height: auto; display: block; color: var(--brand); }
.hero-scope {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 11px;
  border: 1px solid rgba(246,241,235,.22);
  border-radius: 999px;
  font-size: 13px;
  color: #e6ddd4;
  background: rgba(246,241,235,.05);
}
.hero-scope .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand);
}

.hero-state { margin: 0; display: flex; align-items: flex-start; gap: 18px; }
.hero-emblem {
  flex: none;
  width: 58px; height: 58px;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 27px; line-height: 1;
  background: var(--ok); color: #ffffff;
  box-shadow: 0 0 0 6px rgba(21,127,71,.16);
}
.summary.state-outage  .hero-emblem { background: var(--down); box-shadow: 0 0 0 6px rgba(207,17,36,.18); }
.summary.state-unknown .hero-emblem { background: #7d746a; box-shadow: 0 0 0 6px rgba(125,116,106,.18); }

.summary { margin: 0; }
.summary-text {
  display: block;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -.01em;
  margin: 0;
}
.hero-meta {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: #b4a99e;
  font-family: var(--mono);
}

/* ------------------------------------------------------------------ Corps -- */
/* Le sprite des symboles SVG : present dans le document, hors du flux. */
.sprite { position: absolute; }

.page { max-width: 1020px; margin: 0 auto; padding: 34px 24px 60px; }

.section-head {
  display: flex; align-items: baseline; gap: 12px;
  margin: 0 0 14px;
}
.section-head h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin: 0;
}
.section-head .rule { flex: 1; height: 1px; background: var(--line); }

.banner {
  margin: 0 0 26px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--r-md);
  background: var(--surface);
}
.banner-warning { border-left-color: var(--down); background: var(--down-soft); }

/* ------------------------------------------------------------- Coeur -------- */
.core {
  display: flex; align-items: center; gap: 22px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 180% at 0% 0%, var(--brand-soft) 0%, rgba(0,0,0,0) 58%),
    var(--surface);
  position: relative;
}
.core::before {
  content: "";
  position: absolute; left: 0; top: 18px; bottom: 18px;
  width: 4px; border-radius: 0 4px 4px 0;
  background: var(--brand);
}
.core-picto { flex: none; width: 78px; height: 78px; color: var(--brand); }
.state-outage  .core-picto { color: var(--down); }
.state-unknown .core-picto { color: var(--idk); }
.core .item-label { font-size: 23px; font-weight: 600; }
.core .item-kind  { font-size: 14.5px; max-width: 60ch; }
.core-body { flex: 1; min-width: 0; }
.core-name { font-size: 23px; font-weight: 600; margin: 0; line-height: 1.25; }
.core-kind { color: var(--muted); font-size: 14.5px; margin: 2px 0 0; }

/* --------------------------------------------------------------- Grille ----- */
.grid {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.grid.single { grid-template-columns: 1fr; }
/* Colle la grille a son titre de section : utilise par le coeur d'analyse,
   dont le titre suffit a espacer. */
.grid.flush { margin-top: 0; }

.item {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  overflow: hidden;
}
.item::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--idk);
}
.item.state-operational::after { background: var(--ok); }
.item.state-outage::after      { background: var(--down); }
.item.state-unknown::after     { background: var(--idk); }

.item-icon {
  flex: none;
  width: 72px; height: 72px;
  display: block;
}
.item-icon img { width: 100%; height: 100%; display: block; }
/* Les pictogrammes ne portent pas l'etat : ils gardent leur rendu de marque en
   toutes circonstances. L'etat est porte par le liseré haut et la pastille. */
.state-outage  .item-icon,
.state-unknown .item-icon { opacity: .55; filter: saturate(.35); }

.item-text { flex: 1; min-width: 0; }
.item-label { display: block; font-size: 16.5px; font-weight: 500; line-height: 1.3; }
.item-kind { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.item-grow { display: none; }

/* -------------------------------------------------------------- Pastilles --- */
.pill {
  flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--idk-soft);
  color: var(--idk);
  border: 1px solid transparent;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .07em;
  white-space: nowrap;
  font-weight: 600;
}
.state-operational .pill { background: var(--ok-soft);   color: var(--ok);   border-color: rgba(21,127,71,.22); }
.state-outage      .pill { background: var(--down-soft); color: var(--down); border-color: rgba(207,17,36,.22); }
.state-unknown     .pill { background: var(--idk-soft);  color: var(--idk);  border-color: rgba(107,98,90,.2); }
.pill-glyph { font-size: 13px; line-height: 1; font-family: var(--sans); }

/* ----------------------------------------------------------------- Amont ---- */
.page > section + section { margin-top: 30px; }
.upstream-link {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 12px; padding-left: 6px;
  color: var(--brand-ink);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.upstream-link .dash {
  flex: 1; height: 0;
  border-top: 2px dashed var(--brand);
  opacity: .55;
}

/* ------------------------------------------------------------------ Pied ---- */
.foot {
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
}
.foot p { margin: 5px 0; }
.foot a { color: var(--brand-ink); }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .summary-text { font-size: 27px; }
  .core { flex-wrap: wrap; gap: 16px; }
  .core-picto { width: 56px; height: 56px; }
}
@media (max-width: 520px) {
  .item { flex-wrap: wrap; }
  .pill { margin-left: 62px; }
  .hero-state { gap: 14px; }
  .hero-emblem { width: 46px; height: 46px; font-size: 22px; border-radius: 13px; }
  .summary-text { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}