/* TrackProof — clean B2B utility aesthetic: Stripe-docs inspired. */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --ink: #0f1c2e;
  --ink-soft: #42526b;
  --muted: #6b7a90;
  --line: #e3e8f0;
  --brand: #2f5bff;
  --brand-dark: #1f43c4;
  --critical: #c81e1e;
  --critical-bg: #fdecec;
  --warning: #b45309;
  --warning-bg: #fef6e7;
  --info: #1d4ed8;
  --info-bg: #eef3ff;
  --radius: 10px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 28px;
  padding-top: 14px; padding-bottom: 14px;
}
.logo { font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo .mark { color: var(--brand); }
.site-header nav { display: flex; gap: 20px; margin-left: auto; }
.site-header nav a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; }
.site-header nav a:hover { color: var(--brand); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: 12px 22px; border-radius: 8px;
  background: var(--brand); color: #fff; text-decoration: none;
  transition: background .15s ease;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: var(--bg-soft); color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn.ghost { background: transparent; color: var(--brand); padding: 12px 8px; }
.btn.small { padding: 8px 14px; font-size: .85rem; }

/* ---------- hint bar ---------- */
.hint-bar {
  background: #fff8e6; border-bottom: 1px solid #f0dfae;
  color: #5c4a12; font-size: .92rem;
}
.hint-bar .wrap { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.hint-bar button {
  margin-left: auto; background: none; border: 1px solid #d9c58a;
  border-radius: 6px; padding: 4px 10px; cursor: pointer; color: #5c4a12; font: inherit; font-size: .85rem;
}

/* ---------- hero ---------- */
.hero { background: linear-gradient(180deg, var(--bg-soft), var(--bg)); padding: 72px 0 48px; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 16px; max-width: 16em; }
.hero .sub { font-size: 1.15rem; color: var(--ink-soft); max-width: 36em; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.privacy-note { margin-top: 18px; font-size: .88rem; color: var(--muted); }

/* ---------- tool section ---------- */
.tool-section { padding: 40px 0 56px; }
.tool-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(15,28,46,.06);
  padding: 28px;
}
.tool-card h2 { margin: 0 0 6px; font-size: 1.4rem; }
.tool-card > p { color: var(--ink-soft); margin: 0 0 20px; }

#payload {
  width: 100%; min-height: 220px; resize: vertical;
  font-family: var(--mono); font-size: .82rem; line-height: 1.5;
  border: 1px solid var(--line); border-radius: 8px; padding: 14px;
  background: #0f1c2e; color: #dbe7f5;
}
#payload:focus { outline: 2px solid var(--brand); outline-offset: 2px; }

.drop-zone {
  margin-top: 12px; border: 2px dashed var(--line); border-radius: 8px;
  padding: 14px; text-align: center; color: var(--muted); font-size: .9rem;
  cursor: pointer; transition: border-color .15s;
}
.drop-zone.drag, .drop-zone:hover { border-color: var(--brand); color: var(--brand); }
.drop-zone:focus { outline: 2px solid var(--brand); }

.tool-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 8px; }
.status-line { min-height: 1.5em; font-size: .9rem; color: var(--muted); margin: 4px 0 0; }
.status-line.error { color: var(--critical); }

/* ---------- results ---------- */
.results { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 24px; }
.results-empty { color: var(--muted); text-align: center; padding: 40px 10px; border: 1px dashed var(--line); border-radius: 8px; }

