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

/* Fix: CSS display rules must not override [hidden] attribute */
[hidden] { display: none !important; }

:root {
  --black: #1a1a1a;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e8e8e8;
  --gray-400: #aaa;
  --gray-600: #666;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --orange: #f97316;
  --font: 'Funnel Display', Arial, sans-serif;
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
}

.logo { text-decoration: none; display: flex; align-items: center; }
.logo img { display: block; height: 22px; width: auto; }

.header-back {
  font-size: 13px;
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: .01em;
}
.header-back:hover { color: var(--black); }

/* ── CONTAINER ── */
.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── HOME HERO ── */
.home-hero {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 72px 0 60px;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gray-600);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 18px;
}

.hero-sub {
  font-size: 17px;
  color: var(--gray-600);
  font-weight: 400;
  max-width: 460px;
  line-height: 1.55;
  margin-bottom: 36px;
}

/* ── AUDIT INPUT ── */
.audit-form { margin-bottom: 20px; }

.audit-input-wrap {
  display: flex;
  max-width: 560px;
  border: 1.5px solid var(--black);
  border-radius: 6px;
  overflow: hidden;
  background: var(--white);
  transition: box-shadow .2s;
}
.audit-input-wrap:focus-within {
  box-shadow: 0 0 0 3px rgba(26,26,26,.1);
}

.audit-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 18px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  color: var(--black);
  background: transparent;
  min-width: 0;
}
.audit-input::placeholder { color: var(--gray-400); font-weight: 400; }

.audit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  background: var(--black);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
  letter-spacing: .01em;
}
.audit-btn:hover { background: #333; }
.audit-btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-arrow { font-size: 18px; line-height: 1; }

.audit-error {
  margin-top: 10px;
  font-size: 13px;
  color: var(--red);
  font-weight: 600;
}

.checks-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 500;
}

/* ── LOADING STATE ── */
.state-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}

.loading-inner { text-align: center; max-width: 420px; }

.loading-logo {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 28px;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 2.5px solid var(--gray-200);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 6px;
}

.loading-sub {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 28px;
  font-weight: 400;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  display: inline-flex;
}

.lstep {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-400);
  transition: color .3s;
}
.lstep.done { color: var(--black); }
.lstep.active { color: var(--black); }

.lstep-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-200);
  flex-shrink: 0;
  transition: background .3s;
}
.lstep.done .lstep-dot { background: var(--green); }
.lstep.active .lstep-dot {
  background: var(--black);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* Ready state (replaces spinner after audit) */
.loading-ready {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: popIn .4s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes popIn { from{transform:scale(0);opacity:0} to{transform:scale(1);opacity:1} }

/* ── RESULTS STATE ── */
.state-results { flex: 1; padding: 32px 0 60px; }

.audit-url-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 28px;
  padding: 9px 14px;
  background: var(--gray-100);
  border-radius: 5px;
  font-weight: 500;
}
.audit-url-label { color: var(--gray-600); font-weight: 400; }
.audit-url-value { color: var(--black); word-break: break-all; }

/* ── SCORE HERO ── */
.score-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 40px;
  padding: 32px;
  background: var(--black);
  color: var(--white);
  border-radius: 8px;
}

.score-circle {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.score-num  { font-size: 36px; font-weight: 900; line-height: 1; }
.score-grade { font-size: 14px; font-weight: 700; opacity: .75; }

.score-label { font-size: 20px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 6px; }
.score-desc  { font-size: 13px; opacity: .55; line-height: 1.5; font-weight: 400; }

.score-circle.grade-A .score-num { color: var(--green); }
.score-circle.grade-A { border-color: var(--green); }
.score-circle.grade-B .score-num { color: #84cc16; }
.score-circle.grade-B { border-color: #84cc16; }
.score-circle.grade-C .score-num { color: var(--yellow); }
.score-circle.grade-C { border-color: var(--yellow); }
.score-circle.grade-D .score-num { color: var(--orange); }
.score-circle.grade-D { border-color: var(--orange); }
.score-circle.grade-F .score-num { color: var(--red); }
.score-circle.grade-F { border-color: var(--red); }

/* ── METRICS GRID ── */
.section-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.3px;
  margin-bottom: 14px;
}

.metrics-preview { margin-bottom: 36px; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.metric-card {
  background: var(--gray-100);
  border-radius: 6px;
  padding: 14px 16px;
  border: 1px solid var(--gray-200);
}

.mc-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 5px;
}
.mc-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  color: var(--black);
}
.mc-sub {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 3px;
}

.mc-value.green  { color: var(--green); }
.mc-value.red    { color: var(--red); }
.mc-value.yellow { color: var(--yellow); }

/* ── PAYWALL ZONE ── */
.paywall-zone { position: relative; min-height: 580px; }

.blurred-preview {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
  opacity: .5;
}

.blur-section { margin-bottom: 36px; }

.blur-grid .mc-value { color: var(--gray-400); letter-spacing: 3px; }

.issues-blur { display: flex; flex-direction: column; gap: 10px; }
.issue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gray-400);
  letter-spacing: 2px;
}
.issue-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  color: #fff;
  white-space: nowrap;
  letter-spacing: .03em;
}
.badge-critical { background: var(--red); }
.badge-high     { background: var(--orange); }
.badge-medium   { background: var(--yellow); }
.badge-low      { background: #84cc16; }

.paywall-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,.6) 12%, rgba(255,255,255,1) 28%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 48px;
}

