/**
 * Shared styles for the free-audit tool pages (/tools/*-audit/).
 * One stylesheet; each tool page reuses the same structure and only
 * changes copy. Tokens from /tokens.css (colors, type, spacing).
 */

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

html, body { background: var(--paper); }

body {
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.at-main {
  padding-top: 60px;
  background: var(--paper);
}

.at-section {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-16) var(--space-6);
}

@media (max-width: 720px) {
  .at-section { padding: var(--space-12) var(--space-5); }
}

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */

.at-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--space-16);
  align-items: center;
  padding-top: var(--space-12);
}

@media (max-width: 900px) {
  .at-hero {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }
}

.at-kicker {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: var(--brand-yellow);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
}

.at-h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.6vw, 3.1rem);
  font-weight: var(--font-weight-black);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-5);
}

.at-h1 mark {
  background: linear-gradient(transparent 55%, var(--brand-yellow) 55%);
  color: inherit;
}

.at-lead {
  font-size: var(--text-lg);
  line-height: var(--lh-relaxed);
  color: var(--muted);
  max-width: 34rem;
  margin-bottom: var(--space-6);
}

.at-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  color: var(--muted);
}

.at-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.at-trust-row svg { flex: none; color: var(--ink); }

/* ------------------------------------------------------------------ */
/* Form card                                                           */
/* ------------------------------------------------------------------ */

.at-card {
  background: var(--surface-card);
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-offset);
}

@media (max-width: 720px) {
  .at-card { padding: var(--space-6); }
}

.at-card-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--lh-tight);
  margin-bottom: var(--space-2);
}

.at-card-sub {
  font-size: var(--text-md);
  color: var(--muted);
  margin-bottom: var(--space-6);
}

.at-field { margin-bottom: var(--space-4); }

.at-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-2);
}

.at-label .at-optional {
  font-weight: var(--font-weight-regular);
  color: var(--muted2);
}

.at-input,
.at-select {
  width: 100%;
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--input-bg);
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius-md);
  outline: none;
}

.at-input:focus,
.at-select:focus {
  border-color: var(--focus-border);
  box-shadow: var(--focus-ring);
}

.at-select { appearance: auto; }

.at-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border: var(--border-thin) solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.at-btn:disabled { opacity: 0.6; cursor: default; }

.at-btn-yellow {
  background: var(--brand-yellow);
  color: var(--ink);
  border-color: var(--brand-yellow);
}

.at-btn-yellow:hover:not(:disabled) {
  filter: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-offset);
}

.at-btn-ink {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.at-btn-ink:hover:not(:disabled) {
  filter: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-offset-marker);
}

.at-btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.at-btn-ghost:hover:not(:disabled) {
  background: var(--paper);
  transform: translateY(-2px);
  box-shadow: var(--shadow-offset);
}

.at-fineprint {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  line-height: var(--lh-normal);
  color: var(--muted2);
}

.at-fineprint a { color: var(--muted); }

.at-error {
  display: none;
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  line-height: var(--lh-normal);
  color: var(--status-danger);
  background: var(--status-danger-bg);
  border: var(--border-thin) solid var(--status-danger-border);
  border-radius: var(--radius-md);
}

.at-error.is-visible { display: block; }

/* Processing / step-2 states ---------------------------------------- */

.at-state[hidden] { display: none; }

.at-success-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.at-success-icon {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--brand-yellow);
  border-radius: var(--radius-full);
  color: var(--ink);
}

.at-success-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--lh-tight);
}

.at-success-sub {
  margin-top: var(--space-1);
  font-size: var(--text-md);
  line-height: var(--lh-normal);
  color: var(--muted);
}

.at-qualify-divider {
  margin: var(--space-6) 0;
  border: 0;
  border-top: var(--border-thin) solid var(--border);
}

.at-qualify-title {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
}

.at-qualify-sub {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--space-5);
}

