/* ─── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #22262f;
  --border: #2a2e3a;
  --text: #e4e6ed;
  --text-muted: #8b8fa3;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --fire: #ef4444;
  --fire-bg: rgba(239, 68, 68, 0.1);
  --warning-color: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);
  --success: #22c55e;
  --danger: #ef4444;
  --ack: #f59e0b;
  --ack-bg: rgba(245, 158, 11, 0.1);
  --resolved-bg: rgba(34, 197, 94, 0.1);
  --radius: 8px;
  --radius-sm: 4px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Nav ──────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand { display: flex; align-items: center; gap: 0.75rem; }
.nav-brand a {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.nav-org {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a { color: var(--text-muted); font-size: 0.9rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ─── Container ────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ─── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--surface-hover); text-decoration: none; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* ─── Badges ───────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-fire { background: var(--fire-bg); color: var(--fire); border: 1px solid var(--fire); }
.badge-warning { background: var(--warning-bg); color: var(--warning-color); border: 1px solid var(--warning-color); }
.badge-info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info); }
.badge-active { background: var(--fire-bg); color: var(--fire); border: 1px solid var(--fire); }
.badge-ack { background: var(--ack-bg); color: var(--ack); border: 1px solid var(--ack); }
.badge-resolved { background: var(--resolved-bg); color: var(--success); border: 1px solid var(--success); }

/* ─── Cards ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.alert-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: border-color 0.15s, background 0.15s;
  color: var(--text);
}
.alert-card:hover { border-color: var(--primary); background: var(--surface-hover); text-decoration: none; }

.alert-card-fire { border-left: 3px solid var(--fire); }
.alert-card-warning { border-left: 3px solid var(--warning-color); }
.alert-card-info { border-left: 3px solid var(--info); }

.alert-card-header { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.alert-card-team { color: var(--text-muted); font-size: 0.8rem; }
.alert-card-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.alert-card-time { font-size: 0.75rem; color: var(--text-muted); }

.alert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }

/* ─── Alert Detail ─────────────────────────────────────── */
.alert-detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; }
.alert-meta { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.75rem; flex-wrap: wrap; }
.alert-meta span { color: var(--text-muted); font-size: 0.85rem; }
.alert-actions { display: flex; gap: 0.5rem; }

.alert-description { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 2rem; }
.alert-description h2 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }

/* ─── Timeline ─────────────────────────────────────────── */
.timeline { list-style: none; position: relative; padding-left: 2rem; }
.timeline::before { content: ""; position: absolute; left: 0.5rem; top: 0; bottom: 0; width: 2px; background: var(--border); }

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}
.timeline-marker {
  position: absolute;
  left: -1.65rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg);
}
.timeline-created .timeline-marker { background: var(--info); }
.timeline-acknowledged .timeline-marker { background: var(--warning-color); }
.timeline-resolved .timeline-marker { background: var(--success); }
.timeline-escalated .timeline-marker { background: var(--fire); }
.timeline-comment .timeline-marker { background: var(--text-muted); }

