/* ============================================
   EGIDA.AI — Design System & Shared Styles
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a26;
  --surface3: #222233;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.12);
  --accent: #7fff6e;
  --accent-dim: rgba(127,255,110,0.15);
  --accent-glow: rgba(127,255,110,0.25);
  --red: #ff6b6b;
  --blue: #6eb5ff;
  --gold: #ffd166;
  --purple: #a29bfe;
  --text: #e8e8f0;
  --text-secondary: #b0b0c0;
  --muted: #6b6b80;
  --font-heading: 'Syne', sans-serif;
  --font-body: 'DM Mono', monospace;
  --font-accent: 'Instrument Serif', serif;
  --max-width: 1100px;
  --nav-height: 64px;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Grid noise background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(127,255,110,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127,255,110,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; color: var(--text); line-height: 1.15; }
h1 { font-size: clamp(36px, 5vw, 60px); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(26px, 3.5vw, 40px); letter-spacing: -0.02em; }
h3 { font-size: clamp(18px, 2vw, 22px); font-weight: 600; }
h4 { font-size: 15px; font-weight: 600; }
p { color: var(--text-secondary); line-height: 1.75; margin-bottom: 16px; }
a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }
strong { color: var(--text); font-weight: 600; }
em.accent-text { font-family: var(--font-accent); font-style: italic; color: var(--accent); }

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.section { padding: 96px 0; }
.section-border { border-bottom: 1px solid var(--border); }

.section-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.section-header { margin-bottom: 48px; }
.section-header h2 { margin-bottom: 16px; }
.section-header p { max-width: 600px; font-size: 15px; }

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background 0.3s;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  font-size: 13px;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); opacity: 1; }

.nav-cta {
  background: var(--accent);
  color: #0a0a0f !important;
  padding: 8px 18px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-block;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
  opacity: 1;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 28px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
  color: #0a0a0f;
  opacity: 1;
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface3);
  transform: translateY(-1px);
  opacity: 1;
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 10px 24px;
}

.btn-ghost:hover {
  background: var(--accent-dim);
  opacity: 1;
}

.btn-large { padding: 16px 36px; font-size: 16px; }

/* --- Hero --- */
.hero {
  padding: 140px 0 96px;
  text-align: center;
  position: relative;
}

.hero h1 { margin-bottom: 20px; }

.hero h1 .accent-word {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* Scan form */
.scan-form {
  max-width: 520px;
  margin: 0 auto 16px;
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 4px;
  transition: border-color 0.3s;
}

.scan-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.scan-form input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px 16px;
  outline: none;
}

.scan-form input::placeholder { color: var(--muted); }

.scan-form button {
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  padding: 12px 24px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
}

.scan-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.scan-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}

/* --- Stats Bar --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.stat-item {
  background: var(--surface);
  padding: 28px 20px;
  text-align: center;
}

.stat-num {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.stat-source {
  font-size: 9px;
  color: rgba(255,255,255,0.15);
  margin-top: 6px;
}

/* --- Cards Grid --- */
.cards-grid {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.cards-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cards-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cards-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  padding: 32px 28px;
  transition: background 0.2s;
}

.card:hover { background: var(--surface2); }

.card-icon {
  font-size: 28px;
  margin-bottom: 16px;
  display: block;
}

.card h3 { margin-bottom: 10px; }
.card p { font-size: 13px; margin: 0; }

/* --- Product Cards (Pricing) --- */
.product-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.product-card {
  background: var(--surface);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  transition: background 0.2s;
  position: relative;
}

.product-card:hover { background: var(--surface2); }

.product-card.recommended {
  border-top: 2px solid var(--accent);
}

.product-card.recommended::before {
  content: 'Recommended';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent);
  color: #0a0a0f;
  font-size: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 2px 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.product-tier {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.product-name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.product-price {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.product-period {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}

.product-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  flex: 1;
}

.product-features {
  list-style: none;
  margin-bottom: 24px;
}

.product-features li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-features li:last-child { border: none; }

.product-features li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}

