/* Monetific — global styles.
 *
 * Colour tokens are chosen for contrast, not for looks: every text token below
 * clears 4.5:1 on its background (3:1 for large text). The usual Lighthouse
 * failures on a site like this are light-grey hint text and tinted status
 * badges, so the muted and badge tokens are deliberately darker than the
 * shades a designer would reach for first.
 */

:root {
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --bg-raised: #ffffff;
  --border: #e4e7ec;

  --text: #101828;
  --text-muted: #4b5563; /* 7.5:1 on white */
  --text-hint: #667085; /* 4.9:1 on white — do not lighten */

  --brand: #0b6bcb;
  --brand-dark: #08529c;
  --brand-tint: #eff6ff;

  --critical: #b42318;
  --critical-tint: #fef3f2;
  --warning: #b54708;
  --warning-tint: #fffaeb;
  --ok: #047857; /* 5.2:1 on --ok-tint; the -600 shade fails */
  --ok-tint: #ecfdf5;

  --radius: 10px;
  --max-width: 68rem;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c111d;
    --bg-subtle: #131a29;
    --bg-raised: #161d2c;
    --border: #2b3448;

    --text: #f2f4f7;
    --text-muted: #cbd5e1;
    --text-hint: #98a2b3;

    --brand: #63a4ff;
    --brand-dark: #8cbcff;
    --brand-tint: #10233d;

    --critical: #fda29b;
    --critical-tint: #2b1412;
    --warning: #fec84b;
    --warning-tint: #2a1c08;
    --ok: #6ce9a6;
    --ok-tint: #0a231a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 2rem 0 0.75rem;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-top: 0;
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.narrow {
  max-width: 46rem;
}

/* --- header / footer ---------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 62px;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand span {
  color: var(--brand);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--text);
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2.5rem 0;
  color: var(--text-hint);
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}

/* --- primitives --------------------------------------------------------- */

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 0.7rem 1.15rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

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

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--brand);
}

.btn-ghost:hover {
  background: var(--brand-tint);
  color: var(--brand-dark);
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.quick-answer {
  background: var(--brand-tint);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 0 0 1.75rem;
  font-size: 1.05rem;
}

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge-critical {
  background: var(--critical-tint);
  color: var(--critical);
  border-color: var(--critical);
}

.badge-warning {
  background: var(--warning-tint);
  color: var(--warning);
  border-color: var(--warning);
}

.badge-ok {
  background: var(--ok-tint);
  color: var(--ok);
  border-color: var(--ok);
}

.meta {
  color: var(--text-hint);
  font-size: 0.9rem;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  background: var(--bg-subtle);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

.prose h2 {
  scroll-margin-top: 5rem;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 0.5rem;
  z-index: 100;
  background: var(--bg-raised);
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* --- approval checker ---------------------------------------------------
 * Hero, score card and result grid for /tools/adsense-approval-checker.
 * Plain CSS on the tokens above (dark mode comes free). Radii are the shared
 * --radius or 4px: no pill shapes here.
 */

.tone-ok {
  --tone: var(--ok);
  --tone-tint: var(--ok-tint);
}

.tone-warning {
  --tone: var(--warning);
  --tone-tint: var(--warning-tint);
}

.tone-critical {
  --tone: var(--critical);
  --tone-tint: var(--critical-tint);
}

.tag {
  display: inline-block;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--tone, var(--border));
  color: var(--tone, var(--text-muted));
  background: var(--tone-tint, var(--bg-subtle));
}

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(var(--bg-subtle), var(--bg));
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-size: 32px 32px;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
}

.hero-inner {
  position: relative;
  max-width: 50rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 3rem;
  text-align: center;
}

.hero-inner .quick-answer {
  text-align: left;
}

.search-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 40rem;
  margin: 0 auto;
  padding: 0.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px -12px rgba(16, 24, 40, 0.18);
}

.search-box:focus-within {
  border-color: var(--brand);
}

.search-box input {
  flex: 1 1 15rem;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
}

.search-box input:focus-visible {
  outline: none;
}

.hero-note {
  margin: 0.9rem 0 0;
}

.results {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 0;
}

.score-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.score-main {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1 1 22rem;
}

.score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 6.5rem;
  height: 6.5rem;
  border: 2px solid var(--tone, var(--border));
  border-radius: var(--radius);
  color: var(--tone, var(--text));
  background: var(--tone-tint, var(--bg-subtle));
}

.score-num {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
}

.score-of {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.score-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.score-head h2 {
  margin: 0;
}

.score-summary {
  margin: 0;
  color: var(--text-muted);
}

.stat-grid {
  display: grid;
  /* auto-fit: the free report has three boxes (no pass count), the full one four. */
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: 0.6rem;
  flex: 1 1 20rem;
  margin: 0;
}

@media (max-width: 40rem) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat {
  padding: 0.6rem 0.8rem;
  text-align: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat dt {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.stat dd {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--tone, var(--text));
}

.filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 1.5rem;
  padding: 0.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-btn {
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn[aria-pressed="true"] {
  font-weight: 600;
  color: var(--text);
  background: var(--bg-raised);
  border-color: var(--border);
}

.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
}

.group-head h3 {
  margin: 0;
}

.check-grid {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}

.check-card {
  padding: 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.check-card.tone-warning,
.check-card.tone-critical {
  background: var(--tone-tint);
  border-color: var(--tone);
}

.check-title {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 0.4rem;
  font-weight: 600;
  line-height: 1.35;
}

.check-card p:not(.check-title) {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.check-card p:last-child {
  margin-bottom: 0;
}

/* A group the free report leaves out: a dashed card where its checks would be. */
.locked-card {
  max-width: 36rem;
  background: var(--bg-subtle);
  border-style: dashed;
}

.locked-card p:not(.check-title) {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
}

.folded > summary {
  margin: 0.75rem 0;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
}

.cta-band {
  margin-top: 2.5rem;
  padding: 2rem;
  background: var(--brand-tint);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.cta-band h3 {
  margin-top: 0;
}

.split {
  display: grid;
  gap: 3rem;
  grid-template-columns: 5fr 7fr;
}

.split > * {
  min-width: 0;
}

@media (max-width: 56rem) {
  .split {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.faq-item {
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.9rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.faq-item dt {
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.faq-item dd {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.97rem;
}

/* Text inputs on the sign-in and sign-up forms. */
.field {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
}

/* Scripts show and hide blocks with the hidden attribute; a class that sets
   display must never override it. */
[hidden] {
  display: none !important;
}
