/*
 * All custom properties and base element rules below are scoped under
 * .seo-checker-page so this stylesheet — loaded after the site's own
 * /static/css/styles.css on the shared header/footer page — can't leak onto or
 * override the site's global --accent (etc.) or body styling. The checker's
 * own accent color is named --checker-accent (not --accent) so it can never
 * shadow the site's --accent via CSS custom-property inheritance, even for
 * elements inside .seo-checker-page that use the site's own .btn classes
 * (which resolve var(--accent) from whichever ancestor declares it nearest —
 * a same-named variable here would silently win over the real site color).
 */
.seo-checker-page {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #666;
  --border: #e2e2e2;
  --pass: #1a7f37;
  --pass-bg: #e8f7ee;
  --fail: #b3261e;
  --fail-bg: #fbeceb;
  --warn: #8a6100;
  --warn-bg: #fdf3d9;
  --checker-accent: #0b5fff;

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  .seo-checker-page {
    --bg: #14161a;
    --fg: #f0f0f0;
    --muted: #a3a3a3;
    --border: #2c2f36;
    --pass-bg: #163524;
    --fail-bg: #3a1f1d;
    --warn-bg: #3a2f10;
    --checker-accent: #5b9dff;
  }
}

.seo-checker-page * { box-sizing: border-box; }

.check-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.check-form label { width: 100%; font-weight: 600; }

.check-form .btn:disabled,
.email-form .btn:disabled {
  cursor: not-allowed;
  transform: none;
  animation: btn-pulse 1.2s ease-in-out infinite;
}

@keyframes btn-pulse {
  0%, 100% { background: var(--accent); }
  50% { background: var(--accent-hover); }
}

/* 65px matches the Cloudflare Turnstile widget's default rendered height,
   so the input/button line up with it instead of looking short beside it. */
.check-form .form-input,
.check-form .btn,
.check-form .cf-turnstile {
  height: 65px;
  box-sizing: border-box;
}

.check-form .cf-turnstile,
.check-form .cf-turnstile iframe {
  display: block;
  margin: 0;
  vertical-align: top;
}

.check-form .form-input {
  flex: 1 1 320px;
  min-width: 0;
  width: auto;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin: 1rem 0;
}

.alert-error {
  background: var(--fail-bg);
  color: var(--fail);
}

.alert-success {
  background: #7a3b12;
  border: 1px solid #b3261e;
  color: #ffd84d;
}

.results { margin: 2rem 0; overflow-x: auto; }

.results h2 {
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
}

.results h2 + h2,
.results table + h2 {
  margin-top: 2rem;
}

.score { color: var(--muted); }

.score-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.score-text {
  flex: 1 1 260px;
}

.thumbnail-domain {
  font-size: 2rem;
  font-weight: 800;
  color: var(--fg);
  text-align: left;
  margin: 0 0 0.5rem;
}

.site-thumbnail {
  flex: 0 0 auto;
  width: 200px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
  aspect-ratio: 16 / 10;
}

table.checklist {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 0.75rem;
  min-width: 520px;
}

table.checklist th, table.checklist td {
  text-align: left;
  padding: 0.6rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: break-word;
}

table.checklist th:nth-child(1), table.checklist td:nth-child(1) { width: 18%; }
table.checklist th:nth-child(2), table.checklist td:nth-child(2) { width: 14%; }
table.checklist th:nth-child(3), table.checklist td:nth-child(3) { width: 68%; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 0;
  border: 1px solid currentColor;
  background: transparent;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-pass { color: var(--pass); }
.badge-fail { color: var(--fail); }
.badge-warn { color: var(--warn); }

.badge-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.teaser, .teaser-inline {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.teaser a { color: var(--accent-hover); }

.cta {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--accent-dark);
}

.cta-text {
  flex: 1 1 320px;
}

.cta-text h2 { margin-top: 0; }
.cta-text p { margin-bottom: 0; }

.email-form {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.email-form .form-input {
  flex: 1 1 200px;
  min-width: 0;
  width: auto;
}
