/* FamilyShield Online — shared design system
   Signature: "the beacon" — a lighthouse-beam sweep used as a section
   divider and in the wordmark. Palette is deliberately calm (deep pine +
   warm amber) rather than the red-alert look most safety sites default to,
   because the audience is already anxious and doesn't need the page
   shouting at them too. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Public+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #F5F4EF;
  --surface: #FFFFFF;
  --surface-tint: #EFEEE6;
  --ink: #1E2B2A;
  --ink-soft: #4C5C5A;
  --line: #DEDACB;
  --primary: #1F4A48;
  --primary-dark: #143332;
  --primary-tint: #E7EFEC;
  --accent: #E2A33D;
  --accent-dark: #B9800F;
  --alert: #B8432E;
  --alert-tint: #FBEAE5;
  --safe: #4F7F5E;
  --safe-tint: #EAF2EA;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20,51,50,0.06), 0 8px 24px rgba(20,51,50,0.06);
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--primary-dark); line-height: 1.15; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.5em; }
img, svg { max-width: 100%; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-dark);
  margin-bottom: 10px;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--accent); display: inline-block; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 62ch; }

/* Beacon divider — the signature motif */
.beacon-divider { position: relative; height: 34px; margin: 8px 0 0; overflow: hidden; }
.beacon-divider svg { width: 100%; height: 100%; display: block; }