.product-card .btn { width: 100%; text-align: center; margin-top: auto; }

/* --- Feature Comparison Table --- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 48px;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.comparison-table thead th {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-strong);
}

.comparison-table tbody td { color: var(--text-secondary); }
.comparison-table tbody td:first-child { color: var(--text); font-weight: 500; }

.comparison-table .check { color: var(--accent); font-weight: 600; }
.comparison-table .dash { color: var(--muted); }

/* --- Badge Preview --- */
.badge-preview-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.badge-demo {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.badge-widget {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #0d0d14;
  border: 1px solid rgba(127,255,110,0.2);
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--accent);
}

.badge-widget .badge-shield {
  font-size: 18px;
}

.badge-widget .badge-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.badge-widget .badge-text span:first-child {
  font-weight: 500;
  letter-spacing: 0.03em;
}

.badge-widget .badge-text span:last-child {
  font-size: 10px;
  color: var(--muted);
}

.badge-code {
  position: relative;
}

.badge-code pre {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  overflow-x: auto;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-body);
  padding: 4px 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.copy-btn:hover { color: var(--accent); border-color: var(--accent-dim); }
.copy-btn.copied { color: var(--accent); }

/* --- Steps / How It Works --- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  counter-reset: step;
}

.step {
  background: var(--surface);
  padding: 32px 24px;
  counter-increment: step;
  position: relative;
}

.step::before {
  content: '0' counter(step);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}

.step h4 { margin-bottom: 8px; }
.step p { font-size: 13px; margin: 0; }

/* --- FAQ Accordion --- */
.faq-list { max-width: 720px; }

.faq-category {
  margin-bottom: 48px;
}

.faq-category-title {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  text-align: left;
  padding: 18px 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: color 0.2s;
}

.faq-question:hover { color: var(--accent); }

.faq-question .faq-icon {
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.faq-item.active .faq-icon { transform: rotate(45deg); color: var(--accent); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer-inner {
  padding: 0 0 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

/* --- Insight Box --- */
.insight {
  background: rgba(127,255,110,0.04);
  border-left: 3px solid var(--accent);
  padding: 24px 28px;
  margin: 32px 0;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 16px;
  color: #d0d0e0;
  line-height: 1.6;
}

/* --- Value List --- */
.value-list { list-style: none; }

.value-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  line-height: 1.6;
}

.value-list li:last-child { border: none; }
.value-list li::before { content: '✦'; color: var(--accent); flex-shrink: 0; margin-top: 2px; }

/* --- Moat / Feature Items --- */
.feature-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 20px;
  align-items: start;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.feature-row:last-child { border: none; }

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border: 1px solid rgba(127,255,110,0.15);
  border-radius: 8px;
  font-size: 22px;
}

.feature-row h4 { margin-bottom: 6px; }
.feature-row p { margin: 0; font-size: 14px; }

/* --- Footer --- */
.footer {
  padding: 64px 0 32px;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-brand .logo-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.footer-tagline {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  max-width: 280px;
}

.footer-column h4 {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.footer-column ul { list-style: none; }

.footer-column ul li { margin-bottom: 10px; }

.footer-column ul a {
  color: var(--text-secondary);
  font-size: 13px;
  transition: color 0.2s;
}

.footer-column ul a:hover { color: var(--accent); opacity: 1; }

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.footer-legal-links { display: flex; gap: 20px; }

.footer-legal-links a {
  color: var(--muted);
  font-size: 12px;
}

/* --- Legal Page Styles --- */
.legal-page {
  padding: 140px 0 96px;
}

.legal-page h1 {
  font-size: clamp(28px, 3vw, 40px);
  margin-bottom: 8px;
}

.legal-date {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 48px;
}

.legal-content h2 {
  font-size: 20px;
  margin: 40px 0 16px;
}

.legal-content h3 {
  font-size: 16px;
  margin: 28px 0 12px;
}

.legal-content p {
  font-size: 14px;
  max-width: 720px;
}

.legal-content ul {
  list-style: none;
  margin: 12px 0 20px;
  max-width: 720px;
}

.legal-content ul li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
}

.legal-content ul li::before {
  content: '—';
  color: var(--muted);
  flex-shrink: 0;
}

/* --- Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
}

.modal h3 { margin-bottom: 12px; }
.modal p { font-size: 14px; }

.modal .btn {
  margin-top: 24px;
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mt-64 { margin-top: 64px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .product-cards { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .badge-preview-section { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 12px;
  }
  .hamburger { display: block; }
  .hero { padding: 120px 0 64px; }
  .hero h1 { font-size: 32px; }
  .scan-form { flex-direction: column; }
  .scan-form button { width: 100%; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .cards-grid.cols-3 { grid-template-columns: 1fr; }
  .cards-grid.cols-4 { grid-template-columns: 1fr; }
  .product-cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .comparison-table { font-size: 12px; }
  .comparison-table th, .comparison-table td { padding: 8px 10px; }
  .feature-row { grid-template-columns: 1fr; }
  .feature-icon { margin-bottom: 4px; }
  .section { padding: 64px 0; }
}

@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Scan Page
   ============================================ */

.scan-page {
  padding: 120px 0 96px;
  min-height: 80vh;
}

/* --- Terminal Panel --- */
.scan-terminal {
  background: #0d0d14;
  border: 1px solid var(--border-strong);
  max-width: 680px;
  margin: 0 auto;
  overflow: hidden;
}

.scan-terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
  font-size: 11px;
  color: var(--muted);
  margin-left: 8px;
  letter-spacing: 0.05em;
}

.scan-terminal-body {
  padding: 20px 24px;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  font-family: var(--font-body);
  font-size: 13px;
}

.terminal-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  opacity: 0;
  animation: terminalFadeIn 0.3s ease forwards;
}

