#ai-audit {
  scroll-margin-top: 5rem;
}

.audit-scan {
  padding: var(--space-8);
}

.audit-scan__form {
  margin-top: var(--space-6);
  margin-bottom: 0;
}

[data-ai-audit-error] {
  margin-top: var(--space-6);
}

.audit-live {
  margin-top: var(--space-8);
  padding: var(--space-6);
  border-radius: var(--radius-md, 8px);
  background: var(--surface-subtle, #f6f8f7);
  border: 1px solid var(--border-subtle, #e5e7eb);
}

.audit-live__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.audit-live__eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.audit-live__count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
  font-variant-numeric: tabular-nums;
}

.audit-live__track {
  height: 4px;
  border-radius: 999px;
  background: var(--border-subtle, #e5e7eb);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.audit-live__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--color-accent, #0d9488);
  transition: width 0.45s ease;
}

.audit-live__message {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-body);
}

.audit-live__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-subtle, #ccc);
  border-top-color: var(--color-accent, #0d9488);
  border-radius: 50%;
  flex-shrink: 0;
  animation: audit-spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .audit-live__fill {
    transition: none;
  }

  .audit-live__spinner {
    animation: none;
    border-top-color: var(--border-subtle, #ccc);
  }
}

.audit-scan__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.audit-scan__hint {
  margin: var(--space-2) 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.audit-scan__hint strong {
  font-weight: 600;
  color: var(--text-body);
}

.audit-scan__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.audit-scan__input {
  flex: 1 1 240px;
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-subtle, #ddd);
  border-radius: var(--radius-md, 8px);
  font: inherit;
}

.audit-scan__submit--loading {
  cursor: wait;
  opacity: 0.92;
}

.audit-scan__submit--loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: currentColor;
  border-radius: 50%;
  flex-shrink: 0;
  animation: audit-spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .audit-scan__submit--loading::before {
    animation: none;
    border-top-color: rgba(0, 0, 0, 0.15);
  }
}

.audit-results {
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-subtle, #eee);
}

.audit-results__score {
  text-align: center;
  margin-bottom: var(--space-8);
}

.audit-results__label {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.audit-results__value {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1;
  margin: var(--space-2) 0 0;
  color: var(--text-heading);
}

.audit-results__unit {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.audit-results__grid {
  display: grid;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
  .audit-results__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.audit-results__grid > * {
  min-width: 0;
}

.audit-results--running .audit-results__score--pending .audit-results__value {
  opacity: 0.35;
}

.audit-check--running {
  list-style: none;
  margin-left: 0;
  color: var(--text-muted);
}

.audit-check__running-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.audit-check__spinner {
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.1em;
  border: 2px solid var(--border-subtle, #ccc);
  border-top-color: var(--color-accent, #0d9488);
  border-radius: 50%;
  flex-shrink: 0;
  animation: audit-spin 0.8s linear infinite;
}

.audit-check--revealed {
  animation: audit-fade-in 0.35s ease;
}

.audit-priority--revealed {
  animation: audit-fade-in 0.35s ease;
}

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

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

@media (prefers-reduced-motion: reduce) {
  .audit-check__spinner {
    animation: none;
    border-top-color: var(--border-subtle, #ccc);
  }

  .audit-check--revealed,
  .audit-priority--revealed {
    animation: none;
  }
}

.audit-checks,
.audit-priorities {
  margin: var(--space-4) 0 0;
  padding-left: 0;
  line-height: 1.6;
  list-style: none;
}

.audit-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.audit-check__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.1em;
  border-radius: 50%;
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1;
}

.audit-check--pass .audit-check__icon {
  background: rgba(0, 185, 146, 0.14);
}

.audit-check--pass .audit-check__icon::before {
  content: '✓';
  color: var(--success-600, #007a61);
}

.audit-check--warn .audit-check__icon {
  background: rgba(245, 165, 36, 0.16);
}

.audit-check--warn .audit-check__icon::before {
  content: '×';
  color: var(--warning-600, #b26a00);
  font-size: 1.125rem;
  line-height: 0.85;
}

.audit-check--fail .audit-check__icon {
  background: rgba(229, 72, 77, 0.12);
}

.audit-check--fail .audit-check__icon::before {
  content: '×';
  color: var(--danger-600, #b3282c);
  font-size: 1.125rem;
  line-height: 0.85;
}

.audit-check__body {
  flex: 1;
  min-width: 0;
}

.audit-check__label {
  font-weight: 600;
}

.audit-check--pass .audit-check__label { color: var(--color-success, #027a48); }
.audit-check--warn .audit-check__label { color: var(--color-warning, #b54708); }
.audit-check--fail .audit-check__label { color: var(--color-danger, #b42318); }

.audit-priorities {
  padding-left: 1.25rem;
  list-style: decimal;
}

.audit-check__detail {
  color: var(--text-muted);
  font-size: 14px;
}

.audit-results__note {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.audit-results__perfect {
  margin-bottom: var(--space-6);
}

/* Hero mockup: hidden on narrow screens so the scanner stays above the fold. */
.audit-hero__mock {
  display: block;
  width: 100%;
  height: auto;
  /* Sized to the copy's height so the scanner button stays above the fold at 900px. */
  max-width: 360px;
  margin-left: auto;
}

@media (max-width: 999px) {
  .audit-hero__mock {
    display: none;
  }
}
