/* ============================================================
   Status Page — Colégio Mentoria
   Dark theme only · Tokens Mentoria · Mobile-first responsive
   ============================================================ */

:root {
  --brand-green: #16DF6F;
  --brand-black: #050508;
  --bg-shell: #050508;
  --bg-card: #0a0a0e;
  --bg-card-hover: #11131a;
  --border-subtle: #1e2028;
  --border-strong: #27292f;
  --text-primary: #FAFAFA;
  --text-muted: #a1a1aa;
  --text-faint: #71717a;
  --status-ok: #16DF6F;
  --status-warn: #F59E0B;
  --status-down: #EF4444;
  --status-unknown: #52525b;
  --radius-card: 12px;
  --radius-pill: 999px;
  --font-sans: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--bg-shell);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--brand-green);
  color: var(--brand-black);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.brand-text strong { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.brand-text small {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.header-meta {
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  text-align: right;
}
.header-meta .updated-time { color: var(--text-primary); font-weight: 500; }

/* ---------- Page title ---------- */
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 6px; }
.page-subtitle { color: var(--text-muted); font-size: 14px; margin: 0 0 24px; }

/* ---------- Overall banner ---------- */
.banner {
  padding: 18px 22px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  transition: border-color 0.2s, background 0.2s;
}
.banner-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--status-unknown);
}
.banner-label { font-weight: 600; font-size: 16px; }
.banner.up { border-color: rgba(22, 223, 111, 0.3); }
.banner.up .banner-dot {
  background: var(--status-ok);
  box-shadow: 0 0 0 4px rgba(22, 223, 111, 0.15);
}
.banner.degraded { border-color: rgba(245, 158, 11, 0.3); }
.banner.degraded .banner-dot {
  background: var(--status-warn);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}
.banner.down { border-color: rgba(239, 68, 68, 0.3); }
.banner.down .banner-dot {
  background: var(--status-down);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

/* ---------- Section heading ---------- */
.section-heading {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 32px 0 14px;
}

/* ---------- Component cards ---------- */
.components { display: flex; flex-direction: column; gap: 10px; }
.card {
  padding: 18px 20px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-strong); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.card-desc { font-size: 12px; color: var(--text-faint); margin: 0; line-height: 1.4; }
.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.latency {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  min-width: 56px;
  text-align: right;
}
.latency strong { color: var(--text-primary); font-weight: 500; }

/* ---------- Status pill ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  flex-shrink: 0;
  border: 1px solid transparent;
}
.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-unknown);
}
.pill.up {
  background: rgba(22, 223, 111, 0.12);
  color: var(--status-ok);
  border-color: rgba(22, 223, 111, 0.25);
}
.pill.up .pill-dot { background: var(--status-ok); animation: pulse 2s ease-in-out infinite; }
.pill.degraded {
  background: rgba(245, 158, 11, 0.12);
  color: var(--status-warn);
  border-color: rgba(245, 158, 11, 0.25);
}
.pill.degraded .pill-dot { background: var(--status-warn); }
.pill.down {
  background: rgba(239, 68, 68, 0.12);
  color: var(--status-down);
  border-color: rgba(239, 68, 68, 0.25);
}
.pill.down .pill-dot { background: var(--status-down); }
.pill.loading {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border-color: var(--border-strong);
}
.pill.loading .pill-dot { background: var(--text-muted); animation: pulse 1.2s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---------- Uptime bar (90 days) ---------- */
.uptime {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.uptime-bar {
  display: grid;
  grid-template-columns: repeat(90, 1fr);
  gap: 2px;
  height: 28px;
}
.uptime-cell {
  background: var(--status-unknown);
  border-radius: 2px;
  min-width: 0;
  transition: transform 0.1s, filter 0.1s;
}
.uptime-cell:hover { transform: scaleY(1.15); filter: brightness(1.2); }
.uptime-cell.up { background: var(--status-ok); }
.uptime-cell.degraded { background: var(--status-warn); }
.uptime-cell.down { background: var(--status-down); }
.uptime-cell.empty { background: var(--border-subtle); }
.uptime-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

/* ---------- Empty state ---------- */
.empty {
  padding: 24px;
  border-radius: var(--radius-card);
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-faint);
  text-align: center;
  font-size: 14px;
}

/* ---------- Incident / Maintenance entry ---------- */
.incident {
  padding: 16px 18px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  margin-bottom: 10px;
}
.incident-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.incident-title { font-weight: 600; font-size: 15px; margin: 0; }
.incident-date { font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); white-space: nowrap; }
.incident-body { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.5; }
.incident-status {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.incident-status.resolved { background: rgba(22, 223, 111, 0.12); color: var(--status-ok); }
.incident-status.investigating { background: rgba(245, 158, 11, 0.12); color: var(--status-warn); }
.incident-status.scheduled { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--text-faint);
}
.site-footer a { color: var(--brand-green); text-decoration: none; font-weight: 500; }
.site-footer a:hover { text-decoration: underline; }
.footer-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Focus states (A11y) ---------- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Responsive (mobile) ---------- */
@media (max-width: 540px) {
  .wrap { padding: 20px 14px 60px; }
  .page-title { font-size: 24px; }
  .card-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .card-meta { width: 100%; justify-content: space-between; }
  .latency { text-align: left; }
  .header-meta { text-align: left; width: 100%; }
  .uptime-bar { height: 22px; }
}
