/* audit.redesign.llc — free lighthouse audit tool
 * Visual system mirrors redesign.llc/leads.html (system fonts, neutral
 * stone palette, blue accent). Self-contained — no external CSS deps.
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { -webkit-font-smoothing: antialiased; }
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --border: #e6e4df;
  --border-strong: #d4d1ca;
  --text: #1a1a1a;
  --text-2: #555550;
  --text-3: #8b8a85;
  --accent: #2563eb;
  --accent-soft: #eff5ff;
  --good: #16a34a;
  --warn: #ea580c;
  --bad: #dc2626;
  --shadow: 0 1px 2px rgba(20,20,20,0.04), 0 4px 12px rgba(20,20,20,0.04);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

/* ── Topbar ── */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar .brand {
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none;
}
.topbar .back {
  font-size: 13px; color: var(--text-2); text-decoration: none;
}
.topbar .back:hover { color: var(--text); }

/* ── Main wrap ── */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

/* ── Hero / forms ── */
.hero h1, .auditing h2, .results-head h2, .success h2 {
  font-size: 30px; font-weight: 600; letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.lede {
  color: var(--text-2); font-size: 15.5px;
  max-width: 56ch;
}
.hero .form { margin-top: 32px; }

.form-row {
  display: block; margin-bottom: 16px;
}
.form-row .lbl {
  display: block; font-size: 12.5px; color: var(--text-2);
  margin-bottom: 6px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.form-row input[type="text"],
.form-row input[type="email"] {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px; font-family: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.form-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.checkbox-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; color: var(--text-2);
  margin: 14px 0 18px;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  margin-top: 3px; accent-color: var(--accent);
  width: 14px; height: 14px;
}
.checkbox-row code {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 12.5px;
  background: var(--accent-soft); color: var(--accent);
  padding: 1px 5px; border-radius: 4px;
}

.cf-turnstile { margin: 14px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px;
  font-size: 14.5px; font-weight: 600; font-family: inherit;
  border: 0; border-radius: 8px;
  cursor: pointer;
  transition: background .12s, opacity .12s;
  text-decoration: none;
}
.btn-primary {
  background: var(--text); color: var(--surface);
}
.btn-primary:hover { background: #2a2a2a; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--text); }

.hint {
  font-size: 12.5px; color: var(--text-3);
  margin-top: 10px;
}

.link {
  background: none; border: 0; padding: 0;
  color: var(--accent); cursor: pointer;
  font-family: inherit; font-size: 14px;
  text-decoration: none;
}
.link:hover { text-decoration: underline; }

/* ── Auditing (spinner) ── */
.auditing { text-align: left; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#auditing-host {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 0.85em;
  color: var(--accent);
}

/* ── Results ── */
.results-head { margin-bottom: 28px; }
.results-target {
  color: var(--text-2); font-size: 14px;
  word-break: break-all;
}
.results-target a { color: var(--accent); text-decoration: none; }
.results-target a:hover { text-decoration: underline; }

.scores {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 32px;
}
.score {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.score .num {
  font-size: 40px; font-weight: 600;
  letter-spacing: -0.03em; line-height: 1;
}
.score .lbl {
  font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-top: 8px; font-weight: 500;
}
.score.good .num { color: var(--good); }
.score.warn .num { color: var(--warn); }
.score.bad .num { color: var(--bad); }
.score.na .num { color: var(--text-3); }

@media (max-width: 580px) {
  .scores { grid-template-columns: repeat(2, 1fr); }
  .hero h1, .auditing h2, .results-head h2 { font-size: 24px; }
}

/* ── Opportunities ── */
.opp-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.opp-block h3 {
  font-size: 15px; font-weight: 600; margin-bottom: 14px;
}
.opp-block ul { list-style: none; padding: 0; }
.opp-block li {
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 12px;
}
.opp-block li:last-child { border-bottom: 0; }
.opp-title { color: var(--text); }
.opp-savings { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }

/* ── Redesign CTA ── */
.cta-block { margin-bottom: 24px; }
.cta-card {
  background: var(--text); color: var(--surface);
  border-radius: 12px; padding: 28px;
}
.cta-card h3 {
  font-size: 18px; font-weight: 600; margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.cta-card p {
  color: #d4d1ca; font-size: 14.5px;
  margin-bottom: 18px;
}
.cta-card .btn-primary {
  background: var(--surface); color: var(--text);
}
.cta-card .btn-primary:hover { background: #f4f4f5; }

/* ── Email gate ── */
.gate-block { margin-bottom: 32px; }
.gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.gate-card h3 {
  font-size: 17px; font-weight: 600; margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.gate-card p {
  color: var(--text-2); font-size: 14px;
  margin-bottom: 20px;
  max-width: 56ch;
}

.reset-row {
  text-align: center;
  margin-top: 24px;
}

/* ── Success ── */
.success-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow);
}
.success-card h2 { color: var(--good); }
.success-card p { color: var(--text-2); margin-bottom: 12px; }
.permalink-row a {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 13px; color: var(--accent);
  word-break: break-all;
}

/* ── Error toast ── */
.error {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bad); color: var(--surface);
  padding: 12px 18px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 8px 32px rgba(220, 38, 38, 0.3);
  z-index: 100;
  max-width: 90vw;
}

/* ── Footer ── */
.foot {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px; color: var(--text-3);
}
.foot a { color: var(--text-2); text-decoration: none; }
.foot a:hover { color: var(--text); }
