@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── BASE — version noire, toujours dans le langage visuel "à
   l'Atlassian" (Statuspage) : bandeau d'état plein-fond coloré, liste de
   composants nette, mais sur fond sombre/noir. Copiée localement, aucune
   dépendance vers le serveur principal. ── */
:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --bg2: #131315;
  --bg3: #1a1a1d;
  --line: #232326;
  --line-hover: #313135;
  --glass: #18181b;
  --glass-hover: #202023;
  --glass-border: #232326;
  --glass-border-hover: #313135;
  --blue: #4c9aff;
  --blue-dim: #112240;
  --green: #36d399;
  --green-bright: #22c55e;
  --green-dim: #0f2a1c;
  --amber: #ffb020;
  --amber-bright: #f5a524;
  --amber-dim: #2b2008;
  --red: #f0453a;
  --red-dim: #2c1210;
  --text: #f2f3f5;
  --text-muted: #6b6f76;
  --text-dim: #9a9ea5;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.02);
  --shadow-card-hover: 0 6px 16px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04);
  --ease: cubic-bezier(.2,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

.statut-body { background: var(--bg); }
.bg-orb { display: none; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.statut-hero, .statut-section { animation: fade-up .45s var(--ease) both; }
.statut-section:nth-of-type(1) { animation-delay: .03s; }
.statut-section:nth-of-type(2) { animation-delay: .06s; }
.statut-section:nth-of-type(3) { animation-delay: .09s; }
.statut-section:nth-of-type(4) { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) {
  .statut-hero, .statut-section, .bg-orb { animation: none !important; }
}

/* ── EN-TÊTE ── */
.statut-topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.6rem 2.5rem;
  max-width: 1000px; margin: 0 auto;
}
.statut-brand { display: flex; align-items: center; gap: 12px; }
.statut-brand img { width: 30px; height: 30px; border-radius: 7px; }
.statut-brand-name { font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; color: var(--text); }
.statut-brand-tag {
  font-weight: 700; font-size: .64rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-dim); background: var(--glass); border: 1px solid var(--glass-border);
  padding: 3px 9px; border-radius: 50px; margin-left: 2px;
}
.statut-back {
  display: flex; align-items: center; gap: 6px;
  font-size: .82rem; font-weight: 600; color: var(--text-dim);
  padding: 7px 13px 7px 10px; border-radius: 6px; border: 1px solid transparent;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.statut-back:hover { color: var(--text); background: var(--glass); border-color: var(--glass-border); }
.statut-back i { transition: transform .15s var(--ease); }
.statut-back:hover i { transform: translateX(-2px); }

/* ── BANNIÈRE D'ÉTAT — plein fond coloré ── */
.statut-hero {
  position: relative; z-index: 2;
  max-width: 1000px; margin: .2rem auto 0; padding: 0 2.5rem;
}
.statut-banner {
  position: relative; overflow: hidden;
  border-radius: var(--radius); border: 1px solid transparent;
  background: var(--green-bright);
  box-shadow: var(--shadow-card);
  padding: 1.9rem 2.3rem;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  transition: background .3s var(--ease);
  color: #06120c;
}
.statut-banner[data-state="operational"] { background: var(--green-bright); color: #06180f; }
.statut-banner[data-state="degraded"] { background: var(--amber-bright); color: #201400; }
.statut-banner[data-state="outage"] { background: var(--red); color: #fff; }

.statut-banner-left { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; min-width: 0; }

.statut-state-icon-wrap { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.statut-state-icon-ring {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.35); opacity: .5;
  animation: ring-pulse 2.4s ease-out infinite;
}
.statut-banner[data-state="outage"] .statut-state-icon-ring { border-color: rgba(255,255,255,.6); display: none; }
@keyframes ring-pulse {
  0% { transform: scale(.82); opacity: .55; }
  70% { transform: scale(1.25); opacity: 0; }
  100% { opacity: 0; }
}
.statut-state-icon {
  position: relative; z-index: 1;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.16); color: inherit;
  transition: background .3s var(--ease);
}
.statut-banner[data-state="outage"] .statut-state-icon { background: rgba(255,255,255,.18); animation: shake .5s var(--ease); }
.statut-state-icon svg, .statut-state-icon i { width: 22px; height: 22px; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.statut-banner-title { font-weight: 800; font-size: 1.32rem; letter-spacing: -.01em; }
.statut-banner-sub { margin-top: 3px; font-size: .83rem; opacity: .8; }
.statut-banner-sub #statut-checked-at { font-weight: 700; font-variant-numeric: tabular-nums; }

.statut-pulse { display: none; }

.statut-refresh-note {
  display: flex; align-items: center; gap: 6px;
  font-size: .76rem; color: var(--text-muted);
}
.statut-refresh-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--green-bright);
  animation: refresh-blink 2.6s ease-in-out infinite;
}
@keyframes refresh-blink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ── BARRE D'ACTIONS ── */
.statut-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 1rem;
}
.statut-refresh-note { margin-left: auto; }
.statut-action-btn {
  display: flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: .8rem; font-weight: 600; color: var(--text-dim);
  background: var(--bg2); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 7px 13px; cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease), opacity .15s var(--ease);
}
.statut-action-btn:hover:not(:disabled) { color: var(--text); background: var(--glass); border-color: var(--glass-border-hover); }
.statut-action-btn:disabled { opacity: .55; cursor: default; }
.statut-action-btn.active { color: var(--green); border-color: #1c4a34; background: var(--green-dim); }
.statut-action-btn.is-busy i { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .statut-action-btn.is-busy i { animation: none; } }
@media (max-width: 760px) {
  .statut-refresh-note { margin-left: 0; width: 100%; justify-content: flex-start; }
}

/* ── BARRE DE STATISTIQUES ── */
.statut-stats {
  max-width: 1000px; margin: 1rem auto 0; padding: 0 2.5rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.statut-stat {
  border: 1px solid var(--glass-border); background: var(--bg2); border-radius: var(--radius-sm);
  padding: 1rem 1.2rem; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-card);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.statut-stat:hover { border-color: var(--glass-border-hover); box-shadow: var(--shadow-card-hover); transform: translateY(-1px); }
.statut-stat-icon {
  width: 34px; height: 34px; border-radius: var(--radius-xs); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-dim); color: var(--blue);
}
.statut-stat-icon i { width: 16px; height: 16px; }
.statut-stat-value {
  font-weight: 800; font-size: 1.22rem; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--text);
}
.statut-stat-label { font-size: .72rem; color: var(--text-dim); margin-top: 2px; }
@media (max-width: 760px) { .statut-stats { grid-template-columns: 1fr; } }

