/* ==========================================================================
   AdSenseCheck — Design Tokens
   ========================================================================== */
:root {
  --color-bg: #ffffff;
  --color-surface: #f4f6fb;
  --color-surface-2: #eaeef7;
  --color-border: #dde2ee;
  --color-text: #12172b;
  --color-text-muted: #5b6478;
  --color-primary: #163f9e;
  --color-primary-dark: #0e2c72;
  --color-primary-light: #2e6ff2;
  --color-accent: #0f8a6c;
  --color-warning: #b8790a;
  --color-danger: #c23a2e;

  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card: 0 1px 2px rgba(18, 23, 43, 0.04), 0 8px 24px rgba(18, 23, 43, 0.06);
  --shadow-raised: 0 2px 4px rgba(18, 23, 43, 0.06), 0 16px 40px rgba(18, 23, 43, 0.10);

  --container: 1120px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-text);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--color-text-muted); max-width: 68ch; }

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-dark); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  min-height: 48px;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; }

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-primary); background: var(--color-surface); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn-ghost:hover { color: var(--color-text); border-color: var(--color-text-muted); }

.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo span { color: var(--color-primary); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.main-nav a:hover { background: var(--color-surface); color: var(--color-primary); }
.main-nav a[aria-current="page"] {
  color: var(--color-primary);
  font-weight: 700;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
}
.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 4px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .main-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
    display: none;
    box-shadow: var(--shadow-card);
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 12px 10px; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 68px 0 56px;
  background:
    radial-gradient(680px 320px at 82% -10%, rgba(46, 111, 242, 0.10), transparent 60%),
    var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.hero-inner { max-width: 760px; }

.eyebrow-note {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--color-primary-dark);
  background: #eaf1ff;
  border: 1px solid #cfe0ff;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero p.lead {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Notice / Disclaimer banner
   ========================================================================== */
.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #fff8ec;
  border: 1px solid #f1ddab;
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 28px 0;
}
.notice .notice-icon {
  flex: 0 0 auto;
  font-size: 1.2rem;
  line-height: 1;
}
.notice p { margin: 0; color: #6b4d10; max-width: none; }
.notice strong { color: #4d3707; }

.notice-inline-link { font-weight: 600; }

/* ==========================================================================
   Section spacing
   ========================================================================== */
.section {
  padding: 56px 0;
}
.section-heading {
  max-width: 640px;
  margin: 0 auto 36px;
  text-align: center;
}
.section-heading p { margin: 0 auto; }

.section-alt { background: var(--color-surface); }

/* ==========================================================================
   Feature / How-it-works cards
   ========================================================================== */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
}

.feature-card, .step-explainer {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
}
.feature-card .icon-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--color-surface-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 14px;
}
.feature-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.feature-card p { font-size: 0.94rem; margin: 0; }

.step-explainer { text-align: left; position: relative; }
.step-explainer .step-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--color-primary);
  margin-bottom: 8px;
}

/* ==========================================================================
   Checker Card
   ========================================================================== */
.checker-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised);
  padding: 36px;
  max-width: 780px;
  margin: 0 auto;
}
@media (max-width: 600px) {
  .checker-card { padding: 22px; border-radius: var(--radius-md); }
}

.checker-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}
.checker-progress-label strong { color: var(--color-text); }

.progressbar-track {
  height: 8px;
  background: var(--color-surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 30px;
}
.progressbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
  border-radius: 999px;
  transition: width 0.35s ease;
  width: 20%;
}

.checker-step { display: none; }
.checker-step.is-active { display: block; animation: fade-in 0.25s ease; }

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

.checker-step h2 { font-size: 1.4rem; margin-bottom: 4px; }
.step-intro { font-size: 0.95rem; margin-bottom: 24px; }