.timeline-content strong { font-size: 0.85rem; text-transform: capitalize; }
.timeline-content p { margin: 0.25rem 0; font-size: 0.9rem; }
.timeline-content time { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Tables ───────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.table th, .table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table th { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; }
.table td { font-size: 0.9rem; }

/* ─── Forms ────────────────────────────────────────────── */
.form { margin-bottom: 2rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-size: 0.85rem; color: var(--text-muted); }
.form-group small { display: block; margin-top: 0.25rem; font-size: 0.75rem; color: var(--text-muted); }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

.form-inline {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

input[type="text"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { min-height: 80px; resize: vertical; }

.form-inline input, .form-inline select { width: auto; min-width: 150px; }

/* ─── Filters ──────────────────────────────────────────── */
.filters { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.filter-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.filter-btn:hover { border-color: var(--primary); color: var(--text); text-decoration: none; }
.filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ─── Page Headers ─────────────────────────────────────── */
.page-header, .dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.dashboard-section { margin-bottom: 2.5rem; }
.dashboard-section h2 { font-size: 1.1rem; margin-bottom: 1rem; }

/* ─── Login ────────────────────────────────────────────── */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
}
.login-card {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
}
.login-card h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.login-card p { color: var(--text-muted); margin-bottom: 2rem; }

/* ─── Onboarding ──────────────────────────────────────── */
.onboarding {
  max-width: 500px;
  margin: 4rem auto;
}
.onboarding h1 { margin-bottom: 0.5rem; }
.onboarding > p { color: var(--text-muted); margin-bottom: 2rem; }

/* ─── Banners ─────────────────────────────────────────── */
.error-banner {
  background: var(--fire-bg);
  color: var(--fire);
  border: 1px solid var(--fire);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.success-banner {
  background: var(--resolved-bg);
  color: var(--success);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* ─── Webhook URL ─────────────────────────────────────── */
.ingest-url {
  font-size: 0.75rem;
  background: var(--bg);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  word-break: break-all;
}

/* ─── Utils ────────────────────────────────────────────── */
.empty-state { color: var(--text-muted); padding: 2rem; text-align: center; }

dl { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; }
dt { color: var(--text-muted); font-size: 0.85rem; }
dd { font-size: 0.9rem; }

.alert-comment-form { margin-top: 2rem; }
.alert-comment-form h2 { font-size: 1rem; margin-bottom: 0.75rem; }
.alert-comment-form form { display: flex; flex-direction: column; gap: 0.75rem; }
.alert-comment-form .btn { align-self: flex-start; }

/* ─── Marketing: Hero ──────────────────────────────────── */
.hero {
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}
.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* ─── Marketing: Features ─────────────────────────────── */
.features-section {
  padding: 3rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 1rem;
}
.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.feature-card code {
  background: var(--surface);
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

/* ─── Marketing: Problem ───────────────────────────────── */
.problem-section {
  padding: 3rem 1.5rem;
}
.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.problem-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--fire);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.problem-quote {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}
.problem-explainer {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 600px;
  margin: 1.5rem auto 0;
  text-align: center;
}

/* ─── Marketing: How It Works Steps ───────────────────── */
.how-section {
  padding: 3rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}
.step {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.step-number {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.step strong { display: block; margin-bottom: 0.25rem; }
.step p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* ─── Marketing: CTA ──────────────────────────────────── */
.cta-section {
  padding: 3rem 1.5rem;
  text-align: center;
}
.cta-section h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.cta-section p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* ─── Marketing: Pricing ──────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}
.pricing-card-featured {
  border-color: var(--primary);
  position: relative;
}
.pricing-header { margin-bottom: 1.5rem; }
.pricing-header h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.pricing-price {
  font-size: 2.5rem;
  font-weight: 800;
}
.pricing-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}
.pricing-header p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }
.pricing-features {
  list-style: none;
  flex: 1;
  margin-bottom: 1.5rem;
}
.pricing-features li {
  padding: 0.4rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.pricing-cta { width: 100%; justify-content: center; }

/* ─── Marketing: Page Sections ────────────────────────── */
.page-section {
  padding: 4rem 1.5rem;
}
.content-narrow {
  max-width: 700px;
  margin: 0 auto;
}
.content-narrow h1 { font-size: 2rem; margin-bottom: 1.5rem; }
.content-narrow h2 { font-size: 1.3rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
.content-narrow h3 { font-size: 1.1rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.content-narrow p, .content-narrow li { line-height: 1.7; color: var(--text-muted); margin-bottom: 0.75rem; }
.content-narrow a { color: var(--primary); }
.content-narrow strong { color: var(--text); }
.lead { font-size: 1.15rem; margin-bottom: 2rem; }

.how-it-works {
  list-style: decimal;
  padding-left: 1.5rem;
}
.how-it-works li { margin-bottom: 0.75rem; }

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}
pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

/* ─── Marketing: Docs TOC ─────────────────────────────── */
.docs-toc { margin-bottom: 2rem; }
.docs-toc h2 { font-size: 1rem; margin-bottom: 0.5rem; margin-top: 0; }
.docs-toc ul { list-style: none; }
.docs-toc li { padding: 0.25rem 0; }

.text-muted { color: var(--text-muted); }

/* ─── Marketing: Footer ──────────────────────────────── */
.marketing-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem;
  background: var(--surface);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.footer-grid strong { display: block; margin-bottom: 0.5rem; }
.footer-grid a { display: block; color: var(--text-muted); font-size: 0.9rem; padding: 0.2rem 0; }
.footer-grid a:hover { color: var(--text); text-decoration: none; }
.footer-grid p { font-size: 0.85rem; }

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  .nav { flex-direction: column; gap: 0.5rem; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  .alert-detail-header { flex-direction: column; gap: 1rem; }
  .form-inline { flex-direction: column; }
  .form-inline input, .form-inline select { width: 100%; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .problem-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.75rem; }
}
