/* MyKidIsBad.com — shared styles. Mobile-first, no framework, CSS variables for theming. */

:root {
  --color-bg: #faf8f5;
  --color-surface: #ffffff;
  --color-text: #1f2328;
  --color-text-muted: #5b6470;
  --color-primary: #e2553a;
  --color-primary-dark: #c43f28;
  --color-primary-contrast: #ffffff;
  --color-accent: #2f6f5e;
  --color-border: #e7e2da;
  --color-danger: #c0392b;
  --color-success: #2f6f5e;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --shadow-sm: 0 2px 6px rgba(20, 20, 20, 0.07);
  --shadow-md: 0 10px 28px rgba(20, 20, 20, 0.10);
  --shadow-lg: 0 22px 54px rgba(20, 20, 20, 0.16);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --max-width: 1080px;
}

/* Light is the sitewide default and no longer follows the OS/browser's
   prefers-color-scheme — dark is opt-in only, via the theme toggle explicitly
   setting data-theme="dark" (see effects.js MKB.initThemeToggle and the early
   inline script in head.ejs/admin-head.ejs). This used to auto-follow the
   visitor's system setting, which caused a real bug after the MyKidIsBad
   rename: anyone who'd pinned "light" lost that pin when the storage key
   changed and silently landed back in dark mode. */