.question-block {
  border: none;
  padding: 0;
  margin: 0 0 26px;
}
.question-block legend {
  font-weight: 600;
  color: var(--color-text);
  padding: 0 0 10px;
  font-size: 1rem;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.option-pill {
  position: relative;
}
.option-pill input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.option-pill label {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  min-height: 44px;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.93rem;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  user-select: none;
}
.option-pill label:hover { border-color: var(--color-primary-light); }
.option-pill input:checked + label {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.option-pill input:focus-visible + label {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
}

.optional-field {
  margin-bottom: 18px;
}
.optional-field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.optional-field input, .optional-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  font-family: var(--font-body);
  background: #fff;
  color: var(--color-text);
}
.optional-field .helper-text {
  font-size: 0.84rem;
  color: var(--color-text-muted);
  margin-top: 6px;
}

.checker-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}

.validation-msg {
  font-size: 0.86rem;
  color: var(--color-danger);
  margin: -14px 0 18px;
  display: none;
}
.validation-msg.is-visible { display: block; }

.saved-data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--color-text-muted);
  margin-top: 18px;
  flex-wrap: wrap;
}
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-primary);
  font-size: 0.84rem;
  cursor: pointer;
  text-decoration: underline;
}

/* ==========================================================================
   Results
   ========================================================================== */
.results-card { display: none; }
.results-card.is-active { display: block; animation: fade-in 0.3s ease; }

.score-hero {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 28px;
}

.score-ring-wrap { position: relative; width: 156px; height: 156px; flex: 0 0 auto; }
.score-ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring-track { fill: none; stroke: var(--color-surface-2); stroke-width: 12; }
.score-ring-fill {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 439.8;
  stroke-dashoffset: 439.8;
  transition: stroke-dashoffset 1s ease, stroke 0.4s ease;
}
.score-ring-number {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-ring-number .num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; }
.score-ring-number .max { font-size: 0.8rem; color: var(--color-text-muted); }

.score-meta { flex: 1 1 240px; }
.score-meta .score-tag {
  display: inline-block;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 4px 0;
}
.score-meta p { margin: 6px 0 0; }

.readiness-label { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 4px; }

.category-breakdown { margin-bottom: 30px; }
.category-row { margin-bottom: 16px; }
.category-row-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.category-row-label strong { color: var(--color-text); }
.category-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--color-surface-2);
  overflow: hidden;
}
.category-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--color-primary-light);
  width: 0;
  transition: width 1s ease;
}

.two-col-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
}
@media (max-width: 640px) {
  .two-col-lists { grid-template-columns: 1fr; }
}

.finding-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.94rem;
}
.finding-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px dashed var(--color-border);
}
.finding-list li:last-child { border-bottom: none; }
.finding-mark { flex: 0 0 auto; font-weight: 700; }
.finding-list.improve .finding-mark { color: var(--color-danger); }
.finding-list.strong .finding-mark { color: var(--color-accent); }

.recommendations {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 30px;
}
.recommendations h3 { margin-bottom: 12px; }
.recommendations ul { margin: 0; padding-left: 20px; }
.recommendations li { margin-bottom: 10px; font-size: 0.94rem; color: var(--color-text); }
.recommendations li:last-child { margin-bottom: 0; }

.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.results-disclaimer {
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 18px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--color-text);
  color: #cbd2e6;
  padding: 44px 0 26px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.site-footer h4 {
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.site-footer p { color: #aab2c9; font-size: 0.9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #cbd2e6; text-decoration: none; font-size: 0.9rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #2c334a;
  padding-top: 18px;
  font-size: 0.82rem;
  color: #8590ac;
}

/* ==========================================================================
   Static content pages
   ========================================================================== */
.page-hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.content-page {
  padding: 44px 0 64px;
}
.content-page .container { max-width: 820px; }
.content-page h2 { margin-top: 2em; }
.content-page h2:first-child { margin-top: 0; }
.content-page ul, .content-page ol { color: var(--color-text-muted); }
.content-page li { margin-bottom: 6px; }

.contact-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 34px;
  max-width: 460px;
}
.contact-card h2 { margin-bottom: 6px; }
.contact-email {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 10px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

/* Print */
@media print {
  .site-header, .site-footer, .checker-nav, .results-actions, .hero .btn-row,
  .nav-toggle { display: none !important; }
  body { background: #fff; }
  .checker-card { box-shadow: none; border: none; padding: 0; }
}