.paywall-card {
  background: var(--white);
  border: 1.5px solid var(--black);
  border-radius: 8px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,.1);
}

.paywall-icon  { font-size: 28px; margin-bottom: 10px; }
.paywall-title { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 8px; }
.paywall-desc  { font-size: 14px; color: var(--gray-600); line-height: 1.55; margin-bottom: 22px; }

/* ── LEAD FORM ── */
.form-field { margin-bottom: 12px; }
.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--gray-600);
  letter-spacing: .02em;
}
.form-field input {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: 5px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--black);
  background: var(--white);
  outline: none;
  transition: border-color .15s;
}
.form-field input:focus { border-color: var(--black); }
.form-field input.input-readonly {
  background: var(--gray-100);
  color: var(--gray-600);
  cursor: not-allowed;
}
.form-error {
  font-size: 12px;
  color: var(--red);
  margin-bottom: 10px;
  font-weight: 600;
}
.lead-submit-btn {
  width: 100%;
  justify-content: center;
  border-radius: 5px;
  padding: 13px 24px;
  font-size: 16px;
  margin-top: 4px;
}
.form-consent {
  font-size: 11px;
  color: var(--gray-400);
  text-align: center;
  margin-top: 10px;
  line-height: 1.5;
}
.form-consent a { color: var(--gray-600); }

/* ── SUCCESS BLOCK ── */
.success-block {
  text-align: center;
  padding: 52px 24px;
  max-width: 460px;
  margin: 0 auto;
}
.success-icon {
  width: 56px;
  height: 56px;
  background: var(--green);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.success-block h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 10px;
}
.success-block p {
  font-size: 15px;
  color: var(--gray-600);
  margin-bottom: 8px;
  line-height: 1.5;
}
.success-block .audit-btn {
  border-radius: 5px;
  margin-top: 20px;
}

/* ── ERROR STATE ── */
.state-error {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 60px 24px;
}
.state-error h2 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 10px; }
.state-error p  { color: var(--gray-600); margin-bottom: 24px; font-size: 15px; }
.state-error .audit-btn { border-radius: 5px; }

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--gray-200);
  padding: 14px 24px;
  margin-top: auto;
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray-600);
}
.site-footer a { color: var(--gray-600); text-decoration: none; font-weight: 500; }
.site-footer a:hover { color: var(--black); }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .site-header { padding: 0 16px; }
  /* Home hero */
  .home-hero { padding: 40px 0 28px; }
  .hero-title { letter-spacing: -1.5px; font-size: clamp(28px, 8vw, 48px); }
  .hero-sub { font-size: 15px; margin-bottom: 24px; }
  .hero-eyebrow { margin-bottom: 14px; }
  /* Audit input */
  .audit-input-wrap { flex-direction: column; }
  .audit-btn { justify-content: center; }
  /* Score hero (results page) */
  .score-hero { flex-direction: column; text-align: center; padding: 20px 16px; gap: 16px; }
  .score-meta { text-align: center; }
  .score-label { font-size: 18px; }
  .score-desc { font-size: 12px; }
  /* Metrics */
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  /* Paywall */
  .paywall-card { padding: 20px 16px; }
  .paywall-overlay { padding-top: 24px; padding-left: 12px; padding-right: 12px; }
  .paywall-zone { min-height: 520px; }
  /* Audit URL bar */
  .audit-url-bar { font-size: 12px; padding: 8px 12px; }
  /* State padding */
  .state-results { padding: 20px 0 40px; }
}