@keyframes terminalFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.terminal-line .terminal-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.terminal-line.done .terminal-icon { color: var(--accent); }
.terminal-line.error .terminal-icon { color: var(--red); font-weight: bold; }
.terminal-line.error .terminal-text { color: var(--red); }

.terminal-line .terminal-text {
  color: var(--text-secondary);
}

.terminal-line.done .terminal-text {
  color: var(--text);
}

.terminal-line .spinner {
  animation: none; /* animateTransform handles it */
}

.terminal-retry {
  margin-top: 20px;
  text-align: center;
}

/* --- Report Section --- */
.scan-report {
  max-width: 720px;
  margin: 0 auto;
}

.report-grade-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
}

.grade-badge {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 800;
  flex-shrink: 0;
  border: 2px solid var(--border-strong);
  background: var(--surface);
}

.grade-a { color: var(--accent); border-color: var(--accent); }
.grade-b { color: #88cc66; border-color: #88cc66; }
.grade-c { color: var(--gold); border-color: var(--gold); }
.grade-d { color: #ff8800; border-color: #ff8800; }
.grade-f { color: var(--red); border-color: var(--red); }

.report-meta h1 {
  font-size: clamp(22px, 3vw, 30px);
  margin-bottom: 4px;
}

.report-target {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  word-break: break-all;
}

.report-score {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.report-score strong {
  font-family: var(--font-heading);
  font-size: 18px;
}

.findings-title {
  font-size: 18px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.finding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin-bottom: 12px;
  border-left: 3px solid var(--muted);
}

.finding-card.severity-critical { border-left-color: #ff4444; }
.finding-card.severity-high { border-left-color: #ff8800; }
.finding-card.severity-medium { border-left-color: #ffcc00; }
.finding-card.severity-low { border-left-color: #44aaff; }
.finding-card.severity-info { border-left-color: var(--muted); }

.finding-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.finding-severity {
  font-size: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  flex-shrink: 0;
}

.finding-severity.severity-critical { background: rgba(255,68,68,0.15); color: #ff4444; }
.finding-severity.severity-high { background: rgba(255,136,0,0.15); color: #ff8800; }
.finding-severity.severity-medium { background: rgba(255,204,0,0.15); color: #ffcc00; }
.finding-severity.severity-low { background: rgba(68,170,255,0.15); color: #44aaff; }
.finding-severity.severity-info { background: rgba(136,136,136,0.15); color: #888; }

.finding-card h3 {
  font-size: 15px;
  margin: 0;
}

.finding-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.finding-evidence,
.finding-fix pre {
  background: #0d0d14;
  border: 1px solid var(--border);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 8px 0 0;
  line-height: 1.6;
}

.finding-summary {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 8px;
  line-height: 1.6;
}

.finding-details {
  margin-top: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.finding-details summary {
  cursor: pointer;
  padding: 10px 14px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s;
}

.finding-details summary:hover {
  color: var(--text);
}

.finding-details summary::-webkit-details-marker { display: none; }

.finding-details summary::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.finding-details[open] summary::before {
  transform: rotate(90deg);
}

.finding-details p {
  padding: 0 14px 12px;
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.finding-fix-code {
  background: #0d0d14;
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  line-height: 1.6;
}

/* --- Upsell Box --- */
.upsell-box {
  background: rgba(127,255,110,0.04);
  border: 1px solid var(--accent-dim);
  padding: 28px 32px;
  margin-top: 32px;
  text-align: center;
}

.upsell-box h3 {
  margin-bottom: 8px;
}

.upsell-box p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 20px;
}

.upsell-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.upsell-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Severity Distribution Bar --- */
.severity-distribution {
  margin-top: 20px;
}

.severity-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--surface3);
  gap: 2px;
}

.sev-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  min-width: 10px;
  transition: width 0.4s ease;
}

.sev-segment.sev-critical { background: #ff4444; }
.sev-segment.sev-high { background: #ff8800; }
.sev-segment.sev-medium { background: #ffcc00; }
.sev-segment.sev-low { background: #44aaff; }

.severity-legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.sev-critical { background: #ff4444; }
.legend-dot.sev-high { background: #ff8800; }
.legend-dot.sev-medium { background: #ffcc00; }
.legend-dot.sev-low { background: #44aaff; }

/* --- Findings Enhancements --- */
.findings-title .findings-total {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

/* --- Checks Summary Bar --- */
.checks-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
  font-family: var(--font-body);
}

.summary-passed { color: var(--accent); font-weight: 600; }
.summary-failed { color: #ff6b6b; font-weight: 600; }
.summary-total { color: var(--muted); }
.summary-sep { color: var(--border-strong); }

/* --- Category Summary --- */
.category-summary {
  margin-top: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.category-summary > summary {
  padding: 14px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
}

.category-summary > summary:hover {
  color: var(--text);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg);
  font-size: 13px;
}

.cat-icon { font-size: 14px; width: 16px; text-align: center; }
.cat-pass .cat-icon { color: var(--accent); }
.cat-fail .cat-icon { color: #ff6b6b; }

.cat-name { flex: 1; color: var(--text); }

.cat-stat {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.cat-pass .cat-stat { color: var(--accent); opacity: 0.7; }
.cat-fail .cat-stat { color: #ff6b6b; opacity: 0.8; }

.finding-clean {
  border-left-color: var(--accent) !important;
  text-align: center;
}

.fix-code-wrapper {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--surface3);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.finding-fix-locked {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(127,255,110,0.04);
  border: 1px dashed var(--accent-dim);
  font-size: 13px;
  color: var(--muted);
}

.finding-fix-locked a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.finding-fix-locked .lock-icon {
  font-size: 14px;
}

.finding-ai-instruction {
  margin: 12px 14px 12px;
  padding: 12px 16px;
  background: rgba(120, 100, 255, 0.06);
  border: 1px solid rgba(120, 100, 255, 0.18);
  border-radius: 0;
}

.ai-instruction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ai-instruction-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(160, 140, 255, 0.9);
}

.ai-instruction-label::before {
  content: '\1F916 ';
}

.ai-instruction-text {
  background: rgba(10, 8, 24, 0.6);
  border: 1px solid rgba(120, 100, 255, 0.12);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  line-height: 1.6;
}

.copy-ai-btn {
  position: static;
  flex-shrink: 0;
}

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 0 64px;
}

.login-card {
  max-width: 400px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 40px 36px;
  text-align: center;
}

.login-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}

.login-error {
  background: rgba(255,68,68,0.1);
  border: 1px solid rgba(255,68,68,0.3);
  color: #ff6666;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 20px;
}

.btn-github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  text-decoration: none;
}

.login-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}

/* --- Dashboard Page --- */
.dashboard-page {
  padding: 120px 0 64px;
  min-height: 100vh;
}

.dashboard-header {
  margin-bottom: 32px;
}

.dashboard-header h1 {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 4px;
}

.dashboard-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.dashboard-scan-form {
  margin-bottom: 40px;
}

.dashboard-scan-form .scan-form {
  max-width: 560px;
}

.dashboard-loading,
.dashboard-error {
  font-size: 14px;
  color: var(--muted);
  padding: 40px 0;
  text-align: center;
}

.dashboard-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--text-secondary);
}

.dashboard-empty h3 {
  margin-bottom: 8px;
}

.dashboard-empty p {
  font-size: 14px;
  color: var(--muted);
}

.dashboard-scan-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}

.dashboard-scan-card:hover {
  border-color: var(--border-strong);
}

.dashboard-scan-card.scan-pending {
  opacity: 0.6;
  pointer-events: none;
}

.scan-card-grade .grade-badge {
  width: 48px;
  height: 48px;
  font-size: 22px;
}

.grade-badge.grade-pending {
  font-size: 10px;
  color: var(--muted);
  border-color: var(--border);
}

.scan-card-info {
  flex: 1;
  min-width: 0;
}

.scan-card-url {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scan-card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* --- Dashboard User --- */
.dashboard-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.user-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface3);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-heading);
  color: var(--text);
}

.user-email {
  font-size: 12px;
  color: var(--muted);
}

/* --- Dashboard Plan Status --- */
.dashboard-plan {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.plan-badge {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  white-space: nowrap;
}

.plan-free { background: var(--surface3); color: var(--muted); }
.plan-certificate { background: rgba(127,255,110,0.12); color: var(--accent); }
.plan-pro { background: rgba(162,155,254,0.15); color: var(--purple); }

.plan-info {
  font-size: 13px;
  color: var(--text-secondary);
}

.plan-info a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

/* --- Dashboard Banner --- */
.dashboard-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  margin-bottom: 20px;
  font-size: 14px;
}

.dashboard-banner button {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.7;
}

.banner-success {
  background: rgba(127,255,110,0.08);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
}

/* --- Scan Tier Badges --- */
.scan-tier-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 2px;
  vertical-align: middle;
}

.tier-cert { background: rgba(127,255,110,0.12); color: var(--accent); }
.tier-pro { background: rgba(162,155,254,0.15); color: var(--purple); }

.nav-signin {
  color: var(--text-secondary) !important;
  transition: color 0.15s;
}

.nav-signin:hover {
  color: var(--text) !important;
}

.nav-logout {
  color: var(--muted) !important;
}

.nav-logout:hover {
  color: var(--text) !important;
}

/* --- Scan Page Responsive --- */
@media (max-width: 768px) {
  .scan-page { padding: 100px 0 64px; }

  .report-grade-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .grade-badge {
    width: 64px;
    height: 64px;
    font-size: 28px;
  }

  .finding-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .finding-card {
    padding: 16px 18px;
  }

  .upsell-box {
    padding: 20px;
  }
}

/* --- Waitlist Form --- */

.waitlist-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.waitlist-form input[type="email"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-mono);
  min-width: 0;
}

.waitlist-form input[type="email"]::placeholder {
  color: var(--muted);
}

.waitlist-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
}

.waitlist-form .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.waitlist-inline {
  justify-content: center;
  max-width: 440px;
  margin: 0 auto;
}

.waitlist-msg {
  font-size: 13px;
  margin-top: 8px;
  min-height: 20px;
}

.waitlist-success {
  color: var(--green);
}

.waitlist-error {
  color: var(--red);
}
