/*
 * Umbrella Technologies — page de statut
 * Identité visuelle reprise de https://www.umbt.ca (thème « umbrella ») :
 *   rouge #d80017, anthracite #2f2f2f, gris clair #f9f9fa, polices Archivo / Archivo Black,
 *   boutons rectangulaires rouges (texte blanc gras), survol inversé.
 * Toutes les couleurs sont regroupées ci-dessous pour être facilement remplacées.
 */
:root {
  --brand: #d80017;
  --brand-dark: #a80012;
  --ink: #000000;
  --text: #1f1f1f;
  --muted: #5b5b5b;
  --bg: #ffffff;
  --bg-soft: #f9f9fa;
  --bg-dark: #2f2f2f;
  --line: #dedede;
  --focus: #1d4ed8;

  --st-operational: #1e7b34;
  --st-maintenance: #1d4ed8;
  --st-degraded: #8a6100;
  --st-partial: #c2410c;
  --st-major: #b00014;
  --st-nodata: #c9c9c9;

  --sev-low: #1d4ed8;
  --sev-medium: #8a6100;
  --sev-high: #c2410c;
  --sev-critical: #b00014;

  --font: 'Archivo', 'Segoe UI', Arial, Helvetica, sans-serif;
  --font-display: 'Archivo Black', 'Archivo', 'Segoe UI', Arial, sans-serif;
  --radius: 0;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ffffff; --text: #ececec; --muted: #b5b5b5; --bg: #161616; --bg-soft: #1f1f1f; --bg-dark: #0d0d0d;
    --line: #3a3a3a; --brand: #ff3346; --brand-dark: #ff6675; --focus: #8ab4ff;
    --st-operational: #3fa95b; --st-maintenance: #5b8def; --st-degraded: #d6a31d; --st-partial: #f07a3a; --st-major: #ff4d5e; --st-nodata: #4a4a4a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #ffffff; --text: #ececec; --muted: #b5b5b5; --bg: #161616; --bg-soft: #1f1f1f; --bg-dark: #0d0d0d;
  --line: #3a3a3a; --brand: #ff3346; --brand-dark: #ff6675; --focus: #8ab4ff;
  --st-operational: #3fa95b; --st-maintenance: #5b8def; --st-degraded: #d6a31d; --st-partial: #f07a3a; --st-major: #ff4d5e; --st-nodata: #4a4a4a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--bg); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; color: var(--ink); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { font-family: Consolas, 'Courier New', monospace; background: var(--bg-soft); padding: .1em .35em; border: 1px solid var(--line); font-size: .92em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--brand); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hr-rouge { height: 2px; width: 95px; background: var(--brand); border: 0; margin: 1.2rem 0 1.6rem; }

/* En-tête — fond blanc, logo, accent rouge (comme umbt.ca) */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--ink); }
.brand img { height: 35px; width: auto; display: block; }
.brand-title { font-family: var(--font-display); font-size: 1.05rem; padding-left: .9rem; border-left: 2px solid var(--brand); line-height: 1.1; }
.header-nav { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.header-nav a, .header-nav button { font: inherit; font-size: .9rem; color: var(--ink); text-decoration: none; padding: 0 .9rem; border-right: 2px solid var(--brand); line-height: 1; background: none; border-top: 0; border-bottom: 0; border-left: 0; cursor: pointer; }
.header-nav > :last-child { border-right: 0; padding-right: 0; }
.header-nav a:hover, .header-nav a[aria-current="page"], .header-nav button:hover { color: var(--brand); }

/* Boutons — rectangulaires, rouge plein, survol inversé */
.button, button.button, input[type=submit].button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; cursor: pointer;
  font: 700 1rem/1.1 var(--font); color: #fff; background: var(--brand); border: 1px solid var(--brand);
  padding: 12px 32px; text-decoration: none; border-radius: var(--radius); transition: background .2s, color .2s;
}
.button:hover { background: transparent; color: var(--brand); }
.button.secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.button.secondary:hover { background: var(--ink); color: var(--bg); }
.button.small { padding: 7px 16px; font-size: .9rem; }
.button.danger { background: var(--st-major); border-color: var(--st-major); }
.button.danger:hover { background: transparent; color: var(--st-major); }
.button.link { background: none; border: 0; color: var(--brand); padding: 0; font-weight: 400; text-decoration: underline; }

