/* ba-li ported */
/* Page styles for /status/, moved from the v2 page head. */
/* ═══════════════════════════════════════════════
   STATUS PAGE: scoped to .page-status
   (ported from production; colors mapped to V2 tokens)
═══════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────── */
.status-hero {
  background: var(--navy-900);
  padding: 5rem 0 4.5rem;
}
.status-hero-inner { display: flex; flex-direction: column; align-items: flex-start; }

.status-overall {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--r-pill);
  padding: 7px 16px 7px 10px;
  margin-bottom: 28px;
  border: 1px solid transparent;
}
.status-overall--operational { background: rgba(34,197,94,0.12);   border-color: rgba(34,197,94,0.25); }
.status-overall--outage      { background: rgba(239,68,68,0.12);   border-color: rgba(239,68,68,0.25); }
.status-overall--degraded,
.status-overall--paused      { background: rgba(245,158,11,0.12);  border-color: rgba(245,158,11,0.25); }
.status-overall--unknown     { background: rgba(168,175,202,0.12); border-color: rgba(168,175,202,0.25); }

.status-overall-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.status-overall--operational .status-overall-dot { background: #22c55e; }
.status-overall--outage      .status-overall-dot { background: #ef4444; }
.status-overall--degraded    .status-overall-dot,
.status-overall--paused      .status-overall-dot { background: #f59e0b; }
.status-overall--unknown     .status-overall-dot { background: #a8afca; }

@media (prefers-reduced-motion: no-preference) {
  .status-overall--operational .status-overall-dot { animation: soPulseGreen 2.4s ease-in-out infinite; }
  .status-overall--outage      .status-overall-dot { animation: soPulseRed   2.4s ease-in-out infinite; }
  @keyframes soPulseGreen {
    0%,100% { box-shadow: 0 0 0 3px rgba(34,197,94,0.20); }
    50%     { box-shadow: 0 0 0 7px rgba(34,197,94,0.04); }
  }
  @keyframes soPulseRed {
    0%,100% { box-shadow: 0 0 0 3px rgba(239,68,68,0.20); }
    50%     { box-shadow: 0 0 0 7px rgba(239,68,68,0.04); }
  }
}

.status-overall-text {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.status-overall--operational .status-overall-text { color: #4ade80; }
.status-overall--outage      .status-overall-text { color: #fca5a5; }
.status-overall--degraded    .status-overall-text,
.status-overall--paused      .status-overall-text { color: #fcd34d; }
.status-overall--unknown     .status-overall-text { color: rgba(255,255,255,0.5); }

.status-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
  color: #F4F9FD;
  margin-bottom: 14px;
}
.status-hero-sub {
  font-size: .95rem;
  /* 0.45 alpha measured 4.42:1 on this hero — just under AA. 0.50 gives 5.14:1. */
  color: rgba(255,255,255,0.50);
  margin-bottom: 44px;
  font-weight: 500;
}
.status-hero .crumbs { margin-bottom: 1.5rem; }
.status-hero .crumbs, .status-hero .crumbs a { color: #7A93AB; }
.status-hero .crumbs a:hover { color: var(--sky-400); }

/* Hero metric strip */
.status-hero-metrics {
  display: flex;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-md);
  overflow: hidden;
  width: 100%;
  max-width: 660px;
}
.shm-item {
  flex: 1;
  padding: 20px 22px;
  border-right: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.shm-item:last-child { border-right: none; }
.shm-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 5px;
}
.shm-val--green { color: #4ade80; }
.shm-val--red   { color: #fca5a5; }
.shm-label {
  font-size: .7rem;
  font-weight: 700;
  /* These labels are 11.2px, so AA wants 4.5:1. At 0.38 alpha they measured
     3.46:1; 0.55 gives 5.69:1 without changing the muted look. */
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: .06em;
}
@media (max-width: 600px) {
  .status-hero-metrics { flex-wrap: wrap; max-width: 100%; }
  .shm-item { flex: 0 0 50%; border-right: 1px solid rgba(255,255,255,0.08); }
  .shm-item:nth-child(2n) { border-right: none; }
  .shm-item:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,0.08); }
}

/* ── Section wrapper ──────────────────────────── */
.status-section { padding: 4rem 0; }
.status-section-alt { background: var(--mist); }

.status-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.status-section-title { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.status-section-meta  { font-size: .75rem; font-weight: 600; color: var(--ink-3); }

/* ── API error notice ─────────────────────────── */
.status-api-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--r-sm);
  padding: 14px 18px;
  font-size: .84rem;
  line-height: 1.5;
  color: #92400e;
  margin-bottom: 28px;
}
.status-api-notice .ico { color: #f59e0b; flex-shrink: 0; margin-top: .15rem; }

/* ── Service cards grid ───────────────────────── */
.status-services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .status-services-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .status-services-grid { grid-template-columns: 1fr; } }

.status-svc-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px 22px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.status-svc-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-soft);
}
.status-svc-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: #22c55e;
}
.status-svc-card--degraded::before { background: #f59e0b; }
.status-svc-card--outage::before   { background: #ef4444; }
.status-svc-card--maint::before    { background: var(--blue-600); }
.status-svc-card--none::before     { background: var(--line-2); }

.svc-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
}
.svc-card-name { font-size: .88rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.svc-card-url {
  font-size: .7rem;
  font-weight: 500;
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Status pill */
.svc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.svc-status-pill--op   { background: rgba(34,197,94,0.1);   color: #15803d; }
.svc-status-pill--deg  { background: rgba(245,158,11,0.1);  color: #b45309; }
.svc-status-pill--out  { background: rgba(239,68,68,0.1);   color: #b91c1c; }
.svc-status-pill--maint{ background: rgba(21,96,232,0.1);   color: var(--blue-700); }
.svc-status-pill--none { background: rgba(168,175,202,0.1); color: #6b7280; }

.svc-status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* 90-day uptime bars */
.svc-uptime-bar {
  display: flex;
  gap: 1.5px;
  align-items: stretch;
  height: 26px;
  margin-bottom: 7px;
}
.svc-uptime-bar--nodata {
  background: var(--ink-10, rgba(15, 30, 46, 0.10));
  border-radius: 2px;
}
.sub {
  flex: 1;
  border-radius: 2px;
  background: #22c55e;
  min-width: 0;
  opacity: .8;
  transition: opacity var(--dur-fast);
}
.sub:hover { opacity: 1; }
.sub--deg  { background: #f59e0b; opacity: .9; }
.sub--out  { background: #ef4444; opacity: .9; }
.sub--none { background: var(--frost); }

.svc-uptime-meta { display: flex; justify-content: space-between; align-items: center; }
.svc-uptime-label { font-size: .67rem; font-weight: 600; color: var(--ink-3); }
.svc-uptime-pct, .svc-uptime-pct--deg, .svc-uptime-pct--out, .svc-uptime-pct--unknown {
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.svc-uptime-pct          { color: #15803d; }
.svc-uptime-pct--deg     { color: #b45309; }
.svc-uptime-pct--out     { color: #b91c1c; }
.svc-uptime-pct--unknown { color: var(--ink-3); }

/* ── Summary strip ────────────────────────────── */
.status-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 56px;
}
@media (max-width: 680px) { .status-summary-strip { grid-template-columns: 1fr 1fr; } }
.sss-item { background: var(--paper); padding: 24px 20px; text-align: center; }
.sss-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 5px;
}
.sss-val--green { color: #15803d; }
.sss-label {
  font-size: .71rem;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Status legend ────────────────────────────── */
.status-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sleg-item { display: flex; align-items: center; gap: 6px; font-size: .71rem; font-weight: 600; color: var(--ink-3); }
.sleg-swatch { width: 10px; height: 10px; border-radius: 2px; }
.sleg-green { background: #22c55e; }
.sleg-amber { background: #f59e0b; }
.sleg-red   { background: #ef4444; }
.sleg-gray  { background: var(--line-2); }

/* ── Incident history ─────────────────────────── */
.incident-timeline { display: flex; flex-direction: column; }
.incident-month { padding: 22px 0 6px; border-top: 1px solid var(--line); }
.incident-month:first-child { border-top: none; padding-top: 0; }
.incident-month-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.incident-none {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .86rem;
  font-weight: 600;
  color: #15803d;
  padding: 8px 0 12px;
}
.incident-none .ico { flex-shrink: 0; }

.incident-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--mist);
}
.incident-row:last-child { border-bottom: none; }
@media (max-width: 640px) {
  .incident-row { grid-template-columns: 1fr; }
  .incident-date { text-align: left; }
}

.incident-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 2px;
}
.incident-badge--resolved     { background: rgba(34,197,94,0.1);  color: #15803d; }
.incident-badge--started      { background: rgba(239,68,68,0.1);  color: #b91c1c; }
.incident-badge--acknowledged { background: rgba(245,158,11,0.1); color: #b45309; }
.incident-badge--maintenance  { background: rgba(21,96,232,0.09); color: var(--blue-700); }

.incident-title { font-size: .88rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.incident-meta  { font-size: .78rem; color: var(--ink-2); line-height: 1.5; }
.incident-meta strong { color: var(--ink); font-weight: 600; }
.incident-date {
  font-size: .71rem;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
  text-align: right;
  margin-top: 3px;
}

/* ── Monitor groups ───────────────────────────── */
.status-groups { display: flex; flex-direction: column; gap: 36px; }
.status-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.status-group-name {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin: 0;
}
.status-group-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .03em;
  background: rgba(34,197,94,0.1);
  color: #15803d;
}
.status-group-badge--out { background: rgba(239,68,68,0.1); color: #b91c1c; }
.status-group-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-group-count { margin-left: auto; font-size: .7rem; font-weight: 600; color: var(--ink-3); }

/* ── Responsive tweaks ────────────────────────── */
@media (max-width: 480px) {
  .status-section { padding: 3rem 0; }
  .status-hero    { padding: 3.5rem 0 3.25rem; }
  .sss-val        { font-size: 1.4rem; }
}
.status-legend-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
