/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #eef2ff;
  --critical: #dc2626;
  --critical-bg: #fef2f2;
  --warning: #ea580c;
  --warning-bg: #fff7ed;
  --moderate: #ca8a04;
  --moderate-bg: #fefce8;
  --good: #16a34a;
  --good-bg: #f0fdf4;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --radius: 16px;
  --radius-sm: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Fira Code', Menlo, monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* === Header === */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
}
.header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
}
.brand-icon-sm {
  width: 28px;
  height: 28px;
  font-size: 10px;
  border-radius: 8px;
}
.brand-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}
.header-tagline {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 64px 24px 48px;
  max-width: 720px;
  margin: 0 auto;
}
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
  border: 1px solid #c7d2fe;
}
.pill-badge svg { flex-shrink: 0; }
.hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero-sub {
  color: var(--text-secondary);
  font-size: 18px;
  max-width: 460px;
  margin: 0 auto;
}

/* === Search Bar === */
.search-bar {
  display: flex;
  gap: 0;
  margin: 32px auto 0;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.search-bar input[type="text"] {
  flex: 1;
  padding: 14px 18px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-family: var(--mono);
  outline: none;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar button {
  padding: 14px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}
.search-bar button:hover { background: var(--accent-hover); }
.search-bar button:disabled { opacity: 0.6; cursor: not-allowed; }
.search-bar button svg { flex-shrink: 0; }
.honeypot { position: absolute; left: -9999px; }

/* === Trust Bullets === */
.trust-bullets {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.trust-bullets span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.trust-bullets span::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--good);
  border-radius: 50%;
  flex-shrink: 0;
}

/* === Scan Progress (Lovable-style vertical list) === */
.scan-progress {
  display: none;
  max-width: 540px;
  margin: 0 auto;
  padding: 64px 24px 48px;
}
.scan-progress.active { display: block; }
.scan-header-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.scan-url {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 36px;
}
.check-list {
  display: flex;
  flex-direction: column;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  color: var(--text-muted);
  transition: color 0.3s;
}
.check-row:last-child { border-bottom: none; }
.check-row.active { color: var(--text); }
.check-row.done { color: var(--text); }
.check-row.fail { color: var(--text); }
.check-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.check-name { font-weight: 500; }

/* Pending dot */
.dot-pending {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  opacity: 0.4;
  display: inline-block;
}

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

/* === Results === */
.results {
  display: none;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 64px;
}
.results.active { display: block; }

.results-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.results-title span { color: var(--text); font-weight: 700; }
.results-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* === Score Circle === */
.score-circle-wrap {
  text-align: center;
  padding: 40px 0;
  margin-bottom: 32px;
}
.score-circle {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
}
.score-circle svg { width: 100%; height: 100%; }
.score-ring {
  transition: stroke-dashoffset 1.2s ease-out, stroke 0.4s;
}
.score-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-number {
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
  font-family: var(--mono);
  letter-spacing: -0.03em;
}
.score-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}
.score-badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* === Industry Note (subtle, after findings) === */
.industry-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.industry-note strong { color: var(--text-secondary); font-weight: 600; }
.industry-note select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  margin-left: 4px;
  display: none;
}
.industry-note select.visible { display: inline-block; }
.industry-change {
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  margin-left: 6px;
}
.industry-change:hover { text-decoration: underline; }

/* === Category Scores (Lovable-style full-width rows) === */
.categories-section { margin-bottom: 32px; }
.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}
.category-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.category-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.category-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.category-value {
  font-size: 14px;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text-secondary);
}
.category-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.category-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* === Findings (Lovable-style rows with right-aligned severity) === */
.findings-section { margin-bottom: 24px; }
.findings-list {
  display: flex;
  flex-direction: column;
}
.finding-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.finding-row:last-child { border-bottom: none; }
.finding-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.finding-dot-critical { background: var(--critical); }
.finding-dot-warning { background: var(--warning); }
.finding-dot-moderate { background: var(--moderate); }
.finding-dot-good { background: var(--good); }
.finding-dot-info { background: var(--info); }
.finding-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.finding-severity {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.sev-critical { color: var(--critical); }
.sev-warning { color: var(--warning); }
.sev-moderate { color: var(--moderate); }
.sev-good { color: var(--good); }
.sev-info { color: var(--info); }

/* === Blur Gate === */
.blur-gate {
  margin-bottom: 32px;
}
.blurred-findings {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  opacity: 0.5;
}

/* === Email Capture (inline between blurred findings) === */
.email-capture {
  text-align: center;
  padding: 32px 24px;
  margin: 16px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  z-index: 1;
}
.email-icon {
  width: 52px;
  height: 52px;
  background: var(--accent-light);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.email-capture h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.email-capture > p {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 420px;
  margin: 0 auto 20px;
  line-height: 1.5;
}
.email-bar {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}
.email-bar input[type="email"] {
  flex: 1;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.email-bar input::placeholder { color: var(--text-muted); }
.email-bar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.email-bar button {
  padding: 14px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}
.email-bar button:hover { background: var(--accent-hover); }
.email-bar button:disabled { opacity: 0.6; cursor: not-allowed; }
.email-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 14px;
}
.email-success {
  display: none;
  color: var(--good);
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
}

/* === Footer === */
footer {
  padding: 48px 24px;
}
.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-secondary);
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); }

/* === Error === */
.error-message {
  display: none;
  text-align: center;
  color: var(--critical);
  font-size: 14px;
  margin-top: 14px;
  padding: 10px 16px;
  background: var(--critical-bg);
  border-radius: 8px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.error-message.active { display: block; }

/* === Turnstile === */
.cf-turnstile { display: none; }

/* === Responsive === */
@media (max-width: 640px) {
  .header-tagline { display: none; }
  .hero { padding: 48px 20px 36px; }
  .trust-bullets { flex-direction: column; gap: 8px; align-items: center; }
  .score-number { font-size: 44px; }
  .score-circle { width: 160px; height: 160px; }
  .email-bar { flex-direction: column; }
  .email-bar button { justify-content: center; }
  .search-bar { flex-direction: column; }
  .search-bar button { justify-content: center; }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
  .results { padding: 0 16px 48px; }
}