/* ── SECTIONS ── */
.statut-section { max-width: 1000px; margin: 2.6rem auto 0; padding: 0 2.5rem; }
.statut-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; }
.statut-section-title { font-weight: 750; font-size: 1.02rem; letter-spacing: -.005em; color: var(--text); }
.statut-section-note { font-size: .78rem; color: var(--text-dim); }
.statut-section-note a { color: var(--blue); font-weight: 600; }
.statut-section-note a:hover { opacity: .8; }

/* ── COMPOSANTS PRINCIPAUX — liste empilée ── */
.statut-core-grid { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--glass-border); border-radius: var(--radius); background: var(--bg2); box-shadow: var(--shadow-card); overflow: hidden; }

.statut-card {
  position: relative; overflow: hidden;
  border: none; background: var(--bg2); border-radius: 0;
  padding: 1.1rem 1.35rem;
  transition: background .15s var(--ease);
}
.statut-card + .statut-card { border-top: 1px solid var(--glass-border); }
.statut-card:hover { background: var(--bg3); }

.statut-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.statut-card-name { font-weight: 700; font-size: .93rem; display: flex; align-items: center; gap: 9px; color: var(--text); }
.statut-card-desc { margin-top: 6px; font-size: .78rem; color: var(--text-dim); line-height: 1.5; }
.statut-card-meta { margin-top: 10px; font-size: .72rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.statut-card-meta .latency-tag { display: inline-flex; align-items: center; gap: 4px; }
.statut-card-meta .latency-tag.fast { color: var(--green); }
.statut-card-meta .latency-tag.slow { color: var(--amber); }
.statut-card-meta .latency-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.statut-card-uptime-pct { font-weight: 700; color: var(--text-dim); }

/* ── HISTORIQUE (barres, 90 jours) ── */
.statut-uptime { margin-top: 12px; }
.statut-uptime-bars { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.statut-uptime-bars .bar {
  flex: 1 1 0; min-width: 2px; height: 100%; border-radius: 1px; background: #2a2a2e; cursor: default;
  transition: transform .15s var(--ease), filter .15s var(--ease);
}
.statut-uptime-bars .bar:hover { transform: scaleY(1.1); filter: brightness(1.15); }
.statut-uptime-bars .bar[data-s="up"] { background: var(--green-bright); }
.statut-uptime-bars .bar[data-s="degraded"] { background: var(--amber-bright); }
.statut-uptime-bars .bar[data-s="down"] { background: var(--red); }
.statut-uptime-label { display: flex; justify-content: space-between; font-size: .68rem; color: var(--text-muted); margin-top: 5px; }
.statut-uptime-empty {
  font-size: .74rem; color: var(--text-dim); margin-top: 10px; padding: .7rem .8rem;
  background: var(--bg3); border: 1px dashed var(--glass-border); border-radius: var(--radius-xs); line-height: 1.5;
}

.statut-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--text-muted); }
.statut-dot[data-s="up"] { background: var(--green-bright); }
.statut-dot[data-s="degraded"] { background: var(--amber-bright); }
.statut-dot[data-s="down"] { background: var(--red); }
.statut-dot[data-s="off"] { background: var(--text-muted); }

