/* ============================================================
   InboxPreflight — Design System
   Zero-build, vanilla CSS. Dark, technical, trustworthy.
   ============================================================ */

:root {
  --bg: #0b0e14;
  --bg-raised: #121722;
  --bg-card: #161c2a;
  --border: #232b3d;
  --border-strong: #33405c;
  --text: #e8ecf4;
  --text-muted: #9aa5bb;
  --text-dim: #7d88a3; /* ≥4.5:1 on --bg for WCAG AA at small sizes */
  --accent: #4f8cff;
  --accent-hover: #6ea1ff;
  --accent-glow: rgba(79, 140, 255, 0.25);
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.12);
  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, 0.12);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.12);
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; }

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

img, svg { display: block; max-width: 100%; }

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.05rem; color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand svg { width: 28px; height: 28px; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-sm { padding: 8px 16px; font-size: 0.88rem; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 110px 0 90px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -40% -20% auto;
  height: 520px;
  background: radial-gradient(ellipse at 50% 0%, var(--accent-glow), transparent 65%);
  pointer-events: none;
}
.hero > .container { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 26px;
  background: var(--bg-raised);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 20px;
}
h1 .accent { color: var(--accent); }
.hero p.lede {
  font-size: 1.18rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 36px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 0.85rem; color: var(--text-dim); }

/* ---------- Sections ---------- */
section { padding: 80px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-head h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  letter-spacing: -0.02em;
  font-weight: 750;
  margin-bottom: 14px;
}
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Feature grid ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.card h3 { font-size: 1.1rem; font-weight: 650; margin: 16px 0 8px; letter-spacing: -0.01em; }
.card p { color: var(--text-muted); font-size: 0.95rem; }
.card .icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--accent-glow);
  color: var(--accent);
}
.card .icon svg { width: 22px; height: 22px; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; }
.step { display: flex; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.step:last-child { border-bottom: none; }
.step-num {
  counter-increment: step;
  flex: 0 0 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  font-family: var(--mono); font-weight: 700; color: var(--accent);
  background: var(--bg-raised);
}
.step-num::before { content: counter(step, decimal-leading-zero); }
.step h3 { font-size: 1.05rem; margin-bottom: 4px; }
.step p { color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.price-card { display: flex; flex-direction: column; }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); position: relative; }
.plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
}
.plan-name { font-size: 0.95rem; font-weight: 650; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.plan-price { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; margin: 10px 0 2px; }
.plan-price span { font-size: 1rem; font-weight: 500; color: var(--text-dim); }
.plan-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.plan-features { list-style: none; margin: 0 0 26px; flex: 1; }
.plan-features li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 7px 0; font-size: 0.92rem; color: var(--text-muted);
}
.plan-features li::before {
  content: "✓"; color: var(--green); font-weight: 700; flex: 0 0 auto;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-raised));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  text-align: center;
}
.cta-band h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.02em; margin-bottom: 12px; }
.cta-band p { color: var(--text-muted); margin-bottom: 28px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 44px 0;
  color: var(--text-dim);
  font-size: 0.88rem;
}
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; list-style: none; }
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--text); }

/* ---------- App shell ---------- */
.app-main { padding: 44px 0 90px; }
.app-title { font-size: 1.9rem; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 6px; }
.app-sub { color: var(--text-muted); margin-bottom: 34px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 30px; }
.tab {
  padding: 11px 18px;
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600; font-size: 0.95rem; font-family: inherit;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel[hidden] { display: none; }

.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
label.field-label { display: block; font-size: 0.88rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
input[type="text"], textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: var(--mono);
}
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { min-height: 220px; resize: vertical; line-height: 1.5; }
.input-grow { flex: 1; min-width: 260px; }
.hint { font-size: 0.82rem; color: var(--text-dim); margin-top: 8px; }

/* ---------- Results ---------- */
.results { margin-top: 30px; display: grid; gap: 14px; }
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.result-title { font-weight: 650; font-size: 0.98rem; display: flex; align-items: center; gap: 10px; }
.result-detail { margin-top: 10px; color: var(--text-muted); font-size: 0.9rem; }
.result-detail code, .record-value {
  font-family: var(--mono); font-size: 0.82rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  word-break: break-all;
  color: var(--text);
}
.record-value { display: block; padding: 10px 12px; margin-top: 8px; white-space: pre-wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700;
  padding: 4px 11px; border-radius: 999px;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.badge-pass { background: var(--green-bg); color: var(--green); }
.badge-warn { background: var(--amber-bg); color: var(--amber); }
.badge-fail { background: var(--red-bg); color: var(--red); }
.badge-info { background: var(--accent-glow); color: var(--accent); }

.score-ring-wrap { display: flex; align-items: center; gap: 22px; padding: 22px; }
.score-num { font-size: 2.6rem; font-weight: 800; font-family: var(--mono); line-height: 1; }
.score-label { color: var(--text-muted); font-size: 0.92rem; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-banner {
  background: var(--red-bg);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: var(--red);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.92rem;
  margin-top: 20px;
}

/* ---------- Utility ---------- */
.mt-2 { margin-top: 16px; }
.text-center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); overflow: hidden;
}

/* ---------- 404 ---------- */
.error-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.error-code { font-family: var(--mono); font-size: 5rem; font-weight: 800; color: var(--accent); line-height: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .pricing-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero { padding: 70px 0 60px; }
  section { padding: 56px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