/* Skip link */
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* Header / nav */
.site-header { background: var(--primary-dark); color: #fff; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 24px; max-width: var(--max); margin: 0 auto; }
.wordmark { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.wordmark svg { flex-shrink: 0; }
.wordmark:hover { color: var(--accent); }
.primary-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; }
.primary-nav a.nav-link, .primary-nav button.nav-link { color: #D9E5E1; text-decoration: none; font-size: 0.88rem; font-weight: 600; padding: 8px 10px; border-radius: 8px; white-space: nowrap; background: none; border: none; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.primary-nav a.nav-link:hover, .primary-nav a.nav-link.active,
.primary-nav button.nav-link:hover, .primary-nav button.nav-link.active { background: rgba(255,255,255,0.1); color: #fff; }
.nav-dropdown-toggle::after { content: "▾"; font-size: 0.75em; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,0.3); color: #fff; border-radius: 8px; padding: 8px 12px; font-weight: 700; }
.region-strip { background: var(--primary); color: #EAF1EE; font-size: 0.82rem; }
.region-strip .container { display: flex; gap: 16px; padding: 6px 24px; flex-wrap: wrap; }
.region-strip button { background: none; border: none; color: inherit; font: inherit; font-weight: 700; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.region-strip button[aria-pressed="true"] { background: rgba(255,255,255,0.16); }

/* Nav dropdowns — desktop: floating panel under the toggle */
.nav-dropdown { position: relative; }
.nav-dropdown-menu { display: none; position: absolute; top: 100%; left: 0; margin-top: 6px; background: var(--primary-dark); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; flex-direction: column; z-index: 110; }
.nav-dropdown.open .nav-dropdown-menu { display: flex; }
.nav-dropdown-link { color: #D9E5E1; text-decoration: none; font-size: 0.9rem; font-weight: 600; padding: 10px 12px; border-radius: 8px; white-space: nowrap; }
.nav-dropdown-link:hover, .nav-dropdown-link.active { background: rgba(255,255,255,0.12); color: #fff; }

@media (max-width: 880px) {
  .primary-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--primary-dark); flex-direction: column; align-items: stretch; padding: 8px; display: none; box-shadow: var(--shadow); }
  .primary-nav.open { display: flex; }
  .primary-nav a.nav-link, .primary-nav button.nav-link { padding: 12px; width: 100%; justify-content: space-between; }
  .nav-toggle { display: block; }
  .site-header { position: sticky; }
  /* Mobile: dropdowns become inline accordions instead of floating panels */
  .nav-dropdown { width: 100%; }
  .nav-dropdown-menu { display: none; position: static; box-shadow: none; background: rgba(0,0,0,0.15); margin-top: 0; }
  .nav-dropdown.open .nav-dropdown-menu { display: flex; }
  .nav-dropdown-link { padding-left: 24px; }
}

/* Hero */
.hero { padding: 56px 0 40px; }
.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero-art { justify-self: end; }
@media (max-width: 880px) { .hero .container { grid-template-columns: 1fr; } .hero-art { justify-self: start; order: -1; max-width: 280px; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 0.95rem; text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--primary-dark); }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { border-color: var(--primary); color: var(--primary-dark); background: transparent; }
.btn-outline:hover { background: var(--primary-tint); }
.btn-alert { background: var(--alert); color: #fff; }
.btn-alert:hover { background: #942f1e; }

/* Sections */
section { padding: 44px 0; }
.section-alt { background: var(--surface); }
.section-tint { background: var(--primary-tint); }
.section-head { max-width: 68ch; margin-bottom: 28px; }
.tool-group-label { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 12px; }

/* Cards */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 920px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin-bottom: 8px; }
.card-flag { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }

.scam-mockup { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin: 14px 0; background: var(--surface); font-size: 0.85rem; }
.scam-mockup-bar { background: var(--surface-tint); padding: 6px 12px; font-size: 0.72rem; color: var(--ink-soft); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
.scam-mockup-body { padding: 14px; color: var(--ink); }
.scam-mockup-body p { margin: 0 0 8px; }
.scam-mockup-body p:last-child { margin-bottom: 0; }
.scam-mockup-bubble { background: var(--primary-tint); border-radius: 14px; padding: 10px 14px; display: inline-block; max-width: 90%; }
.scam-mockup-bubble + .scam-mockup-bubble { margin-top: 6px; }
.scam-mockup-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.scam-flag { background: var(--alert-tint); color: var(--alert); padding: 1px 5px; border-radius: 4px; font-weight: 700; }
.teen-theme .scam-mockup { background: var(--surface); border-color: var(--line); }
.teen-theme .scam-mockup-bar { background: var(--surface-tint); }

.now-card { background: var(--surface); border-left: 4px solid var(--alert); border-radius: var(--radius-sm); padding: 18px 20px; }
.now-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.now-card a { font-weight: 700; font-size: 0.9rem; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.pill { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }

/* Numbered stage list — used only for genuine sequences */
.stage-list { display: grid; gap: 14px; counter-reset: stage; }
.stage { display: grid; grid-template-columns: 44px 1fr; gap: 16px; }
.stage-num { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; }

/* Table */
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
th { background: var(--primary-tint); color: var(--primary-dark); font-family: var(--font-body); }
.table-scroll { overflow-x: auto; border-radius: var(--radius); }

/* Contact list */
.contact-region { scroll-margin-top: 170px; margin-bottom: 40px; }
.contact-region h2 { margin-bottom: 14px; }
.contact-jump { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 0.92rem; margin-bottom: 28px; }

/* Callouts */
.callout { border-radius: var(--radius); padding: 18px 20px; }
.callout-alert { background: var(--alert-tint); border: 1px solid #E9C4B9; }
.callout-safe { background: var(--safe-tint); border: 1px solid #C7DECB; }
.callout-tint { background: var(--primary-tint); border: 1px solid #CFE0DA; }

/* Ad slot */
.ad-slot { text-align: center; padding: 10px; color: var(--ink-soft); font-size: 0.75rem; }
.ad-slot .ad-box { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 24px; background: var(--surface); }

/* Breadcrumb */
.breadcrumb { font-size: 0.85rem; color: var(--ink-soft); padding: 14px 0 0; }
.breadcrumb a { color: var(--ink-soft); }
.reviewed-note { opacity: 0.75; }

/* Related pages */
.related-list { display: grid; gap: 12px; }
.related-card { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; text-decoration: none; color: var(--ink); }
.related-card:hover { border-color: var(--primary); }
.related-card strong { display: block; color: var(--primary-dark); font-family: var(--font-display); }

/* Footer */
.site-footer { background: var(--primary-dark); color: #C9D8D3; padding: 44px 0 28px; margin-top: 40px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 28px; }
.footer-grid h4 { color: #fff; font-family: var(--font-body); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; font-size: 0.92rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.14); margin-top: 32px; padding-top: 20px; font-size: 0.82rem; color: #9EB4AD; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-item summary { cursor: pointer; font-weight: 700; font-family: var(--font-display); font-size: 1.05rem; color: var(--primary-dark); }
.faq-item p { margin-top: 10px; color: var(--ink-soft); }

/* Checklist */
.check-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.check-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 4px; }
.check-list label { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; font-weight: 600; }
.check-list input { width: 20px; height: 20px; accent-color: var(--primary); flex-shrink: 0; }
.check-list li.done label { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--accent); }
.progress-track { background: var(--line); border-radius: 999px; height: 10px; overflow: hidden; margin: 14px 0; }
.progress-fill { background: var(--accent); height: 100%; width: 0%; transition: width 0.3s; }

/* Cookie banner */
.cookie-banner { position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 560px; margin: 0 auto; background: var(--primary-dark); color: #fff; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); z-index: 300; }
.cookie-banner p { font-size: 0.88rem; color: #D9E5E1; margin-bottom: 12px; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-banner.hidden { display: none; }

/* Kids Corner theme override (scoped, loaded only on kids page) */
.kids-theme { --primary: #2F6E4F; --primary-dark: #1E4B36; --accent: #F2A93B; --bg: #FBF7EC; }
.kids-theme .site-header, .kids-theme .site-footer { background: var(--primary-dark); }

/* Kids Corner */
.kid-hero { background: linear-gradient(180deg, #EAF4EC, var(--bg)); padding: 48px 0 30px; text-align: center; }
.kid-mascot { margin: 0 auto 14px; }
.golden-rules { display: grid; gap: 16px; grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) { .golden-rules { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .golden-rules { grid-template-columns: 1fr; } }
.rule-card { background: var(--surface); border: 2px solid var(--line); border-radius: 20px; padding: 20px 16px; text-align: center; }
.rule-card .rule-num { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #1E4B36; font-family: var(--font-display); font-weight: 700; margin-bottom: 10px; }
.badge-track { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0; }
.kid-badge { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--line); font-family: var(--font-display); }
.kid-badge.earned { border-color: var(--accent); background: var(--accent); color: var(--primary-dark); }
.kid-card { background: var(--surface); border: 2px solid var(--line); border-radius: 22px; padding: 28px; max-width: 640px; margin: 0 auto; }
.kid-win { border-color: var(--accent); background: var(--primary-tint); text-align: center; }
.kid-eyebrow { font-weight: 800; color: var(--primary); text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.06em; }
.kid-options { display: grid; gap: 10px; margin-top: 16px; }
.kid-option { text-align: left; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; font-size: 1rem; }
.kid-option:hover:not(:disabled) { border-color: var(--primary); }
.kid-option:disabled { cursor: default; }
.kid-option.kid-correct { border-color: var(--safe); background: var(--safe-tint); }
.kid-option.kid-wrong { border-color: var(--alert); background: var(--alert-tint); opacity: 0.7; }
.kid-feedback { margin-top: 16px; padding: 14px 16px; border-radius: 14px; font-weight: 600; }
.kid-feedback-good { background: var(--safe-tint); color: #234C30; }
.kid-feedback-try { background: var(--primary-tint); color: var(--primary-dark); }
.teen-theme .kid-feedback-good { color: #9FE8CE; }
.teen-theme .kid-feedback-try { color: #EAF3F1; }
.teen-theme .kid-eyebrow { color: var(--accent); }
.certificate { background: var(--surface); border: 3px solid var(--accent); border-radius: 20px; padding: 34px; text-align: center; max-width: 640px; margin: 0 auto; }
.certificate input { font: inherit; font-size: 1.1rem; text-align: center; border: none; border-bottom: 2px dashed var(--accent); padding: 6px; width: 60%; margin: 10px 0; background: transparent; color: inherit; }
.cert-print-only { display: none; }
.cert-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--primary-dark); margin-bottom: 6px; }
.kid-note { background: var(--safe-tint); border-radius: 14px; padding: 16px 18px; text-align: left; max-width: 640px; margin: 20px auto 0; font-size: 0.92rem; }

/* Teen Zone theme override (scoped, loaded only on teen page) */
.teen-theme {
  --bg: #121A21; --surface: #1B2530; --ink: #ECEFF1; --ink-soft: #A9B6BD;
  --line: #2A3742; --primary-tint: #1E2E31; --accent: #57D9C8; --accent-dark: #33B8A6;
  --safe-tint: #16332B; --alert-tint: #3A1F1C; --primary-dark: #0F171D;
}
.teen-theme h1, .teen-theme h2, .teen-theme h3, .teen-theme h4 { color: #F3F6F5; }
.teen-theme p, .teen-theme li { color: var(--ink); }
.teen-theme .card, .teen-theme .card-flag { background: var(--surface); border-color: var(--line); }
.teen-theme .breadcrumb, .teen-theme .breadcrumb a { color: var(--ink-soft); }
.teen-theme a { color: var(--accent); }
.teen-theme .btn-primary { background: var(--accent); color: #0F171D; }
.teen-theme .btn-primary:hover { background: var(--accent-dark); color: #fff; }
.tz-hero { padding: 54px 0 36px; background: linear-gradient(180deg, #0F171D, var(--bg)); }
.tz-dark { background: #0F171D; padding: 48px 0; }
.tz-dark h2, .tz-dark h3 { color: #fff; }
.tz-card p { color: var(--ink-soft); }
.tz-note { background: #16332B; border-radius: 14px; padding: 18px 20px; max-width: 700px; margin: 0 auto; color: #D6E8DF; font-size: 0.92rem; }
.tz-note strong { color: #fff; }
.tz-accordion { display: grid; gap: 14px; max-width: 780px; margin: 0 auto; }
.tz-details { background: var(--surface); border: 2px solid var(--line); border-radius: 18px; overflow: hidden; }
.tz-details summary { list-style: none; cursor: pointer; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tz-details summary::-webkit-details-marker { display: none; }
.tz-summary-title { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: #F3F6F5; }
.tz-summary-icon { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-tint); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700; transition: transform 0.2s; }
.tz-details[open] .tz-summary-icon { transform: rotate(45deg); }
.tz-details-body { padding: 0 22px 22px; color: var(--ink-soft); }
.tz-details-body p { color: var(--ink-soft); }
.tz-details-body li { color: var(--ink-soft); margin-bottom: 8px; }
.tz-details-body ul { margin-top: 10px; }

@media print {
  .site-header, .site-footer, .ad-slot, .cookie-banner, .beacon-divider { display: none; }

  /* Certificate-only print mode: toggled by kids.js just before window.print() */
  body.printing-cert > * { display: none !important; }
  body.printing-cert #main,
  body.printing-cert #certificate-section { display: block !important; }
  body.printing-cert main > *:not(#certificate-section) { display: none !important; }

  body.printing-cert { margin: 0; background: #fff; }
  body.printing-cert #certificate-section {
    width: 100%;
    height: 100vh;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
  }
  body.printing-cert #certificate-section .container { width: 100%; max-width: none; padding: 0; }
  body.printing-cert .certificate {
    max-width: none;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-width: 6px;
    border-radius: 0;
    page-break-inside: avoid;
  }
  body.printing-cert .cert-print-hide { display: none !important; }
  body.printing-cert .cert-print-only { display: block; }
  body.printing-cert .kid-eyebrow { font-size: 1.1rem; }
  body.printing-cert .certificate h2 { font-size: 2.6rem; }
  body.printing-cert #cert-name-display { font-size: 2.2rem !important; }
  body.printing-cert .certificate > p { font-size: 1.3rem; }

  @page { size: A4 landscape; margin: 10mm; }
}