/* Bannière globale */
.hero { background: var(--bg-dark); color: #fff; padding: 2.2rem 0 2.6rem; }
.hero h1 { color: #fff; margin-bottom: .2rem; }
.hero .updated { color: #cfcfcf; font-size: .9rem; margin: 0; }
.banner { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; margin-top: 1.4rem; color: #fff; font-weight: 700; font-size: 1.15rem; border-left: 8px solid rgba(255,255,255,.55); }
.banner .icon { flex: 0 0 auto; display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; background: rgba(255,255,255,.2); font-size: 1.15rem; }
.st-bg-operational { background: var(--st-operational); }
.st-bg-maintenance { background: var(--st-maintenance); }
.st-bg-degraded { background: var(--st-degraded); }
.st-bg-partial { background: var(--st-partial); }
.st-bg-major { background: var(--st-major); }

/* Onglets (amélioration progressive : sans JS, les deux sections s'affichent) */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--line); margin: 2rem 0 1.5rem; flex-wrap: wrap; }
.tabs a { font-family: var(--font-display); font-size: 1rem; color: var(--ink); text-decoration: none; padding: .8rem 1.2rem; border-bottom: 4px solid transparent; margin-bottom: -2px; }
.tabs a[aria-selected="true"], .tabs a:hover { border-bottom-color: var(--brand); color: var(--brand); }
.js .tabpanel[hidden] { display: none; }

/* Sections et cartes */
.section { margin: 0 0 2.4rem; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card { background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--bg-soft); flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.card-body { padding: 1rem 1.1rem; }

/* Pastille d'état : icône + texte (jamais la couleur seule) */
.status { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .92rem; white-space: nowrap; }
.status .dot { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; color: #fff; font-size: .8rem; line-height: 1; }
.status-operational { color: var(--st-operational); } .status-operational .dot { background: var(--st-operational); }
.status-maintenance { color: var(--st-maintenance); } .status-maintenance .dot { background: var(--st-maintenance); }
.status-degraded { color: var(--st-degraded); } .status-degraded .dot { background: var(--st-degraded); }
.status-partial { color: var(--st-partial); } .status-partial .dot { background: var(--st-partial); }
.status-major { color: var(--st-major); } .status-major .dot { background: var(--st-major); }

/* Composants + barres de disponibilité (90 jours) */
.component { padding: .9rem 1.1rem; border-top: 1px solid var(--line); }
.component:first-child { border-top: 0; }
.component-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.component-name { font-weight: 700; color: var(--ink); }
.component-desc { color: var(--muted); font-size: .88rem; margin: .1rem 0 0; }
.uptime { margin-top: .6rem; }
.bars { display: grid; grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 2px; height: 34px; }
.bars span { display: block; height: 100%; background: var(--st-operational); }
.bars .d-maintenance { background: var(--st-maintenance); }
.bars .d-degraded { background: var(--st-degraded); }
.bars .d-partial { background: var(--st-partial); }
.bars .d-major { background: var(--st-major); }
.bars .d-nodata { background: var(--st-nodata); }
.bars span:hover, .bars span:focus { opacity: .7; outline: none; }
.uptime-legend { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: .3rem; gap: .5rem; }
@media (max-width: 640px) {
  .bars { grid-template-columns: repeat(30, minmax(0, 1fr)); }
  .bars span:nth-child(-n+60) { display: none; }
  .uptime-legend .full { display: none; }
  .uptime-legend .short { display: inline; }
}
.uptime-legend .short { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; color: var(--muted); margin: .4rem 0 1.4rem; }
.legend i { display: inline-block; width: .9rem; height: .9rem; vertical-align: -2px; margin-right: .3rem; }

/* Événements */
.event { border-left: 6px solid var(--line); padding: 1rem 1.1rem; background: var(--bg); border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.event.impact-major { border-left-color: var(--st-major); }
.event.impact-partial { border-left-color: var(--st-partial); }
.event.impact-degraded { border-left-color: var(--st-degraded); }
.event.impact-maintenance, .event.type-maintenance { border-left-color: var(--st-maintenance); }
.event.sev-critical { border-left-color: var(--sev-critical); }
.event.sev-high { border-left-color: var(--sev-high); }
.event.sev-medium { border-left-color: var(--sev-medium); }
.event.sev-low { border-left-color: var(--sev-low); }
.event h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.event h3 a { color: var(--ink); text-decoration: none; }
.event h3 a:hover { color: var(--brand); text-decoration: underline; }
.event-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .88rem; color: var(--muted); margin-bottom: .5rem; }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .15rem .5rem; border: 1px solid currentColor; }
.tag.sev-critical { color: var(--sev-critical); } .tag.sev-high { color: var(--sev-high); } .tag.sev-medium { color: var(--sev-medium); } .tag.sev-low { color: var(--sev-low); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.2rem 1.4rem; border-left: 2px solid var(--line); margin-left: .4rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .35rem; width: 12px; height: 12px; background: var(--brand); }
.timeline .when { font-size: .85rem; color: var(--muted); }
.timeline .what { font-weight: 700; color: var(--ink); }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0 0 1em; padding-left: 1.3rem; }

/* Cybersécurité — niveau de menace (couleurs : /theme.css) */
.threat { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; padding: 1.2rem; border: 1px solid var(--line); background: var(--bg-soft); }
.threat-badge { background: var(--threat-bg, var(--bg-dark)); color: var(--threat-fg, #fff); padding: 1rem 1.4rem; min-width: 10rem; text-align: center; }
.threat-badge .lvl { display: block; font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; }
.threat-badge .of { font-size: .82rem; opacity: .9; }
.threat-scale { display: flex; gap: 4px; margin-top: .6rem; }
.threat-scale span { flex: 1; height: 8px; background: var(--line); }
.threat-scale span.on { background: var(--threat-bg, var(--brand)); }
@media (max-width: 600px) { .threat { grid-template-columns: 1fr; } }

/* Formulaires */
.form { max-width: 640px; }
.field { margin-bottom: 1.1rem; }
.field label, .field .label { display: block; font-weight: 700; margin-bottom: .35rem; color: var(--ink); }
.field .hint { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid #8a8a8a; padding: .6rem .7rem; border-radius: 0;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
.check { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .6rem; }
.check input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
fieldset { border: 1px solid var(--line); padding: 1rem 1.1rem; margin: 0 0 1.2rem; }
legend { font-weight: 700; padding: 0 .4rem; color: var(--ink); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.otp-input { font-family: Consolas, 'Courier New', monospace; font-size: 1.8rem !important; letter-spacing: .5rem; max-width: 14rem; text-align: center; }

/* Messages */
.alert { padding: .9rem 1.1rem; border-left: 6px solid var(--muted); background: var(--bg-soft); margin: 0 0 1.2rem; }
.alert ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.alert-error { border-left-color: var(--st-major); }
.alert-success { border-left-color: var(--st-operational); }
.alert-warning { border-left-color: var(--st-degraded); }
.alert-info { border-left-color: var(--st-maintenance); }

/* Pagination */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1.5rem 0; flex-wrap: wrap; }

/* Pied de page — anthracite comme umbt.ca */
.site-footer { background: var(--bg-dark); color: #d6d6d6; padding: 2rem 0; margin-top: 3rem; font-size: .9rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--brand); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.2rem; flex-wrap: wrap; }

.empty { padding: 1.2rem; background: var(--bg-soft); border: 1px dashed var(--line); color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .site-header nav, .tabs, .site-footer, .button { display: none !important; } .js .tabpanel[hidden] { display: block !important; } }

/* Utilitaires (aucun attribut style= : CSP stricte) */
.page-title { margin-top: 2rem; }
.m0 { margin: 0; }
.mt1 { margin-top: 1rem; }
.mt2 { margin-top: 2rem; }
.inline { display: inline; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
