/*
 * SnapAct status page styles.
 * Self-contained — no dependency on the main site's site.css. Same font
 * family + brand palette as the main site, but keeps the page lightweight
 * so it loads fast under degraded conditions (when something IS down,
 * this is the page everyone hits).
 */

:root {
  --brand: #08b89d;
  --brand-dark: #047967;
  --accent: #5eead4;
  --ink: #0f172a;
  --ink-soft: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --bg: #f8fafc;

  --ok: #10b981;
  --ok-soft: #d1fae5;
  --warn: #f59e0b;
  --warn-soft: #fef3c7;
  --bad: #ef4444;
  --bad-soft: #fee2e2;
}

[data-theme="dark"] {
  --ink: #f1f5f9;
  --ink-soft: #e2e8f0;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.08);
  --surface: #0e1b2c;
  --bg: #08111c;
  --ok-soft: rgba(16, 185, 129, 0.14);
  --warn-soft: rgba(245, 158, 11, 0.16);
  --bad-soft: rgba(239, 68, 68, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
[data-theme="dark"] a { color: var(--accent); }

/* ─── Nav ────────────────────────────────────────────────────────── */
.status-nav {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.status-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}
.status-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
}
.status-brand:hover { text-decoration: none; }
.status-brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.status-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.status-brand-text {
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}
.status-brand-sub {
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}
.status-nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}
.status-nav-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}
.status-nav-link:hover {
  color: var(--ink);
  text-decoration: none;
}
.status-theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}
.status-theme-toggle:hover { border-color: var(--brand); color: var(--brand-dark); }
.status-theme-toggle svg { width: 16px; height: 16px; display: block; }
[data-theme="light"] .status-theme-moon { display: none; }
[data-theme="dark"] .status-theme-sun { display: none; }

/* ─── Overall banner ─────────────────────────────────────────────── */
.status-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 40px 0 32px;
  padding: 26px 28px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.status-banner-ok {
  border-color: var(--ok);
  background: linear-gradient(135deg, var(--ok-soft) 0%, var(--surface) 70%);
}
.status-banner-warn {
  border-color: var(--warn);
  background: linear-gradient(135deg, var(--warn-soft) 0%, var(--surface) 70%);
}
.status-banner-bad {
  border-color: var(--bad);
  background: linear-gradient(135deg, var(--bad-soft) 0%, var(--surface) 70%);
}
.status-banner-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
}
[data-theme="dark"] .status-banner-icon {
  background: rgba(255, 255, 255, 0.05);
}
.status-banner-ok .status-banner-icon { color: var(--ok); }
.status-banner-warn .status-banner-icon { color: var(--warn); }
.status-banner-bad .status-banner-icon { color: var(--bad); }
.status-banner-icon svg { width: 28px; height: 28px; }
.status-banner-title {
  margin: 0 0 4px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.status-banner-sub {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

/* ─── Section heads ──────────────────────────────────────────────── */
.status-section {
  margin: 36px 0;
}
.status-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  color: var(--ink);
}

/* ─── Service list ───────────────────────────────────────────────── */
.status-services {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.status-service {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}
.status-service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.status-service-id {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot-ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18); }
.status-dot-warn { background: var(--warn); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18); }
.status-dot-bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18); }
.status-service-name {
  display: block;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
}
.status-service-desc {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 2px;
}
.status-service-status {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ok);
  white-space: nowrap;
}
.status-service[data-state="warn"] .status-service-status { color: var(--warn); }
.status-service[data-state="bad"] .status-service-status { color: var(--bad); }

/* 90-day uptime bars — 90 thin vertical strips. JS injects the children. */
.status-uptime {
  margin-top: 16px;
  display: flex;
  gap: 2px;
  height: 28px;
}
.status-uptime-bar {
  flex: 1;
  border-radius: 2px;
  background: var(--ok);
  opacity: 0.85;
  transition: opacity 0.2s;
}
.status-uptime-bar:hover { opacity: 1; }
.status-uptime-bar-warn { background: var(--warn); }
.status-uptime-bar-bad { background: var(--bad); }
.status-uptime-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
}
.status-uptime-meta strong {
  color: var(--ink);
  font-weight: 700;
}

/* ─── Incidents ──────────────────────────────────────────────────── */
.status-incidents {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
}
.status-incidents-empty {
  margin: 0;
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.6;
}
.status-incident {
  text-align: left;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.status-incident:last-child { border-bottom: none; }
.status-incident-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.status-incident-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}
.status-incident-date {
  font-size: 0.82rem;
  color: var(--muted);
}
.status-incident-body {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ─── Subscribe ──────────────────────────────────────────────────── */
.status-section-subscribe { margin-top: 48px; }
.status-subscribe {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.status-subscribe-copy {
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 540px;
  line-height: 1.55;
}
.status-subscribe-btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}
.status-subscribe-btn:hover {
  background: var(--brand-dark);
  text-decoration: none;
  color: #fff;
}
[data-theme="dark"] .status-subscribe-btn {
  background: var(--brand);
  color: #08111c;
}
[data-theme="dark"] .status-subscribe-btn:hover {
  background: var(--accent);
  color: #08111c;
}

/* ─── Policies grid ──────────────────────────────────────────────── */
.status-policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.status-policy {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}
.status-policy strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--ink);
}
.status-policy p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ─── Footer ─────────────────────────────────────────────────────── */
.status-footer {
  margin-top: 60px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.status-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.status-footer small {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .status-banner { flex-direction: column; align-items: flex-start; padding: 22px; }
  .status-banner-icon { width: 40px; height: 40px; }
  .status-banner-icon svg { width: 22px; height: 22px; }
  .status-banner-title { font-size: 1.2rem; }
  .status-service-row { flex-direction: column; align-items: flex-start; }
  .status-service-status { align-self: flex-start; }
  .status-uptime { height: 22px; }
  .status-subscribe { flex-direction: column; align-items: flex-start; }
  .status-subscribe-btn { width: 100%; justify-content: center; }
}