.statut-pill { font-size: .7rem; font-weight: 700; padding: 4px 11px; border-radius: 50px; white-space: nowrap; letter-spacing: .01em; }
.statut-pill[data-s="up"] { color: var(--green); background: var(--green-dim); }
.statut-pill[data-s="degraded"] { color: var(--amber); background: var(--amber-dim); }
.statut-pill[data-s="down"] { color: var(--red); background: var(--red-dim); }
.statut-pill[data-s="off"] { color: var(--text-dim); background: var(--glass); }

/* ── INTÉGRATIONS / HÉBERGEUR (listes groupées) ── */
.statut-group {
  border: 1px solid var(--glass-border); background: var(--bg2); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 12px; box-shadow: var(--shadow-card);
  transition: box-shadow .15s var(--ease);
}
.statut-group:hover { box-shadow: var(--shadow-card-hover); }
.statut-group-head {
  padding: .8rem 1.25rem; font-size: .72rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-dim); background: var(--bg3); border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.statut-group-head a { color: var(--blue); text-transform: none; letter-spacing: 0; font-weight: 600; font-size: .74rem; }
.statut-group-head a:hover { opacity: .8; }
.statut-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: .8rem 1.25rem; transition: background .15s var(--ease); }
.statut-row:hover { background: var(--bg3); }
.statut-row + .statut-row { border-top: 1px solid var(--glass-border); }
.statut-row-name { display: flex; align-items: center; gap: 10px; font-size: .85rem; font-weight: 600; color: var(--text); }

.statut-hosting-alert {
  margin: 0 1.25rem 1rem; padding: .7rem .9rem; border-radius: var(--radius-xs);
  background: var(--amber-dim); border: 1px solid #4a3a10; font-size: .78rem; color: var(--amber);
  line-height: 1.5;
}
.statut-hosting-alert a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.statut-hosting-alert + .statut-hosting-alert { margin-top: -6px; }

/* ── INCIDENTS (timeline) ── */
.statut-empty {
  border: 1px dashed var(--glass-border); border-radius: var(--radius);
  padding: 2.5rem 1.5rem; text-align: center; color: var(--text-dim);
  background: var(--bg2);
}
.statut-empty i { width: 28px; height: 28px; color: var(--green-bright); margin-bottom: 12px; }
.statut-empty-title { font-weight: 700; color: var(--text); font-size: .94rem; margin-bottom: 4px; }
.statut-empty-sub { font-size: .8rem; }

.statut-incidents-list { position: relative; }
.statut-incident {
  position: relative; border: 1px solid var(--glass-border); background: var(--bg2);
  border-radius: var(--radius); padding: 1.15rem 1.35rem; margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  transition: box-shadow .15s var(--ease);
}
.statut-incident:hover { box-shadow: var(--shadow-card-hover); }
.statut-incident-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.statut-incident-title { font-weight: 750; font-size: .94rem; color: var(--text); }
.statut-incident-date { font-size: .74rem; color: var(--text-muted); margin-top: 4px; }
.statut-incident-copy {
  display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 600; color: var(--text-dim);
  background: var(--bg3); border: 1px solid var(--glass-border); border-radius: 50px; padding: 5px 11px; cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.statut-incident-copy:hover { color: var(--text); border-color: var(--glass-border-hover); background: var(--glass-hover); }
.statut-incident-copy.copied { color: var(--green); border-color: #1c4a34; background: var(--green-dim); }

.statut-incident-updates {
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 2px;
}
.statut-incident-update {
  position: relative; font-size: .82rem; line-height: 1.6; padding: 6px 0 6px 22px; color: var(--text-dim);
}
.statut-incident-update::before {
  content: ''; position: absolute; left: 4px; top: 13px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted); box-shadow: 0 0 0 3px var(--bg2);
}
.statut-incident-update::after {
  content: ''; position: absolute; left: 7.5px; top: 20px; bottom: -2px; width: 1px; background: var(--glass-border);
}
.statut-incident-update:last-child::after { display: none; }
.statut-incident-update[data-status="resolved"]::before { background: var(--green-bright); }
.statut-incident-update .t {
  color: var(--text-muted); font-size: .68rem; font-weight: 600; margin-right: 8px; font-variant-numeric: tabular-nums;
  text-transform: uppercase; letter-spacing: .02em;
}
.statut-incident-update .status-label { color: var(--text); font-weight: 600; }

.statut-footer {
  max-width: 1000px; margin: 3rem auto 2.5rem; padding: 1.5rem 2.5rem 0; border-top: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: .78rem; color: var(--text-muted);
}
.statut-footer a { color: var(--blue); font-weight: 600; transition: opacity .15s var(--ease); }
.statut-footer a:hover { opacity: .75; }

@media (max-width: 640px) {
  .statut-topbar, .statut-hero, .statut-stats, .statut-section, .statut-footer { padding-left: 1.2rem; padding-right: 1.2rem; }
  .statut-banner { padding: 1.6rem 1.4rem; }
  .statut-banner-title { font-size: 1.15rem; }
  .statut-refresh-note { justify-content: flex-start; }
}
