/* Page « État des services » (etat-des-services.php). Couleurs du thème
   (style.css) : --success / --warning / --danger et leurs fonds. */
.st-page {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  box-sizing: border-box;
  flex: 1 0 auto;
}
.st-page h1 { font-size: clamp(26px, 5vw, 34px); font-weight: 500; margin: 8px 0 20px; color: var(--text); }
.st-page h2 { font-size: 18px; margin: 0; color: var(--text); }

.st-ok { --st: var(--success); --st-bg: var(--success-bg); }
.st-warn { --st: var(--warning); --st-bg: var(--warning-bg); }
.st-bad { --st: var(--danger); --st-bg: var(--danger-bg); }

/* Bandeau d'état global */
.st-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: var(--st-bg);
  border: 1px solid color-mix(in srgb, var(--st) 30%, transparent);
  margin-bottom: 16px;
}
.st-hero-icon {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--st);
  color: var(--bg);
}
.st-hero-icon svg { width: 28px; height: 28px; }
.st-hero h2 { font-size: clamp(18px, 3.6vw, 22px); color: var(--st); }
.st-hero p { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }
.st-bad .st-hero-icon { animation: st-pulse 1.8s ease-in-out infinite; }
@keyframes st-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--st) 45%, transparent); }
  50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--st) 0%, transparent); }
}

/* Coupures en cours */
.st-incident {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--st);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.st-incident header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-incident h3 { margin: 0; font-size: 16px; color: var(--text); }
.st-incident p { margin: 8px 0 0; color: var(--text); line-height: 1.55; }
.st-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--st);
  background: var(--st-bg);
}
.st-eta { font-size: 14px; }
.st-page .st-meta { color: var(--text-muted); font-size: 13px; }

/* Carte des services */
.st-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-top: 16px;
}
.st-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.st-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--st); }
.st-group {
  margin: 22px 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.st-services { list-style: none; margin: 0; padding: 0; }
.st-service { padding: 12px 0; border-bottom: 1px solid var(--border); }
.st-service:last-child { border-bottom: 0; }
.st-service-head { display: flex; align-items: center; gap: 12px; }
.st-service-name { flex: 1; min-width: 0; font-weight: 500; color: var(--text); }
.st-uptime { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.st-uptime.st-warn, .st-uptime.st-bad { color: var(--st); font-weight: 600; }
.st-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--st);
  white-space: nowrap;
}
.st-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.st-bars { display: flex; gap: 3px; margin-top: 10px; height: 26px; }
.st-bar {
  flex: 1;
  border-radius: 3px;
  background: var(--st);
  opacity: .85;
  transition: opacity .15s var(--ease), transform .15s var(--ease);
}
.st-bar.st-ok { opacity: .55; }
.st-bar:hover { opacity: 1; transform: scaleY(1.12); }
/* Maintenance générale (hors-service.php) : avancée de chaque service */
.st-wait { --st: var(--text-muted); --st-bg: color-mix(in srgb, var(--text-muted) 12%, transparent); }
.st-closure-count { margin-top: 6px !important; }
.st-closure-count strong { color: var(--text); }
.st-steps { list-style: none; margin: 0; padding: 0; }
.st-step {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.st-step:last-child { border-bottom: 0; }
.st-step-name { min-width: 0; font-weight: 500; color: var(--text); }
.st-step.st-wait .st-step-name { color: var(--text-muted); }
.st-step-bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: color-mix(in srgb, var(--st) 16%, transparent); overflow: hidden; }
.st-step-bar span { display: block; height: 100%; border-radius: 6px; background: var(--st); transition: width .6s var(--ease); }
.st-step.st-warn .st-step-bar span { background-image: linear-gradient(90deg, transparent, color-mix(in srgb, #fff 35%, transparent), transparent); background-color: var(--st); background-size: 200% 100%; animation: st-step-shine 2.2s linear infinite; }
@keyframes st-step-shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .st-step.st-warn .st-step-bar span { animation: none; } }

.st-axis { display: flex; justify-content: space-between; margin: 10px 0 0; font-size: 12px; color: var(--text-muted); }

/* Historique */
.st-empty { margin: 12px 0 0; color: var(--text-muted); }
.st-history { list-style: none; margin: 14px 0 0; padding: 0; }
.st-history li { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.st-history li:first-child { border-top: 0; }
.st-history-dot { flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--st); }
.st-history p { margin: 0; color: var(--text); line-height: 1.5; }
.st-history p + p { margin-top: 4px; }
.st-history-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.st-help { margin-top: 20px; text-align: center; font-size: 14px; color: var(--text-muted); }

/* ---- Pages hors-service.php (service coupé, site fermé) ---------------- */
.st-preview-bar {
  padding: 8px 16px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  background: #fbbc05;
  color: #202124;
}
.st-preview-bar a { color: inherit; }

/* Grand bandeau : message, retour prévu, boutons */
.st-hero-lg { align-items: flex-start; padding: 26px 28px; }
.st-hero-lg .st-hero-icon { width: 60px; height: 60px; }
.st-hero-lg .st-hero-icon svg { width: 30px; height: 30px; }
.st-hero-body { flex: 1; min-width: 0; }
.st-hero-lg h2 { font-size: clamp(20px, 4vw, 26px); line-height: 1.25; }
.st-hero .st-hero-message { margin: 10px 0 0; color: var(--text); font-size: 15px; line-height: 1.6; }
.st-eta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--st) 35%, transparent);
  color: var(--st);
  font-size: 14px;
}
.st-eta-pill svg { width: 16px; height: 16px; flex: none; }
.st-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 14px; }
.st-actions .btn { margin: 0; }
.st-hero .st-meta { margin: 0; }

