/**
 * Funnel design system — SEO Audit Pack / AEO check / checkout surfaces.
 */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Sora:wght@400;600;700&display=swap');

:root {
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-300: #94a3b8;
  --ink-100: #f1f5f9;
  --ink-50: #f8fafc;
  --brand-700: #0f766e;
  --brand-600: #0d9488;
  --accent: #7c3aed;
  --success: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --bg: #ffffff;
  --bg-elev: #f8fafc;
  --border: #e2e8f0;
  --ring: 0 0 0 3px rgba(13, 148, 136, 0.35);
  --font-display: 'Sora', system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.5rem;
  --text-4xl: 3.5rem;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --r-md: 12px;
  --r-lg: 20px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur: 240ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.funnel-page {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.funnel-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-8);
}

.funnel-wrap--wide {
  max-width: 960px;
}

/* Nav */
.funnel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.funnel-nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--ink-900);
  font-weight: 600;
  font-size: var(--text-sm);
}

.funnel-nav__brand img {
  width: 28px;
  height: 28px;
}

.funnel-nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Footer */
.funnel-footer {
  padding: var(--space-6) var(--space-5);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ink-500);
}

.funnel-footer a {
  color: var(--brand-600);
  text-decoration: none;
}

/* Buttons */
.fbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.fbtn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.fbtn--primary {
  background: var(--brand-600);
  color: #fff;
}

.fbtn--primary:hover {
  background: var(--brand-700);
}

.fbtn--ghost {
  background: var(--bg-elev);
  color: var(--ink-700);
  border-color: var(--border);
}

.fbtn--ghost:hover {
  background: var(--ink-100);
}

.fbtn--lg {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-base);
  border-radius: var(--r-lg);
}

.fbtn--ic {
  padding: var(--space-2);
  min-width: 40px;
  min-height: 40px;
}

.fbtn:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Cards */
.fcard {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.fcard--elev {
  background: var(--bg-elev);
}

.fcard__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  font-weight: 600;
}

.fcard__lead {
  margin: 0 0 var(--space-4);
  color: var(--ink-500);
  font-size: var(--text-sm);
}

/* Verdict pills */
.fpill {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fpill--cited {
  background: #d1fae5;
  color: #065f46;
}

.fpill--mentioned {
  background: #fef3c7;
  color: #92400e;
}

.fpill--absent {
  background: var(--ink-100);
  color: var(--ink-500);
}

.fpill--unknown {
  background: var(--ink-100);
  color: var(--ink-300);
}

/* Hero */
.funnel-hero h1 {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-3xl));
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.02em;
}

.funnel-hero .lead {
  font-size: var(--text-lg);
  color: var(--ink-500);
  margin: 0 0 var(--space-5);
}

/* Form */
.funnel-input-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 560px) {
  .funnel-input-row--inline {
    flex-direction: row;
    align-items: stretch;
  }
  .funnel-input-row--inline .funnel-input {
    flex: 1;
  }
}

.funnel-input {
  width: 100%;
  padding: var(--space-4);
  font-size: var(--text-base);
  font-family: var(--font-display);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
}

.funnel-input:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: var(--ring);
}

/* Ticker */
.funnel-ticker {
  overflow: hidden;
  margin-bottom: var(--space-4);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.funnel-ticker__track {
  display: flex;
  gap: var(--space-2);
  animation: funnel-ticker-scroll 40s linear infinite;
  width: max-content;
}

.funnel-ticker:hover .funnel-ticker__track {
  animation-play-state: paused;
}

@keyframes funnel-ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.funnel-ticker__pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--text-xs);
  color: var(--ink-700);
  white-space: nowrap;
}

.funnel-ticker__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.funnel-ticker__dot--cited {
  background: var(--success);
}
.funnel-ticker__dot--mentioned {
  background: var(--warn);
}
.funnel-ticker__dot--absent {
  background: var(--ink-300);
}

.funnel-ticker__pill--sample {
  opacity: 0.75;
  font-style: italic;
}

