:root {
  --bg: #0b0e16;
  --surface: #141927;
  --surface-2: #1b2233;
  --border: #283042;
  --text: #e9ecf5;
  --muted: #9aa3ba;
  --brand: #8b7cff;
  --brand-2: #b3a6ff;
  --brand-ink: #120e2c;
  --danger: #ff5c5c;
  --critical: #ff5c5c;
  --serious: #ff9f43;
  --moderate: #ffd23f;
  --minor: #8aa0b6;
  --ok: #38d39f;
  --radius: 12px;
  --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);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin: 0 0 0.75rem; }
a { color: var(--brand-2); }

/* --- A11y helpers --- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--brand); color: var(--brand-ink); padding: 10px 16px;
  border-radius: 8px; font-weight: 700; text-decoration: none; transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 22, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 800; font-size: 1.3rem; text-decoration: none; color: var(--text); }
.brand-mark { color: var(--brand); }
.brand-tld { color: var(--muted); }
nav[aria-label="Primary"] { display: flex; gap: 20px; align-items: center; }
nav[aria-label="Primary"] a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
nav[aria-label="Primary"] a:hover { color: var(--text); }
.nav-cta { background: var(--brand); color: var(--brand-ink) !important; padding: 8px 16px; border-radius: 8px; }

/* --- Hero / scanner --- */
.hero { padding: 72px 0 56px; text-align: center; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.78rem;
  font-weight: 700; color: var(--brand-2); margin: 0 0 1rem;
}
.lede { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--muted); max-width: 660px; margin: 0 auto 2rem; }
.lede strong { color: var(--text); }

.scan-form {
  display: flex; gap: 10px; max-width: 560px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border); padding: 8px; border-radius: 14px;
}
.scan-form input {
  flex: 1; background: transparent; border: 0; color: var(--text);
  font-size: 1.05rem; padding: 12px 14px; min-width: 0;
}
.scan-form input::placeholder { color: #6b7790; }
.scan-form input:focus { outline: none; }
.scan-form:focus-within { border-color: var(--brand); }
#scan-btn, #lead-submit, .plan-cta, .btn {
  background: var(--brand); color: var(--brand-ink); border: 0; font-weight: 700; font-size: 1rem;
  padding: 12px 22px; border-radius: 10px; cursor: pointer; white-space: nowrap;
}
#scan-btn:hover, .plan-cta:hover, #lead-submit:hover, .btn:hover { filter: brightness(1.08); }
#scan-btn:disabled, .btn:disabled { opacity: 0.6; cursor: progress; }
.scan-hint { color: var(--muted); font-size: 0.9rem; margin: 0.9rem auto 0; max-width: 520px; }
.scan-options { margin-top: 0.8rem; display: flex; justify-content: center; }
.pro-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.pro-toggle input { width: auto; accent-color: var(--brand); cursor: pointer; }
.pro-pill { background: rgba(139,124,255,0.18); color: var(--brand-2); font-size: 0.7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; }