/* Barre d'attente animée (site fermé) */
.st-progress { height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--st) 18%, transparent); overflow: hidden; margin: 18px 0 12px; }
.st-progress span { display: block; height: 100%; width: 35%; border-radius: 4px; background: var(--st); animation: st-slide 2.4s ease-in-out infinite; }
@keyframes st-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.st-hero-gears svg { animation: st-spin 6s linear infinite; }

/* Avancée chiffrée d'une maintenance (réglée dans l'administration) */
.st-progress-wrap { margin: 16px 0 12px; max-width: 520px; }
.st-progress-label { display: flex; justify-content: space-between; margin: 0 0 6px; font-size: 13px; color: var(--text-muted); }
.st-progress-label strong { color: var(--st); font-size: 15px; font-variant-numeric: tabular-nums; }
.st-progress-wrap .st-progress { margin: 0; height: 8px; }
.st-progress.is-determinate span { animation: none; transition: width .6s var(--ease); }
.st-incident .st-progress-wrap { margin: 12px 0 4px; }

/* « Me prévenir quand le service revient » */
.st-watch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 14px 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px dashed color-mix(in srgb, var(--st, var(--link)) 45%, transparent);
}
.st-watch > svg { width: 20px; height: 20px; flex: none; color: var(--st, var(--link)); }
.st-watch p { margin: 0; flex: 1 1 220px; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.st-watch-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0; }
.st-watch-form .btn { margin: 0; }
.st-watch-mail { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.st-watch-mail input { width: auto; margin: 0; }
.st-watch-count { color: var(--text-muted); font-size: 12.5px; }
.st-watch.is-on { border-style: solid; background: var(--st-bg, var(--link-tint)); }
.st-watch-link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--link); cursor: pointer; text-decoration: underline; }
.st-watch.is-compact { margin: 12px 0 0; padding: 10px 12px; }

/* Barres d'une maintenance en cours : la part terminée pleine, le reste estompé */
.st-bar.is-pending { opacity: .28; }
@keyframes st-spin { to { transform: rotate(360deg); } }

/* Site fermé : page centrée, sans barre du haut */
.st-closed { max-width: 720px; padding-top: 48px; }
.st-closed-logo { display: block; height: 44px; width: auto; margin: 0 auto 28px; }
.st-facts { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; }
.st-facts li { display: flex; gap: 14px; align-items: flex-start; color: var(--text); line-height: 1.55; }
.st-fact-icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--link-tint);
  color: var(--link);
}
.st-fact-icon svg { width: 18px; height: 18px; }

/* Suivi de l'incident : dernière étape mise en avant */
.st-timeline li.is-latest .st-history-dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--st) 25%, transparent); }
.st-timeline li:not(.is-latest) { opacity: .75; }
.st-timeline .st-history-title strong { color: var(--st); }

/* Service touché, mis en avant dans la liste */
.st-service.is-current {
  margin: 4px -12px;
  padding: 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--st-bg);
}
.st-service.is-current .st-service-name { font-weight: 700; }

@media (max-width: 560px) {
  .st-hero { padding: 18px; gap: 14px; }
  .st-card { padding: 18px 16px; }
  .st-bars { gap: 2px; height: 22px; }
  .st-uptime { display: none; }
}
@media (max-width: 560px) {
  .st-hero-lg { flex-direction: column; padding: 20px; }
  .st-closed { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .st-bad .st-hero-icon, .st-hero-gears svg, .st-progress span { animation: none; }
}