:root[data-theme='dark'] {
  --color-bg: #14161a;
  --color-surface: #1c1f24;
  --color-text: #f2eee8;
  --color-text-muted: #a7aeb8;
  --color-border: #2c3038;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 22px 54px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--color-bg);
  /* A faint, playful polka-dot texture — a small nod to a kid's-room feel
     without touching layout or readability. Two dot colors, gently offset. */
  background-image:
    radial-gradient(circle, rgba(226, 85, 58, 0.05) 1.6px, transparent 1.6px),
    radial-gradient(circle, rgba(47, 111, 94, 0.05) 1.6px, transparent 1.6px);
  background-size: 30px 30px, 30px 30px;
  background-position: 0 0, 15px 15px;
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
[data-theme='dark'] body {
  background-image:
    radial-gradient(circle, rgba(226, 85, 58, 0.07) 1.6px, transparent 1.6px),
    radial-gradient(circle, rgba(47, 111, 94, 0.09) 1.6px, transparent 1.6px);
}
/* Touch/tablet: kill the ~300ms tap delay + double-tap-zoom on anything tappable,
   without disabling pinch-zoom (touch-action: manipulation keeps pinch-zoom working). */
a, button, input, select, textarea, summary, .quiz-option, .quiz-age label, .tier-card, label {
  touch-action: manipulation;
}
img { max-width: 100%; display: block; }
a { color: var(--color-primary); }
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav__logo span { color: var(--color-primary); }
.nav__logo-icon {
  flex-shrink: 0;
  border-radius: 11px;
  animation: logo-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes logo-pop {
  0% { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  touch-action: manipulation;
  position: relative;
}
@media (hover: hover) and (pointer: fine) {
  .nav__link:hover { color: var(--color-text); background: var(--color-surface); }
}
.nav__link:active { color: var(--color-text); background: var(--color-surface); }
/* The single "real" call to action lives in the hero; this is a lighter-weight
   text link so the header doesn't compete with it — same destination, less shout. */
.nav__link--cta {
  color: var(--color-primary);
  font-weight: 700;
}
@media (hover: hover) and (pointer: fine) {
  .nav__link--cta:hover { color: var(--color-primary-dark); background: transparent; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px 26px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 48px;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  box-shadow: var(--shadow-md);
}
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--color-primary-dark); }
}
.btn--primary:active { background: var(--color-primary-dark); }
.btn--block { width: 100%; }
.btn--secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn--ghost {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 40px;
  text-align: center;
}
.badge {
  display: inline-block;
  background: rgba(226, 85, 58, 0.1);
  color: var(--color-primary-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.badge::before { content: '✨ '; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 54px);
  line-height: 1.1;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.hero p.lead {
  font-size: clamp(17px, 2.4vw, 20px);
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 auto 30px;
}
.hero__actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.trust-line {
  font-size: 14px;
  color: var(--color-text-muted);
}
.hero__stars { color: #e3a13a; font-size: 15px; letter-spacing: 2px; }

/* ---------- Sections ---------- */
section { padding: 44px 0; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  text-align: center;
  margin: 0 0 12px;
}
.section-sub {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
  font-size: 17px;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .grid--2 { grid-template-columns: 1fr 1fr; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
}
.card h3 { margin: 10px 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--color-text-muted); font-size: 15px; }
.card__icon { font-size: 28px; }

.pain-point {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.pain-point:last-child { border-bottom: none; }
.pain-point__mark {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(226, 85, 58, 0.12);
  color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.quote-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 22px; box-shadow: var(--shadow-md); }
.quote-card p { font-size: 16px; margin: 0 0 14px; }
.quote-card footer { font-size: 14px; color: var(--color-text-muted); font-weight: 600; }
.quote-card .stars { color: #e3a13a; margin-bottom: 10px; letter-spacing: 2px; }

.steps { counter-reset: step; }
.step { display: flex; gap: 16px; padding: 18px 0; }
.step__num {
  counter-increment: step;
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step h4 { margin: 4px 0 6px; }
.step p { margin: 0; color: var(--color-text-muted); }

.faq details {
  border-bottom: 1px solid var(--color-border);
  padding: 4px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  padding: 12px 0;
  -webkit-user-select: none;
  user-select: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 22px; color: var(--color-text-muted); transition: transform 0.2s ease, color 0.2s ease; display: inline-block; }
.faq details[open] summary::after { content: '+'; transform: rotate(45deg); color: var(--color-primary); }
@media (hover: hover) and (pointer: fine) {
  .faq summary:hover { color: var(--color-primary); }
}
.faq p { color: var(--color-text-muted); margin: 12px 0 0; animation: faq-answer-in 0.25s ease both; }
@keyframes faq-answer-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.price-box {
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
}
.price-box .amount { font-size: 48px; font-weight: 800; font-family: var(--font-display); }
.price-box .amount sup { font-size: 20px; }
.price-box ul { text-align: left; margin: 20px 0; padding: 0; list-style: none; }
.price-box li { padding: 6px 0; display: flex; gap: 10px; }
.price-box li::before { content: '\2713'; color: var(--color-accent); font-weight: 700; }

.checklist { list-style: none; padding: 0; margin: 28px auto 0; }
.checklist li { padding: 6px 0; display: flex; gap: 10px; }
.checklist li::before { content: '\2713'; color: var(--color-accent); font-weight: 700; }

.disclaimer-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.final-cta {
  text-align: center;
  background: linear-gradient(160deg, rgba(226,85,58,0.08), rgba(47,111,94,0.08));
  border-radius: var(--radius-lg);
  padding: 48px 24px;
}

footer.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 28px 0 40px;
  color: var(--color-text-muted);
  font-size: 13px;
  text-align: center;
}
footer.site-footer a { color: var(--color-text-muted); text-decoration: underline; }

/* ---------- Quiz ---------- */
.quiz-shell { max-width: 640px; margin: 0 auto; padding: 28px 0 60px; }
.quiz-progress { height: 8px; background: var(--color-border); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.quiz-progress__bar { height: 100%; background: var(--color-primary); transition: width 0.25s ease; width: 0%; }
.quiz-progress__label { font-size: 13px; color: var(--color-text-muted); margin-bottom: 24px; }
.quiz-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 28px 24px; box-shadow: var(--shadow-md); }
.quiz-card__category { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-primary); margin-bottom: 10px; }
.quiz-card h2 { font-size: 21px; line-height: 1.35; margin: 0 0 22px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  display: block;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  font-size: 15px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
@media (hover: hover) and (pointer: fine) {
  .quiz-option:hover { border-color: var(--color-primary); transform: translateY(-1px); }
}
.quiz-option:active { border-color: var(--color-primary); background: rgba(226, 85, 58, 0.05); }
.quiz-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.quiz-option {
  position: relative;
  min-height: 44px;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.quiz-option:focus-within { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.quiz-option.selected { border-color: var(--color-primary); background: rgba(226, 85, 58, 0.06); font-weight: 600; animation: option-pop 0.2s ease; }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 20px; gap: 10px; }
.quiz-nav .btn--secondary { flex: none; }
.quiz-start { text-align: center; padding: 60px 0; }
.quiz-age { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 24px 0; }
.quiz-age label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1.5px solid var(--color-border);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  position: relative;
}
@media (hover: hover) and (pointer: fine) {
  .quiz-age label:hover { transform: translateY(-1px); }
}
.quiz-age label:active { background: rgba(226,85,58,0.06); }
.quiz-age input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.quiz-age label:focus-within { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.quiz-age input:checked + span { font-weight: 700; }
.quiz-age label:has(input:checked) { border-color: var(--color-primary); background: rgba(226,85,58,0.08); }

/* Question card slide transition (JS toggles .quiz-card--enter on new question mount) */
.quiz-card { animation: card-in 0.28s ease; }
@keyframes card-in {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes option-pop {
  0% { transform: scale(0.97); }
  50% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

/* ---------- Report ---------- */
.report-shell { max-width: 720px; margin: 0 auto; padding: 32px 0 60px; }
.report-band {
  text-align: center;
  padding: 28px 20px;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.report-band__score { font-size: 40px; font-weight: 800; font-family: var(--font-display); margin: 6px 0; }
.report-band__label { font-size: 20px; font-weight: 700; }
.category-bars { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.category-bar__label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.category-bar__track { height: 10px; background: var(--color-border); border-radius: 999px; overflow: hidden; }
.category-bar__fill { height: 100%; background: var(--color-accent); }

.locked-teaser {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  margin: 10px 0;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 14px;
  background: var(--color-bg);
}
.paywall-cta {
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  padding: 28px 24px;
  margin: 28px 0 10px;
}

.report-section { margin: 28px 0; }
.report-section h3 { font-size: 19px; margin-bottom: 10px; }
.action-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.action-item:last-child { border-bottom: none; }
.action-item__num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--color-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.callout { background: rgba(47, 111, 94, 0.08); border: 1px solid rgba(47, 111, 94, 0.25); border-radius: var(--radius-sm); padding: 16px 18px; font-size: 15px; }
.callout--warn { background: rgba(226, 85, 58, 0.08); border-color: rgba(226, 85, 58, 0.25); }

.save-email-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.save-email-form input[type=email] {
  flex: 1 1 220px;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: 16px; /* 16px+ stops iOS Safari auto-zooming the page on focus */
  background: var(--color-bg);
  color: var(--color-text);
}

.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(0,0,0,0.15); border-top-color: var(--color-primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { background: linear-gradient(90deg, var(--color-border) 25%, rgba(0,0,0,0.03) 37%, var(--color-border) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

@media (max-width: 480px) {
  .quiz-nav { flex-direction: column-reverse; }
  .quiz-nav .btn { width: 100%; }
}

/* ---------- Tier picker ---------- */
.tier-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin: 28px 0; text-align: left; }
@media (min-width: 640px) { .tier-grid { grid-template-columns: repeat(3, 1fr); } }
.tier-card {
  display: block;
  width: 100%;
  font-family: inherit;
  text-align: left;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  opacity: 0;
  animation: card-rise 0.4s ease forwards;
}
@media (hover: hover) and (pointer: fine) {
  .tier-card:hover { border-color: var(--color-primary); transform: translateY(-3px); box-shadow: var(--shadow-md); }
}
.tier-card:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.tier-card:active { border-color: var(--color-primary); transform: translateY(-1px) scale(0.99); }
.tier-card.selected { border-color: var(--color-primary); box-shadow: var(--shadow-md); }
@keyframes card-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.tier-grid .tier-card:nth-child(1) { animation-delay: 0.02s; }
.tier-grid .tier-card:nth-child(2) { animation-delay: 0.1s; }
.tier-grid .tier-card:nth-child(3) { animation-delay: 0.18s; }
.tier-card__badge {
  position: absolute; top: -11px; right: 16px;
  background: var(--color-primary); color: #fff;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 4px 10px; border-radius: 999px;
}
.tier-card h4 { margin: 4px 0 4px; font-size: 18px; }
.tier-card .tier-count { font-size: 13px; color: var(--color-text-muted); margin-bottom: 10px; }
.tier-card p { color: var(--color-text-muted); font-size: 14px; margin: 0; }
.tier-card .tier-price { font-weight: 700; color: var(--color-primary-dark); margin-top: 10px; font-size: 15px; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal--delay-1.in-view { transition-delay: 0.08s; }
.reveal--delay-2.in-view { transition-delay: 0.16s; }
.reveal--delay-3.in-view { transition-delay: 0.24s; }

/* ---------- Hero background blobs ---------- */
.hero { position: relative; overflow: hidden; }
.hero__blobs { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.35;
  animation: blob-float 14s ease-in-out infinite;
}
.hero__blob--1 { width: 280px; height: 280px; background: var(--color-primary); top: -80px; left: 8%; }
.hero__blob--2 { width: 220px; height: 220px; background: var(--color-accent); top: 40px; right: 10%; animation-duration: 18s; animation-delay: -4s; }
.hero__blob--3 { width: 180px; height: 180px; background: #e3a13a; bottom: -60px; left: 40%; animation-duration: 16s; animation-delay: -8s; }
.hero .container { position: relative; z-index: 1; }
@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -24px) scale(1.08); }
  66% { transform: translate(-16px, 14px) scale(0.94); }
}

/* CTA glow to draw the eye without being obnoxious */
.hero__actions .btn--primary { animation: cta-glow 2.6s ease-in-out infinite; }
@keyframes cta-glow {
  0%, 100% { box-shadow: var(--shadow-md); }
  50% { box-shadow: 0 8px 28px rgba(226, 85, 58, 0.45); }
}

/* ---------- Knowledge base / article prose ---------- */
.prose { font-size: 16px; line-height: 1.7; color: var(--color-text); }
.prose h2 { font-size: 21px; margin: 32px 0 12px; font-family: var(--font-display); }
.prose h3 { font-size: 17px; margin: 24px 0 10px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 10px; }
.prose strong { color: var(--color-text); }
a.card { transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) {
  a.card:hover { border-color: var(--color-primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
}
a.card:active { border-color: var(--color-primary); transform: translateY(0) scale(0.99); }

/* ---------- Locked teaser hover ---------- */
.locked-teaser { transition: border-color 0.15s ease, transform 0.15s ease; }
@media (hover: hover) and (pointer: fine) {
  .locked-teaser:hover { border-color: var(--color-primary); transform: translateX(2px); }
}

/* ---------- Rotating loading messages ---------- */
.loading-messages { position: relative; height: 1.4em; margin-top: 4px; }
.loading-messages span {
  position: absolute; inset: 0;
  opacity: 0;
  color: var(--color-text-muted);
  animation: loading-cycle 6s ease infinite;
}
.loading-messages span:nth-child(2) { animation-delay: 1.5s; }
.loading-messages span:nth-child(3) { animation-delay: 3s; }
.loading-messages span:nth-child(4) { animation-delay: 4.5s; }
@keyframes loading-cycle {
  0%, 4% { opacity: 0; transform: translateY(4px); }
  8%, 20% { opacity: 1; transform: translateY(0); }
  25%, 100% { opacity: 0; transform: translateY(-4px); }
}

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

/* Visually hidden but still reachable by screen readers — for labels on inputs whose
   visible cue is a placeholder or surrounding context rather than a printed label. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-content link: hidden until focused, then pinned to the top-left. */
.skip-link {
  position: absolute;
  top: -48px; left: 8px;
  z-index: 1000;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 8px;
}

@media (prefers-contrast: more) {
  :root {
    --color-text-muted: var(--color-text, #1a1a1a);
  }
  a, .nav__link {
    text-decoration: underline;
  }
  .btn, .tier-card, .admin-card, .stat-card, input, textarea, select {
    border: 1px solid currentColor;
  }
  a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline-width: 3px;
  }
}

/* ---------- Report unlock celebration ---------- */
.unlock-toast {
  position: fixed;
  top: 18px; left: 50%;
  transform: translate(-50%, -12px);
  background: var(--color-accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  opacity: 0;
  animation: toast-in 0.4s ease forwards, toast-out 0.4s ease 2.6s forwards;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translate(-50%, -12px); } }

/* ---------- Specials / sale pricing ---------- */
.price-regular { color: var(--color-text-muted); text-decoration: line-through; font-weight: 500; margin-right: 2px; }
.price-sale { color: var(--color-primary-dark); font-weight: 700; }
.tier-card__badge--popular { background: var(--color-accent); }

/* ---------- Trust badges (paywall / pricing reassurance row) ---------- */
.trust-badges {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px;
  font-size: 12.5px; color: var(--color-text-muted);
}

/* ---------- Coupon input (deep prepay + report paywall) ---------- */
.coupon-row { display: flex; gap: 8px; }
.coupon-row input[type=text] {
  flex: 1 1 auto; min-height: 44px; padding: 10px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  font-size: 16px; background: var(--color-bg); color: var(--color-text);
  text-transform: uppercase; letter-spacing: 0.02em;
}
.coupon-row .btn { padding: 10px 16px; min-height: 44px; }

/* ---------- Free-text quiz inputs (context step + adaptive follow-ups) ---------- */
.quiz-card textarea, .quiz-start textarea {
  width: 100%; min-height: 84px; padding: 12px 14px; resize: vertical;
  border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  font: inherit; font-size: 16px; background: var(--color-bg); color: var(--color-text);
}
.quiz-card textarea:focus, .quiz-start textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }

/* ---------- Sticky mobile CTA (landing page) ---------- */
.sticky-cta { display: none; }
.sticky-cta-spacer { display: none; }
@media (max-width: 640px) {
  .sticky-cta {
    display: flex; justify-content: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -6px 18px rgba(0,0,0,0.08);
  }
  .sticky-cta .btn { width: 100%; max-width: 420px; }
  .sticky-cta-spacer { display: block; height: 74px; }
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__blob { animation: none; opacity: 0.2; }
}

/* ---------- Print ---------- */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .report-band, .card, .callout, .locked-teaser, .action-item, .quiz-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
  a[href]::after { content: ''; }
  .container { max-width: 100%; padding: 0; }
  .report-shell { padding: 0; }
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 18px; bottom: 18px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 500;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
@media print { .back-to-top { display: none !important; } }

/* ---------- Theme toggle ---------- */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  cursor: pointer;
  color: var(--color-text);
  margin-left: 4px;
}

/* ---------- Character counter (quiz free-text fields) ---------- */
.char-counter {
  font-size: 11.5px;
  color: var(--color-text-muted);
  text-align: right;
  margin-top: 4px;
}
.char-counter.is-near-limit { color: var(--color-danger); }

/* The Parent Academy teaser on the report page (see partials/report-content.ejs) —
   deliberately understated (dashed border, secondary button) so it reads as a quiet
   "by the way" rather than competing with the report's own paywall CTA above it. */
.academy-teaser { text-align: left; }
.academy-teaser__inner { background: var(--color-surface); border: 1px dashed var(--color-border); border-radius: var(--radius-md); padding: 18px; }