.at-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 480px) {
  .at-field-row { grid-template-columns: 1fr; }
}

.at-skip {
  display: block;
  width: 100%;
  margin-top: var(--space-3);
  background: none;
  border: 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--muted2);
  text-align: center;
  text-decoration: underline;
  cursor: pointer;
}

.at-skip:hover { color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Report preview mock                                                 */
/* ------------------------------------------------------------------ */

.at-preview {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--space-16);
  align-items: center;
}

@media (max-width: 900px) {
  .at-preview { grid-template-columns: 1fr; gap: var(--space-10); }
}

.at-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  font-weight: var(--font-weight-medium);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.at-body {
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  color: var(--muted);
  max-width: 32rem;
}

.at-check-list {
  list-style: none;
  margin-top: var(--space-6);
  display: grid;
  gap: var(--space-3);
}

.at-check-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
}

.at-check-list svg {
  flex: none;
  margin-top: 3px;
  color: var(--ink);
}

/*
 * The mock report card — a miniature replica of the real welcome-package
 * report (client/src/styles/welcome-package.css). Scoped palette + fonts
 * intentionally mirror the report theme, not the landing tokens: the point
 * is that the preview looks exactly like the document that lands in the
 * lead's inbox.
 */
.at-mock {
  --rp-paper: #fdfdfb;
  --rp-ink: #15181d;
  --rp-ink-soft: #4a5058;
  --rp-marker: #ffe84d;
  --rp-line: #e4e2da;
  --rp-card: #ffffff;
  --rp-red: #e5484d;
  --rp-green: #1f9d63;
  --rp-amber: #d98e04;
  --rp-heading: "Archivo", sans-serif;
  --rp-body: "Inter", system-ui, sans-serif;
  --rp-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  background: var(--rp-paper);
  color: var(--rp-ink);
  font-family: var(--rp-body);
  border: 1.5px solid var(--rp-ink);
  border-radius: 14px;
  box-shadow: 8px 8px 0 var(--rp-marker);
  overflow: hidden;
  transform: rotate(-0.5deg);
}

.at-mock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: var(--rp-ink);
  color: var(--rp-paper);
}