/* --- Per-page breakdown (multi-page crawl) --- */
.page-score { display: inline-block; min-width: 30px; text-align: center; font-weight: 800; padding: 2px 8px; border-radius: 6px; font-size: 0.85rem; }
.page-score.good { background: rgba(56,211,159,0.16); color: var(--ok); }
.page-score.mid { background: rgba(255,159,67,0.16); color: var(--serious); }
.page-score.bad { background: rgba(255,92,92,0.16); color: var(--critical); }
.cookie-table td.path { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cookie-table td.path a { color: var(--brand-2); text-decoration: none; }
.scan-status { margin-top: 1.5rem; color: var(--muted); min-height: 1.2em; font-weight: 600; }
.scan-status.error { color: var(--danger); }

/* --- Results --- */
.results { text-align: left; max-width: 840px; margin: 2.5rem auto 0; }
.score-row {
  display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
}
.score-ring {
  --pct: 0; width: 104px; height: 104px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--surface-2) 0);
}
.score-ring::before { content: ""; position: absolute; inset: 10px; background: var(--surface); border-radius: 50%; }
.score-ring span { position: relative; font-size: 1.8rem; font-weight: 800; }
.score-meta h3 { margin: 0 0 4px; }
.score-meta p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.score-meta .scanned-url { color: var(--text); font-weight: 600; word-break: break-all; }
.banner-flag { display: inline-block; margin-top: 6px; font-size: 0.85rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.banner-flag.yes { background: rgba(56,211,159,0.15); color: var(--ok); }
.banner-flag.no { background: rgba(255,92,92,0.16); color: var(--critical); }

.tallies { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.tally { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; flex: 1; min-width: 110px; }
.tally .n { font-size: 1.6rem; font-weight: 800; display: block; }
.tally .l { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
.tally.critical .n { color: var(--critical); }
.tally.serious .n { color: var(--serious); }
.tally.moderate .n { color: var(--moderate); }
.tally.trackers .n { color: var(--brand-2); }
.tally.cookies .n { color: var(--text); }

.section-title { font-size: 1.15rem; margin: 26px 0 12px; }

.violation {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--border); border-radius: 10px; padding: 16px 18px; margin-bottom: 12px;
}
.violation.critical { border-left-color: var(--critical); }
.violation.serious { border-left-color: var(--serious); }
.violation.moderate { border-left-color: var(--moderate); }
.violation.minor { border-left-color: var(--minor); }
.violation-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.violation-head h4 { margin: 0; font-size: 1.05rem; }
.badge { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.critical { background: rgba(255,92,92,0.18); color: var(--critical); }
.badge.serious { background: rgba(255,159,67,0.18); color: var(--serious); }
.badge.moderate { background: rgba(255,210,63,0.16); color: var(--moderate); }
.badge.minor { background: rgba(138,160,182,0.16); color: var(--minor); }
.violation p.desc { color: var(--muted); margin: 8px 0; font-size: 0.95rem; }
.violation .meta { font-size: 0.82rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.cat-tag { color: var(--brand-2); font-weight: 700; }
.law-tag { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); }
.evidence { font-family: var(--mono); font-size: 0.8rem; color: #c7d2e0; word-break: break-all; }

/* --- Cookie table --- */
.cookie-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cookie-table th, .cookie-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.cookie-table th { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.05em; }
.cookie-table tr:last-child td { border-bottom: 0; }
.cookie-table code { font-family: var(--mono); color: var(--brand-2); }
.pill { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pill.essential { background: rgba(56,211,159,0.14); color: var(--ok); }
.pill.nonessential { background: rgba(255,159,67,0.16); color: var(--serious); }
.table-wrap { overflow-x: auto; }

.results-cta {
  text-align: center; background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-top: 18px;
}
.results-cta h3 { margin: 0 0 8px; }
.results-cta p { color: var(--muted); margin: 0 0 18px; }
.results-cta button { background: var(--brand); color: var(--brand-ink); border: 0; font-weight: 700; font-size: 1.05rem; padding: 14px 28px; border-radius: 10px; cursor: pointer; }
.clean-state { text-align: center; padding: 16px; color: var(--ok); font-weight: 600; }

/* --- Sections --- */
.why, .pricing, .faq, .tools { padding: 64px 0; border-top: 1px solid var(--border); }
.section-lede { color: var(--muted); max-width: 680px; margin: 0 0 2.5rem; font-size: 1.05rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card h3 { margin: 0 0 10px; font-size: 1.2rem; }
.card p { margin: 0; color: var(--muted); }
.card strong { color: var(--text); }

/* --- Free tools grid --- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tool-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-decoration: none; color: var(--text); transition: border-color 0.15s ease, transform 0.15s ease; }
.tool-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.tool-card .tool-kicker { color: var(--brand-2); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.tool-card h3 { margin: 8px 0 6px; font-size: 1.15rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.tool-card .tool-go { color: var(--brand-2); font-weight: 700; margin-top: 10px; display: inline-block; }

/* --- Pricing --- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; align-items: start; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; position: relative; }
.plan.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan-badge { position: absolute; top: -12px; left: 26px; background: var(--brand); color: var(--brand-ink); font-size: 0.75rem; font-weight: 800; padding: 4px 12px; border-radius: 999px; margin: 0; text-transform: uppercase; letter-spacing: 0.05em; }
.plan h3 { margin: 0 0 6px; }
.price { font-size: 1rem; color: var(--muted); margin: 0 0 16px; }
.price span { font-size: 2.4rem; font-weight: 800; color: var(--text); }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; }
.plan li { padding: 7px 0 7px 26px; position: relative; color: var(--muted); font-size: 0.95rem; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.plan-cta { width: 100%; }
.plan:not(.featured) .plan-cta { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.pricing-note { color: var(--muted); font-size: 0.9rem; margin-top: 22px; text-align: center; }

/* --- FAQ --- */
.faq dl { max-width: 760px; }
.faq dt { font-weight: 700; font-size: 1.1rem; margin-top: 24px; }
.faq dd { margin: 8px 0 0; color: var(--muted); }
.faq dd strong { color: var(--text); }

/* --- Dialog --- */
dialog { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 16px; padding: 28px; max-width: 440px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(4, 6, 12, 0.7); backdrop-filter: blur(3px); }
dialog h2 { margin: 0 0 6px; }
.lead-sub { color: var(--muted); margin: 0 0 18px; font-size: 0.95rem; }
dialog label { display: block; font-weight: 600; font-size: 0.9rem; margin: 14px 0 6px; }
dialog input { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 11px 13px; border-radius: 9px; font-size: 1rem; }
dialog input:focus { outline: none; border-color: var(--brand); }
.lead-status { min-height: 1.2em; margin-top: 12px; font-weight: 600; font-size: 0.9rem; }
.lead-status.error { color: var(--danger); }
.lead-status.ok { color: var(--ok); }
.lead-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); padding: 11px 18px; border-radius: 9px; font-weight: 600; cursor: pointer; }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--muted); }
.site-footer p { margin: 0 0 8px; }
.site-footer .fine { font-size: 0.85rem; max-width: 680px; }
.site-footer a { color: var(--muted); margin-right: 16px; font-size: 0.9rem; }

/* --- Tool pages (generator / checker) --- */
.tool-page { padding: 48px 0 64px; }
.tool-page .lede { text-align: left; margin-left: 0; }
.tool-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 11px 13px; border-radius: 9px; font-size: 0.98rem; font-family: var(--font);
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-top: 6px; }
.checks label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 0.92rem; color: var(--muted); }
.checks input { width: auto; }
.output {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; max-height: 640px; overflow-y: auto; position: sticky; top: 84px;
}
.output h2, .output h3 { margin-top: 1.2em; }
.output h2:first-child { margin-top: 0; }
.output p, .output li { color: var(--muted); font-size: 0.92rem; }
.output .placeholder { color: var(--muted); text-align: center; padding: 40px 0; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 8px 16px; border-radius: 999px; font-weight: 600; cursor: pointer; font-size: 0.9rem; }
.tab.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

@media (max-width: 760px) { .tool-layout { grid-template-columns: 1fr; } .output { position: static; } }
@media (max-width: 520px) {
  .scan-form { flex-direction: column; }
  #scan-btn { width: 100%; }
  nav[aria-label="Primary"] a:not(.nav-cta) { display: none; }
  .checks { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