.score-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 12px; }
.score-circle {
  width: 110px; height: 110px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-soft); border: 1px solid var(--line); flex-shrink: 0;
}
.score-num { font-size: 2rem; font-weight: 800; line-height: 1; }
.score-grade { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.score-meter { flex: 1; min-width: 200px; }
.score-bar-track { height: 12px; background: var(--bg-soft); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.score-bar-fill { height: 100%; width: 0; transition: width .6s ease; border-radius: 6px; }
.score-bar-fill.excellent { background: #16a34a; }
.score-bar-fill.good { background: #65a30d; }
.score-bar-fill.fair { background: #d97706; }
.score-bar-fill.poor { background: #dc2626; }
.score-bar-fill.broken { background: #7f1d1d; }
.summary-line { color: var(--ink-soft); font-size: .95rem; margin: 8px 0 0; }

.finding {
  border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px;
  padding: 16px 18px; margin: 12px 0; background: #fff;
}
.finding.critical { border-left-color: var(--critical); background: var(--critical-bg); }
.finding.warning { border-left-color: var(--warning); background: var(--warning-bg); }
.finding.info { border-left-color: var(--info); background: var(--info-bg); }
.finding h3 { margin: 6px 0 8px; font-size: 1.02rem; }
.finding p { margin: 6px 0; font-size: .93rem; color: var(--ink-soft); }
.finding .fix { color: var(--ink); }
.finding .meta { font-size: .78rem; color: var(--muted); margin-top: 10px; }
.sev {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 999px; margin-right: 10px; vertical-align: middle;
}
.sev-critical { background: var(--critical); color: #fff; }
.sev-warning { background: var(--warning); color: #fff; }
.sev-info { background: var(--info); color: #fff; }
.where { font-size: .78rem; color: var(--muted); font-family: var(--mono); }

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--bg-soft); }
.section h2 { font-size: 1.7rem; letter-spacing: -0.02em; margin: 0 0 8px; }
.section .lede { color: var(--ink-soft); max-width: 44em; margin: 0 0 28px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step .num {
  display: inline-flex; width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700;
  align-items: center; justify-content: center; margin-bottom: 12px;
}
.step h3 { margin: 0 0 8px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--ink-soft); font-size: .93rem; }

.rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.rule { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.rule h3 { margin: 0 0 6px; font-size: .98rem; }
.rule p { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.rule .tag { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.tag.crit { color: var(--critical); } .tag.warn { color: var(--warning); }

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.price-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--brand); box-shadow: 0 8px 32px rgba(47,91,255,.12); }
.price-card h3 { margin: 0 0 4px; font-size: 1.1rem; }
.price { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; margin: 12px 0 4px; }
.price span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.price-card ul { list-style: none; padding: 0; margin: 16px 0 24px; flex: 1; }
.price-card li { padding: 6px 0 6px 26px; position: relative; font-size: .93rem; color: var(--ink-soft); }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.price-card .fine { font-size: .8rem; color: var(--muted); margin-top: 12px; }

.faq details { background: #fff; border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; padding: 16px 20px; }
.faq summary { font-weight: 600; cursor: pointer; font-size: 1rem; }
.faq summary:focus { outline: 2px solid var(--brand); outline-offset: 2px; }
.faq details p { color: var(--ink-soft); font-size: .93rem; margin: 10px 0 0; }

/* email capture */
.capture { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 40px; text-align: center; }
.capture h2 { color: #fff; margin: 0 0 8px; }
.capture p { color: #b8c4d8; margin: 0 0 22px; }
.capture form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.capture input[type="email"] {
  font: inherit; padding: 12px 16px; border-radius: 8px; border: 1px solid #2a3b57;
  background: #16263f; color: #fff; min-width: 280px;
}
.capture input[type="email"]::placeholder { color: #7c8daa; }
.form-msg { margin-top: 14px; font-size: .92rem; min-height: 1.5em; }
.form-msg.error { color: #fca5a5; }
.form-msg.success { color: #86efac; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0; color: var(--muted); font-size: .88rem; }
.site-footer .wrap { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.site-footer .disclaimer { flex-basis: 100%; }

/* ---------- print ---------- */
@media print {
  .site-header, .hint-bar, .hero, .tool-actions, .drop-zone, #btnCopy,
  .capture, .site-footer, .section.pricing, .section.faq, .steps-section { display: none !important; }
  .tool-card { box-shadow: none; }
  #payload { background: #fff; color: #000; }
  .finding { break-inside: avoid; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .steps, .rules-grid, .pricing-grid { grid-template-columns: 1fr; }
  .site-header nav { display: none; }
  .hero { padding: 48px 0 32px; }
  .tool-card { padding: 20px; }
  .capture { padding: 28px 20px; }
}