.at-mock-bar-label {
  font-family: var(--rp-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.at-mock-bar-label b { color: var(--rp-marker); }

.at-mock-bar-cta {
  font-family: var(--rp-mono);
  font-size: 11px;
  font-weight: 600;
  background: var(--rp-marker);
  color: var(--rp-ink);
  padding: 5px 12px;
  border-radius: 6px;
  white-space: nowrap;
}

.at-mock-head {
  padding: 22px 20px 20px;
  border-bottom: 1.5px solid var(--rp-ink);
}

.at-mock-stamp {
  font-family: var(--rp-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--rp-ink-soft);
  margin-bottom: 12px;
}

.at-mock-stamp b { color: var(--rp-ink); }

.at-mock-hook {
  font-family: var(--rp-heading);
  font-weight: 900;
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.8px;
}

.at-mock-hl {
  background: linear-gradient(104deg, transparent 2%, var(--rp-marker) 3%, var(--rp-marker) 97%, transparent 98%);
  padding: 0 5px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.at-mock-scores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.at-mock-score {
  background: var(--rp-card);
  border: 1.5px solid var(--rp-ink);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 3px 3px 0 rgba(21, 24, 29, 0.07);
}

.at-mock-score-stage {
  display: block;
  font-family: var(--rp-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rp-ink-soft);
  margin-bottom: 4px;
}

.at-mock-g {
  font-family: var(--rp-heading);
  font-weight: 900;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.5px;
}

.at-mock-g--red { color: var(--rp-red); }
.at-mock-g--amber { color: var(--rp-amber); }
.at-mock-g--green { color: var(--rp-green); }

.at-mock-finding {
  margin: 16px;
  border: 1.5px solid var(--rp-ink);
  border-radius: 10px;
  background: var(--rp-card);
  box-shadow: 4px 4px 0 rgba(21, 24, 29, 0.07);
  overflow: hidden;
}

.at-mock-f-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rp-line);
}

.at-mock-f-num {
  font-family: var(--rp-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--rp-ink-soft);
}

.at-mock-f-title {
  font-family: var(--rp-heading);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.2px;
  line-height: 1.3;
  flex: 1;
}

.at-mock-sev {
  font-family: var(--rp-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--rp-red);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.at-mock-f-body { padding: 14px 16px; }

.at-mock-f-label {
  font-family: var(--rp-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rp-ink-soft);
  margin-bottom: 5px;
}

.at-mock-f-text {
  font-size: 13px;
  line-height: 1.55;
}

.at-mock-impact {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--rp-mono);
  font-size: 10px;
  font-weight: 600;
  background: var(--rp-paper);
  border: 1.5px dashed var(--rp-ink);
  padding: 5px 10px;
  border-radius: 6px;
}

.at-mock-locked {
  margin: 0 16px 16px;
  border: 1.5px dashed var(--rp-ink-soft);
  border-radius: 10px;
  background: var(--rp-card);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.at-mock-lock-tag {
  font-family: var(--rp-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #e9e8e2;
  color: var(--rp-ink-soft);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.at-mock-teaser {
  width: 100%;
  font-size: 12px;
  line-height: 1.5;
  color: var(--rp-ink-soft);
  filter: blur(4px);
  user-select: none;
  pointer-events: none;
}

@media (max-width: 480px) {
  .at-mock-scores { grid-template-columns: repeat(2, 1fr); }
}

/* ------------------------------------------------------------------ */
/* Qualification wizard (one question per screen)                      */
/* ------------------------------------------------------------------ */

.at-wizard-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.at-wizard-back {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: none;
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  color: var(--ink);
  cursor: pointer;
}

.at-wizard-back:hover {
  background: var(--paper);
  transform: translateY(-2px);
  box-shadow: var(--shadow-offset);
}
.at-wizard-back[hidden] { display: none; }

.at-wizard-count {
  flex: none;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--muted2);
  white-space: nowrap;
}

.at-wizard-bar {
  flex: 1;
  height: 6px;
  background: var(--paper3);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.at-wizard-bar span {
  display: block;
  height: 100%;
  width: 25%;
  background: var(--brand-yellow);
  border-radius: var(--radius-full);
  transition: width 0.25s ease;
}

.at-wizard-step[hidden] { display: none; }

.at-wizard-q {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--lh-tight);
  margin-bottom: var(--space-2);
}

.at-wizard-hint {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--space-4);
}

.at-wizard-q + .at-options { margin-top: var(--space-4); }

.at-options {
  display: grid;
  gap: var(--space-2);
}

.at-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--ink);
  text-align: left;
  background: var(--input-bg);
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.12s ease;
}

.at-option:hover {
  border-color: var(--ink);
  background: var(--paper);
  transform: translateY(-2px);
  box-shadow: var(--shadow-offset);
}

.at-option.is-selected {
  background: var(--brand-yellow);
  border-color: var(--ink);
  font-weight: var(--font-weight-semibold);
}

.at-option--quiet {
  color: var(--muted);
  font-weight: var(--font-weight-regular);
}

.at-wizard-other {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.at-wizard-other[hidden] { display: none; }

/* ------------------------------------------------------------------ */
/* Full-page yellow capture overlay                                    */
/* ------------------------------------------------------------------ */

body.at-overlay-open {
  overflow: hidden;
}

.at-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--brand-yellow);
  color: var(--ink);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.at-overlay[hidden] {
  display: none;
}

.at-overlay-inner {
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  padding: var(--space-12) var(--space-6) var(--space-16);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 720px) {
  .at-overlay-inner {
    padding: var(--space-10) var(--space-5) var(--space-12);
    justify-content: flex-start;
  }
}

