/* CronTrail — core styles */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #242736;
  --border: #2e3347;
  --text: #e8eaf0;
  --muted: #7b82a0;
  --accent: #4f80ff;
  --accent-hover: #6b96ff;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

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

/* ── Layout ── */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand .dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--accent);
}

.main {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.3px;
}

.page-subtitle {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 14px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

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

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

/* ── Status badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-healthy { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-late    { background: rgba(245,158,11,0.12); color: var(--yellow); }
.badge-down    { background: rgba(239,68,68,0.12);  color: var(--red); }
.badge-new     { background: rgba(79,128,255,0.12); color: var(--accent); }

/* ── Monitor cards ── */
.monitors-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.monitor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.15s;
}
.monitor-card:hover { border-color: #3d4260; }
.monitor-card a.card-link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.monitor-info { flex: 1; min-width: 0; }
.monitor-name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.monitor-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
}
.empty-state .icon { font-size: 40px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; color: var(--text); margin: 0 0 8px; }
.empty-state p { margin: 0 0 24px; font-size: 14px; }

/* ── Form ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 7px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.15s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--accent); }

.form-group .hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 7px;
  font-size: 14px;
  margin-bottom: 20px;
}

/* ── Monitor detail ── */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 20px;
  font-weight: 700;
}

/* ── Ping URL box ── */
.ping-url-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 28px;
}
.ping-url-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.ping-url-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
  cursor: text;
  user-select: all;
}
.ping-url-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* ── Ping history table ── */
.section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin: 0 0 12px;
}

.ping-table {
  width: 100%;
  border-collapse: collapse;
}
.ping-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.ping-table td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.ping-table td:first-child { color: var(--text); }
.ping-table tr:last-child td { border-bottom: none; }

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}
.back-link:hover { color: var(--text); }

/* ── Landing ── */
.landing {
  max-width: 640px;
  margin: 80px auto 0;
  padding: 0 24px;
  text-align: center;
}
.landing-logo {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}
.landing-logo span { color: var(--accent); }
.landing-tagline {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 40px;
}
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.landing-feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: left;
}
.landing-feature .icon { font-size: 22px; margin-bottom: 10px; }
.landing-feature h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.landing-feature p { margin: 0; font-size: 13px; color: var(--muted); }

/* ── Pricing page ── */
.pricing-main { max-width: 1020px; }
.pricing-header { text-align: center; margin-bottom: 48px; }
.pricing-title { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; margin: 0 0 12px; }
.pricing-subtitle { color: var(--muted); font-size: 16px; margin: 0; line-height: 1.7; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 64px;
  align-items: start;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  position: relative;
}

.pricing-card-featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, #1a1d27 0%, #1c2036 100%);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 32px rgba(79,128,255,0.12);
  padding-top: 48px;
}

.plan-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 99px;
  white-space: nowrap;
}

.plan-name { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-bottom: 12px; }
.plan-price { margin-bottom: 8px; line-height: 1; }
.price-num { font-size: 40px; font-weight: 800; letter-spacing: -1px; color: var(--text); }
.price-period { font-size: 15px; color: var(--muted); margin-left: 2px; }
.plan-tagline { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.plan-cta { width: 100%; justify-content: center; margin-bottom: 8px; padding: 10px 16px; font-size: 14px; }
.trial-note { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 20px; }

.plan-features {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-features li { font-size: 13px; color: var(--muted); }

/* FAQ */
.pricing-faq h3 { font-size: 18px; font-weight: 700; margin: 0 0 24px; text-align: center; }
.faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.faq-item h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.faq-item p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ── Billing success ── */
.success-wrap { max-width: 460px; margin: 80px auto; text-align: center; }
.success-icon {
  width: 64px; height: 64px;
  background: rgba(34,197,94,0.12);
  border-radius: 50%;
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  color: var(--green);
}
.pending-icon { background: rgba(245,158,11,0.12); color: var(--yellow); }
.success-title { font-size: 28px; font-weight: 800; margin: 0 0 12px; letter-spacing: -0.5px; }
.success-body { color: var(--muted); font-size: 15px; margin: 0 0 32px; line-height: 1.7; }
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Plan limit banner ── */
.plan-limit-banner {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.plan-limit-banner .limit-text { color: var(--yellow); }
.plan-limit-banner .limit-link { color: var(--accent); font-weight: 600; font-size: 13px; }

/* ── Usage bar ── */
.usage-bar-bg { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.usage-bar-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.3s; }
.usage-bar-fill.warn { background: var(--yellow); }
.usage-bar-fill.danger { background: var(--red); }

@media (max-width: 820px) {
  .pricing-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto 64px; }
  .faq-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .landing-features { grid-template-columns: 1fr; }
  .monitor-card { flex-direction: column; align-items: flex-start; gap: 12px; }
  .pricing-title { font-size: 26px; }
}