/* AEO result cards */
.aeo-cards {
  margin-top: var(--space-5);
}

.aeo-verdict-host {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin: 0 0 var(--space-2);
}

.aeo-heatmap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

.aeo-heatmap-row:last-child {
  border-bottom: none;
}

.aeo-competitors {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.aeo-competitor {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
}

.aeo-competitor img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.aeo-sources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.aeo-sources-table th,
.aeo-sources-table td {
  padding: var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.aeo-your-site {
  display: inline-block;
  padding: 2px var(--space-2);
  background: #d1fae5;
  color: #065f46;
  border-radius: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
}

.aeo-methodology pre {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-elev);
  padding: var(--space-4);
  border-radius: var(--r-md);
}

.aeo-cursor {
  animation: aeo-blink 1s step-end infinite;
}

@keyframes aeo-blink {
  50% {
    opacity: 0;
  }
}

/* Trial report card */
.trial-card-score {
  text-align: center;
  margin-bottom: var(--space-5);
}

.trial-card-score svg {
  display: block;
  margin: 0 auto;
}

.trial-projected {
  font-size: var(--text-sm);
  color: var(--ink-500);
  margin-top: var(--space-2);
}

.trial-projected strong {
  color: var(--success);
}

.trial-screenshot-wrap {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: var(--space-5);
}

.trial-screenshot-wrap img {
  width: 100%;
  display: block;
}

.trial-marker {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
}

.trial-fix-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.trial-fix-card summary {
  padding: var(--space-4);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.trial-fix-card summary::-webkit-details-marker {
  display: none;
}

.trial-fix-body {
  padding: 0 var(--space-4) var(--space-4);
  font-size: var(--text-sm);
}

.trial-code-diff {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

@media (min-width: 640px) {
  .trial-code-diff {
    grid-template-columns: 1fr 1fr;
  }
}

.trial-code-before,
.trial-code-after {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: var(--space-3);
  border-radius: var(--r-md);
  overflow-x: auto;
}

.trial-code-before {
  background: #fef2f2;
  text-decoration: line-through;
  color: #991b1b;
}

.trial-code-after {
  background: #ecfdf5;
  color: #065f46;
}

.trial-locked-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

.trial-locked-blur {
  filter: blur(4px);
  user-select: none;
  color: var(--ink-500);
  flex: 1;
}

.trial-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
  z-index: 40;
}

@media (min-width: 768px) {
  .trial-sticky-cta {
    display: none;
  }
}

/* Live feed */
.run-feed {
  margin: var(--space-5) 0;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
}

.run-feed__row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  animation: feed-in var(--dur) var(--ease-out);
}

@keyframes feed-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.run-feed__avatar {
  font-size: 1.25rem;
  line-height: 1;
}

.run-feed__meta {
  font-size: var(--text-xs);
  color: var(--ink-300);
  white-space: nowrap;
}

/* Checkout */
.checkout-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .checkout-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.checkout-timeline {
  margin: var(--space-4) 0;
}

.checkout-you-saw {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
  border: 1px solid #99f6e4;
  border-radius: var(--r-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

#payment-element {
  margin: var(--space-4) 0;
}

.first-finding-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fed7aa;
  border-radius: var(--r-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.first-finding-banner strong {
  display: block;
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

/* Specialist grid */
.specialist-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin: var(--space-5) 0;
}

.specialist-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-4);
  background: var(--bg);
}

.specialist-card__emoji {
  font-size: 1.5rem;
}

.specialist-card__name {
  font-weight: 600;
  margin: var(--space-2) 0 var(--space-1);
}

.specialist-card__tagline {
  font-size: var(--text-xs);
  color: var(--ink-500);
  margin: 0 0 var(--space-2);
}

.specialist-card__voice {
  font-size: var(--text-xs);
  color: var(--ink-700);
  font-style: italic;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .funnel-ticker__track,
  .run-feed__row,
  .fbtn {
    animation: none;
    transition: none;
  }
}