.at-overlay .at-wizard-top {
  margin-bottom: var(--space-8);
}

.at-overlay .at-wizard-back {
  background: var(--white);
  border-color: var(--ink-12);
  color: var(--ink);
}

.at-overlay .at-wizard-back:hover {
  background: var(--paper);
}

.at-overlay .at-wizard-count {
  color: var(--ink2);
}

.at-overlay .at-wizard-bar {
  background: var(--ink-12);
}

.at-overlay .at-wizard-bar span {
  background: var(--ink);
}

.at-overlay .at-wizard-q {
  font-size: var(--text-2xl);
}

.at-overlay .at-wizard-hint {
  color: var(--ink2);
  margin-bottom: var(--space-6);
}

.at-overlay .at-label {
  color: var(--ink);
}

.at-overlay .at-input {
  background: var(--white);
  border-color: var(--ink-12);
}

.at-overlay .at-option {
  background: var(--white);
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

.at-overlay .at-option:hover {
  border-color: var(--ink);
  background: var(--white);
}

.at-overlay .at-option.is-selected {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.at-overlay .at-option--quiet {
  color: var(--ink2);
}

.at-overlay .at-option--quiet.is-selected {
  color: var(--white);
}

.at-overlay .at-fineprint {
  color: var(--ink2);
}

.at-overlay .at-error {
  background: var(--white);
}

.at-overlay-congrats {
  text-align: center;
}

.at-overlay-congrats .at-success-icon {
  margin: 0 auto var(--space-5);
  background: var(--ink);
  color: var(--brand-yellow);
}

.at-overlay-congrats .at-wizard-q {
  margin-bottom: var(--space-3);
  font-size: var(--text-3xl);
}

.at-overlay-congrats .at-wizard-hint {
  font-size: var(--text-lg);
  line-height: var(--lh-normal);
  color: var(--ink2);
}

.at-overlay-redirect {
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--ink2);
}

.at-overlay-redirect a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.at-overlay-redirect a:hover {
  color: var(--ink2);
}

/* ------------------------------------------------------------------ */
/* Steps                                                               */
/* ------------------------------------------------------------------ */

.at-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
}

@media (max-width: 720px) {
  .at-steps { grid-template-columns: 1fr; }
}

.at-step {
  background: var(--white);
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-offset);
}

.at-step-num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--brand-yellow);
  color: var(--ink);
  font-size: var(--text-md);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.at-step-title {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-2);
}

.at-step-body {
  font-size: var(--text-sm);
  line-height: var(--lh-normal);
  color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* FAQ                                                                 */
/* ------------------------------------------------------------------ */

.at-faq {
  max-width: 44rem;
  margin: var(--space-10) auto 0;
}

.at-faq details {
  border-bottom: var(--border-thin) solid var(--ink);
}

.at-faq summary {
  padding: var(--space-5) 0;
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

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

.at-faq summary::after {
  content: "+";
  flex: none;
  font-size: var(--text-lg);
  color: var(--muted2);
  transition: transform 0.15s ease;
}

.at-faq details[open] summary::after { transform: rotate(45deg); }

.at-faq-body {
  padding: 0 0 var(--space-3);
  font-size: var(--text-md);
  line-height: var(--lh-relaxed);
  color: var(--muted);
  max-width: 40rem;
  text-align: left;
}

.at-faq-body:last-child {
  padding-bottom: var(--space-5);
}

/* ------------------------------------------------------------------ */
/* Final CTA banner                                                    */
/* ------------------------------------------------------------------ */

.at-final {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-8);
  text-align: center;
}

.at-final .at-h2 { color: var(--white); margin-bottom: var(--space-3); }

.at-final-sub {
  font-size: var(--text-base);
  color: var(--app-shell-muted);
  margin-bottom: var(--space-8);
}

.at-final .at-btn {
  width: auto;
  min-width: 240px;
}

.at-centered { text-align: center; }
.at-centered .at-body { margin: 0 auto; }
