/* === PingPage Main Stylesheet === */
:root {
  --bg: #ffffff;
  --bg-secondary: #f8f9fb;
  --bg-card: #ffffff;
  --border: #e2e5ea;
  --text: #1a1d23;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff4ff;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.08);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, monospace;
}

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

html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; }

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-mono { font-family: var(--font-mono); font-size: 0.8rem; }

/* === Nav === */
.nav { background: var(--bg); border-bottom: 1px solid var(--border); padding: 0 0; position: sticky; top: 0; z-index: 100; }
.nav-dashboard { background: var(--text); border-bottom: none; }
.nav-dashboard .nav-brand { color: #fff; }
.nav-dashboard .nav-links a { color: #cbd5e1; }
.nav-dashboard .nav-email { color: #94a3b8; font-size: 0.85rem; }

.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav-brand { font-weight: 700; font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-dot { width: 10px; height: 10px; background: var(--success); border-radius: 50%; display: inline-block; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--text-secondary); font-size: 0.9rem; text-decoration: none; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 18px; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 0.9rem; border: none; cursor: pointer; text-decoration: none;
  transition: all 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-xs { padding: 3px 8px; font-size: 0.75rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--text-secondary); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text); background: var(--bg-secondary); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }

/* === Hero === */
.hero { text-align: center; padding: 80px 24px 40px; }
.hero h1 { font-size: 3.2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 20px; }
.text-gradient { background: linear-gradient(135deg, var(--primary), #7c3aed); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: 1.2rem; color: var(--text-secondary); max-width: 500px; margin: 0 auto 32px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-bottom: 16px; }
.hero-note { font-size: 0.8rem; color: var(--text-muted); }

/* === Demo preview === */
.demo-preview { padding: 0 24px 80px; }
.demo-box { max-width: 650px; margin: 0 auto; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-lg); }
.demo-header { border-bottom: 1px solid var(--border); }
.demo-status-banner { padding: 14px 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.demo-up { background: #f0fdf4; color: #15803d; }
.demo-dot { width: 10px; height: 10px; background: var(--success); border-radius: 50%; }
.demo-components { padding: 16px 20px; }
.demo-component { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.demo-component:last-child { border-bottom: none; }
.demo-comp-name { font-weight: 600; width: 80px; font-size: 0.9rem; }
.demo-uptime-bars { display: flex; gap: 1.5px; flex: 1; }
.demo-uptime-bars .bar { width: 4px; height: 24px; border-radius: 2px; }
.demo-uptime-bars .bar.good { background: var(--success); }
.demo-uptime-bars .bar.degraded { background: var(--warning); }
.demo-uptime-bars .bar.down { background: var(--danger); }
.demo-pct { font-size: 0.8rem; color: var(--text-secondary); width: 55px; text-align: right; font-family: var(--font-mono); }

/* === Features === */
.features { padding: 80px 24px; background: var(--bg-secondary); }
.features h2 { text-align: center; font-size: 2rem; font-weight: 700; margin-bottom: 48px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 900px; margin: 0 auto; }
.feature-card { background: var(--bg-card); padding: 28px; border-radius: var(--radius); border: 1px solid var(--border); }
.feature-icon { font-size: 1.5rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* === Pricing === */
.pricing { padding: 80px 24px; }
.pricing h2 { text-align: center; font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.pricing-sub { text-align: center; color: var(--text-secondary); margin-bottom: 48px; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 850px; margin: 0 auto; }
.pricing-grid-sm { grid-template-columns: repeat(2, 1fr); max-width: 550px; }
.price-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 12px; padding: 32px; position: relative; }
.price-popular { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.price-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 3px 14px; border-radius: 20px; }
.price-tier { font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; }
.price-amount { font-size: 2.4rem; font-weight: 800; margin-bottom: 20px; }
.price-amount span { font-size: 1rem; font-weight: 500; color: var(--text-secondary); }
.price-features { list-style: none; margin-bottom: 24px; }
.price-features li { padding: 6px 0; color: var(--text-secondary); font-size: 0.9rem; border-bottom: 1px solid #f3f4f6; }
.price-features li:last-child { border-bottom: none; }

/* === Footer === */
.footer { padding: 40px 24px; border-top: 1px solid var(--border); }
.footer-inner { text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* === Auth === */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 56px); background: var(--bg-secondary); }
.auth-card { background: var(--bg-card); padding: 40px; border-radius: 12px; box-shadow: var(--shadow-md); width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-secondary); margin-bottom: 24px; }
.auth-footer { text-align: center; color: var(--text-secondary); font-size: 0.85rem; margin-top: 20px; }

/* === Forms === */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 5px; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; font-family: var(--font); background: var(--bg); color: var(--text); transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-group textarea { resize: vertical; }
.input-prefix { display: flex; align-items: center; }
.input-prefix .prefix { padding: 9px 8px 9px 12px; background: var(--bg-secondary); border: 1.5px solid var(--border); border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; }
.input-prefix input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.form-inline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-full { grid-column: 1 / -1; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: flex-end; }

.form-row { display: flex; gap: 8px; align-items: center; }
.input-sm { padding: 6px 10px !important; font-size: 0.85rem !important; }

/* === Alerts === */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 16px; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fed7aa; }

/* === Dashboard Layout === */
.dashboard-layout { display: flex; min-height: calc(100vh - 56px); }
.dashboard-sidebar { width: 220px; background: var(--bg-secondary); border-right: 1px solid var(--border); padding: 24px 0; flex-shrink: 0; }
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-link { padding: 8px 24px; color: var(--text-secondary); font-size: 0.9rem; text-decoration: none; }
.sidebar-link:hover { color: var(--text); background: rgba(0,0,0,.03); text-decoration: none; }
.sidebar-divider { border: none; border-top: 1px solid var(--border); margin: 12px 24px; }

.dashboard-main { flex: 1; padding: 32px 40px; max-width: 900px; }
.dashboard-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.dashboard-header h1 { font-size: 1.5rem; font-weight: 700; }

/* === Cards === */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.card-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }

/* === Badges === */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; background: var(--bg-secondary); color: var(--text-secondary); }
.badge-plan { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #f0fdf4; color: #15803d; }
.badge-warning { background: #fffbeb; color: #92400e; }
.badge-auto { background: #f3f4f6; color: #6b7280; }
.badge-investigating { background: #fffbeb; color: #92400e; }
.badge-identified { background: #fff1f2; color: #be123c; }
.badge-monitoring { background: #eff6ff; color: #1d4ed8; }
.badge-resolved { background: #f0fdf4; color: #15803d; }

/* === Stats === */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-value { font-size: 2rem; font-weight: 800; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.stat-up .stat-value { color: var(--success); }
.stat-down .stat-value { color: var(--danger); }

/* === Monitor list === */
.monitor-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 32px; }
.monitor-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-up { background: var(--success); }
.status-down { background: var(--danger); }
.status-unknown { background: var(--text-muted); }
.status-degraded { background: var(--warning); }
.monitor-name { font-weight: 600; width: 120px; }
.monitor-url { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitor-response { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); width: 60px; text-align: right; }

/* === Table === */
.table-wrapper { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; padding: 10px 12px; font-weight: 600; font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 2px solid var(--border); }
.table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; }
.table tr:hover { background: #fafbfc; }
.row-muted { opacity: 0.5; }
.actions-cell { white-space: nowrap; }

/* === Page list === */
.page-list { display: flex; flex-direction: column; gap: 8px; }
.page-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.page-link { font-weight: 600; }
.page-slug { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }

/* === Empty state === */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state h2 { color: var(--text); margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }

.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }

/* === Incidents === */
.incident-card { margin-bottom: 16px; }
.incident-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.incident-header h3 { flex: 1; font-size: 1rem; }
.impact-dot { width: 10px; height: 10px; border-radius: 50%; }
.impact-none { background: var(--text-muted); }
.impact-minor { background: var(--warning); }
.impact-major { background: #f97316; }
.impact-critical { background: var(--danger); }

.incident-timeline { margin-top: 12px; padding-left: 16px; border-left: 2px solid var(--border); }
.timeline-entry { padding: 6px 0; font-size: 0.85rem; display: flex; gap: 8px; }
.timeline-status { font-weight: 600; min-width: 90px; text-transform: capitalize; }
.timeline-message { flex: 1; color: var(--text-secondary); }
.timeline-time { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }

.incident-update-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f3f4f6; }

/* === Responsive === */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-layout { flex-direction: column; }
  .dashboard-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 12px 0; }
  .sidebar-nav { flex-direction: row; overflow-x: auto; padding: 0 16px; }
  .sidebar-link { white-space: nowrap; padding: 8px 12px; }
  .sidebar-divider { display: none; }
  .dashboard-main { padding: 20px 16px; }
  .form-inline-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 12px; }
  .hero-actions { flex-direction: column; align-items: center; }
}
