/* ==========================================================================
   Schoolify — shared design system (SF-1, redesign Phase 3)
   One token set + chrome components (header / footer / CTA band / proof /
   cards / buttons) for every page type. Applied additively in SF-1: this
   file is linked AFTER each page's existing CSS on core pages, and the
   canonical chrome (tools/apply_chrome.py) is styled exclusively through
   the .sf- classes below, so no page body or legacy component changes.
   SF-2 completes the consolidation: per-page inline CSS shrinks and this
   becomes the single stylesheet model (the D5 end state).
   Palette is frozen from the site's own :root (audit §2 / strategy D5):
   navy #04080f base, brand green #10b981 as the SOLID primary (gradients
   removed), indigo #4f46e5 demoted to a flat accent. Radii 8-16px; pills
   survive only on true tags/badges, never on buttons or cards.
   ========================================================================== */

:root {
  /* --- tokens (frozen SF-1) --- */
  --sf-navy: #04080f;
  --sf-deep: #060b16;
  --sf-surface: rgba(255, 255, 255, 0.04);
  --sf-surface-strong: rgba(255, 255, 255, 0.07);
  --sf-border: rgba(255, 255, 255, 0.09);
  --sf-green: #10b981;
  --sf-green-hover: #34d399;
  --sf-green-ink: #04160d;
  --sf-wa: #25d366;
  --sf-wa-hover: #1da851;
  --sf-indigo: #4f46e5;
  --sf-text: #f1f5f9;
  --sf-muted: #94a3b8;
  --sf-r-sm: 8px;
  --sf-r-md: 12px;
  --sf-r-lg: 16px;
  --sf-sp-1: 8px;
  --sf-sp-2: 16px;
  --sf-sp-3: 24px;
  --sf-sp-4: 32px;
  --sf-sp-5: 48px;
  --sf-sp-6: 64px;

  /* D5 typography: the two fonts every page already downloads (Plus
     Jakarta Sans + Outfit) are finally APPLIED by pointing the site's own
     font variables at them. Pages whose rules use var(--font-display) /
     var(--font-body) pick the real fonts up with zero per-page edits.
     tools/apply_chrome.py adds the Google Fonts <link> to pages that do
     not load the fonts yet. */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Buttons — solid colours only (no gradients), 12px radius (no pills)
   ========================================================================== */
.sf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--sf-r-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.sf-btn svg { flex: 0 0 auto; }
.sf-btn.sf-btn-primary { background: var(--sf-green); color: var(--sf-green-ink); }
.sf-btn.sf-btn-primary:hover { background: var(--sf-green-hover); color: var(--sf-green-ink); }
.sf-btn.sf-btn-whatsapp { background: var(--sf-wa); color: var(--sf-green-ink); }
.sf-btn.sf-btn-whatsapp:hover { background: var(--sf-wa-hover); color: #ffffff; }
.sf-btn.sf-btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--sf-text);
}
.sf-btn.sf-btn-ghost:hover { border-color: var(--sf-green); color: var(--sf-green-hover); }
.sf-btn.sf-btn-sm { padding: 9px 18px; font-size: 0.85rem; }
.sf-btn:focus-visible,
.sf-nav a:focus-visible,
.sf-footer a:focus-visible,
.sf-cta a:focus-visible {
  outline: 2px solid var(--sf-indigo);
  outline-offset: 2px;
}

/* ==========================================================================
   Header / nav — canonical chrome (tools/apply_chrome.py)
   Legacy hooks (#navbar, .logo-wrap, .nav-links, #menuBtn, .hamburger)
   are kept in the markup so every page's existing JS and layout CSS keep
   working; the .sf- rules own the new look.
   ========================================================================== */
.sf-nav { font-family: var(--font-body); }
.sf-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sf-sp-2);
  padding: 14px 24px;
  background: rgba(4, 8, 15, 0.95);
  border-bottom: 1px solid var(--sf-border);
}
.sf-nav .sf-logo { display: flex; align-items: center; gap: 10px; }
.sf-nav .sf-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.sf-nav .sf-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.sf-nav .sf-burger span { display: block; width: 22px; height: 2px; }
.sf-nav .sf-logo { text-decoration: none; }
.sf-nav .sf-logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--sf-text);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: currentColor;
}
.sf-nav .sf-logo-text span {
  color: var(--sf-green);
  background: none;
  -webkit-text-fill-color: currentColor;
}
.sf-nav .sf-nav-links a {
  color: var(--sf-text);
  font-weight: 500;
  text-decoration: none;
}
.sf-nav .sf-nav-links a:hover { color: var(--sf-green-hover); }
.sf-nav .sf-burger span { background: var(--sf-text); }

/* ==========================================================================
   CTA band — canonical chrome. Copy is claim-free (D1): the free plan is
   the invitation; no school counts, no percentages.
   ========================================================================== */
.sf-cta {
  padding: var(--sf-sp-6) var(--sf-sp-3);
  text-align: center;
  font-family: var(--font-body);
}
.sf-cta .sf-cta-inner { max-width: 760px; margin: 0 auto; }
.sf-cta .sf-cta-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  line-height: 1.15;
  color: var(--sf-text);
  margin: 0 0 var(--sf-sp-2);
  background: none;
  -webkit-text-fill-color: currentColor;
}
.sf-cta .sf-cta-sub {
  color: var(--sf-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 auto var(--sf-sp-4);
  max-width: 620px;
}
.sf-cta .sf-cta-btns {
  display: flex;
  gap: var(--sf-sp-2);
  justify-content: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   Footer — canonical chrome (superset of the previous generations:
   Quick Links + Resources + Legal + Contact, countries row, bottom bar)
   ========================================================================== */
.sf-footer {
  background: var(--sf-deep);
  border-top: 1px solid var(--sf-border);
  font-family: var(--font-body);
  color: var(--sf-muted);
  padding: var(--sf-sp-6) var(--sf-sp-3) var(--sf-sp-4);
}
.sf-footer .sf-footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr;
  gap: var(--sf-sp-4);
  max-width: 1200px;
  margin: 0 auto;
}
.sf-footer .sf-logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--sf-text);
}
.sf-footer .sf-logo-text span { color: var(--sf-green); }
.sf-footer .sf-footer-desc { line-height: 1.65; font-size: 0.92rem; margin: var(--sf-sp-2) 0 var(--sf-sp-3); }
.sf-footer .sf-footer-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--sf-text);
  margin: 0 0 var(--sf-sp-2);
}
.sf-footer .sf-footer-links { list-style: none; margin: 0; padding: 0; }
.sf-footer .sf-footer-links li { margin-bottom: 10px; }
.sf-footer .sf-footer-links a { color: var(--sf-muted); text-decoration: none; font-size: 0.92rem; }
.sf-footer .sf-footer-links a:hover { color: var(--sf-green-hover); }
.sf-footer .sf-socials { display: flex; gap: 10px; flex-wrap: wrap; }
.sf-footer .sf-social {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: #ffffff;
  text-decoration: none;
}
.sf-footer .sf-social--facebook { background: #1877f2; }
.sf-footer .sf-social--whatsapp { background: var(--sf-wa); color: var(--sf-green-ink); }
.sf-footer .sf-social--instagram { background: #e1306c; }
.sf-footer .sf-social--youtube { background: #ff0000; }
.sf-footer .sf-social--linkedin { background: #0a66c2; }
.sf-footer .sf-social--x { background: #000000; border: 1px solid var(--sf-border); }
.sf-footer .sf-contact-item {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; font-size: 0.92rem;
}
.sf-footer .sf-contact-item svg { color: var(--sf-green); flex: 0 0 auto; }
.sf-footer .sf-contact-item a { color: var(--sf-muted); text-decoration: none; }
.sf-footer .sf-contact-item a:hover { color: var(--sf-green-hover); }
.sf-footer .sf-footer-countries { max-width: 1200px; margin: var(--sf-sp-5) auto 0; }
.sf-footer .sf-countries-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.sf-footer .sf-countries-links a { color: var(--sf-muted); text-decoration: none; font-size: 0.9rem; }
.sf-footer .sf-countries-links a:hover { color: var(--sf-green-hover); }
.sf-footer .sf-footer-bottom {
  max-width: 1200px;
  margin: var(--sf-sp-4) auto 0;
  padding-top: var(--sf-sp-3);
  border-top: 1px solid var(--sf-border);
  display: flex;
  justify-content: space-between;
  gap: var(--sf-sp-2);
  flex-wrap: wrap;
  font-size: 0.88rem;
}
.sf-footer .sf-footer-bottom p { margin: 0; }

/* ==========================================================================
   Cards + verifiable-proof block (D1: replaces the removed testimonials
   on the homepage — facts only: the free plan, the real feature list,
   WhatsApp support. No names, no stars, no invented quotes.)
   ========================================================================== */
.sf-card {
  background: var(--sf-surface);
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-r-lg);
  padding: var(--sf-sp-4);
}
.sf-proof { padding: var(--sf-sp-6) var(--sf-sp-3); font-family: var(--font-body); }
.sf-proof .sf-proof-head { text-align: center; max-width: 620px; margin: 0 auto var(--sf-sp-5); }
.sf-proof .sf-proof-label {
  color: var(--sf-green-hover);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 var(--sf-sp-2);
}
.sf-proof .sf-proof-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  line-height: 1.15;
  color: var(--sf-text);
  margin: 0 0 var(--sf-sp-2);
}
.sf-proof .sf-proof-sub { color: var(--sf-muted); line-height: 1.6; margin: 0; }
.sf-proof .sf-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sf-sp-3);
  max-width: 1100px;
  margin: 0 auto;
}
.sf-proof .sf-proof-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--sf-text);
  margin: var(--sf-sp-2) 0 var(--sf-sp-1);
}
.sf-proof .sf-proof-card p { color: var(--sf-muted); line-height: 1.65; margin: 0; font-size: 0.95rem; }
.sf-proof .sf-proof-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--sf-r-md);
  background: rgba(16, 185, 129, 0.14);
  color: var(--sf-green-hover);
}

/* ==========================================================================
   404 page
   ========================================================================== */
.sf-404 { text-align: center; padding: var(--sf-sp-6) var(--sf-sp-3); font-family: var(--font-body); }
.sf-404 .sf-404-code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 10vw, 5.5rem);
  color: var(--sf-green);
  line-height: 1;
  margin: 0 0 var(--sf-sp-2);
}
.sf-404 h1 {
  font-family: var(--font-display);
  color: var(--sf-text);
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0 0 var(--sf-sp-2);
}
.sf-404 p { color: var(--sf-muted); max-width: 520px; margin: 0 auto var(--sf-sp-4); line-height: 1.6; }
.sf-404 .sf-404-links { display: flex; gap: var(--sf-sp-2); justify-content: center; flex-wrap: wrap; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .sf-footer .sf-footer-grid { grid-template-columns: 1fr 1fr; }
  .sf-proof .sf-proof-grid { grid-template-columns: 1fr; max-width: 560px; }
}
/* Mirrors the legacy nav breakpoint exactly (<=900px: links and actions
   hide, hamburger shows) so canonical chrome behaves identically on
   legacy pages and stands alone on pages with no legacy CSS (404). */
@media (max-width: 900px) {
  .sf-nav .sf-nav-links { display: none; }
  .sf-nav .sf-btn { display: none; }
  .sf-nav .sf-burger { display: flex; }
}
@media (max-width: 640px) {
  .sf-footer .sf-footer-grid { grid-template-columns: 1fr; }
  .sf-cta .sf-cta-btns .sf-btn { width: 100%; }
  .sf-footer .sf-footer-bottom { flex-direction: column; }
}

/* ==========================================================================
   SF-2 — core-page completion (D3/D4/D5). This sheet loads LAST on every
   core page, so these rules deliberately override the legacy per-page
   copies: gradient text/buttons become solid, the loaded fonts head the
   section titles, prose links are distinguishable by more than colour
   (WCAG link-in-text-block), the SVG icon containers get a consistent
   stroke colour/size, the floating widgets stop fighting at phone
   widths, and the aria-toggle mobile menu (inner-page generation)
   actually opens. CSS consolidation into styles.css was tested in SF-2
   and DEFERRED to SF-3: folding this file into styles.css changed a kept
   blog post's computed fonts and an inner page's height (see SF-LOG).
   ========================================================================== */

/* --- gradient text -> solid --- */
.grad {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: currentColor;
}
.stat-num {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: currentColor;
  color: #60a5fa;
}

/* --- gradient buttons -> solid brand colours --- */
.btn-primary { background: var(--sf-green); color: var(--sf-green-ink); box-shadow: 0 8px 24px rgba(16, 185, 129, 0.28); }
.btn-primary:hover { background: var(--sf-green-hover); box-shadow: 0 10px 28px rgba(16, 185, 129, 0.35); }
.btn-whatsapp { background: var(--sf-wa); color: var(--sf-green-ink); box-shadow: 0 8px 24px rgba(37, 211, 102, 0.28); }
.btn-whatsapp:hover { background: var(--sf-wa-hover); box-shadow: 0 10px 28px rgba(37, 211, 102, 0.35); }
.btn-plan { background: var(--sf-green); color: var(--sf-green-ink); box-shadow: none; }
.plan-popular { background: var(--sf-indigo); }
.new-badge { background: #f59e0b; }
.wa-float { background: var(--sf-wa); }
.sticky-demo { background: var(--sf-indigo); }

/* --- headings in the display font (legacy .section-title used the body
       variable by mistake in the shared sheet) --- */
.section-title { font-family: var(--font-display); }

/* --- hero accent line (SF-2 hero: solid colour, no gradient text) --- */
#hero h1 .hero-accent { color: var(--sf-green-hover); }

/* --- SVG icon containers (SF-2 emoji replacement): one stroke colour --- */
.fc-icon, .who-icon, .bc-icon, .lp-icon, .insight-img { color: #dfe9f5; }
.fc-icon svg { width: 22px; height: 22px; }
.who-icon svg { width: 30px; height: 30px; }
.bc-icon svg { width: 22px; height: 22px; }
.lp-icon svg { width: 24px; height: 24px; }
.insight-img svg { width: 42px; height: 42px; }

/* --- prose links distinguishable by more than colour (calculator
       link-in-text-block fix, applied to all inner-page prose) --- */
.page-content a:not(.btn-primary):not(.btn-whatsapp):not(.btn-outline):not(.btn-plan):not(.sf-btn) {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- floating widgets at phone widths: smaller, tucked into corners,
       chat panel clear of the bubble (audit 4.6) --- */
@media (max-width: 640px) {
  .wa-float { width: 48px; height: 48px; bottom: 16px; right: 16px; }
  #sfyChatBtn { width: 48px !important; height: 48px !important; bottom: 16px !important; left: 16px !important; }
  #sfyChatPanel { bottom: 74px !important; left: 16px !important; max-width: calc(100vw - 32px) !important; }
}

/* --- mobile menu completion: the inner-page generation's hamburger only
       flips aria-expanded (SF-1 leftover 5). When expanded, the canonical
       nav links open as a panel. Pages whose own script builds a
       .mobile-menu overlay (homepage generation) are suppressed by the
       last rule so the two menus never stack. --- */
@media (max-width: 900px) {
  .sf-nav:has(.sf-burger[aria-expanded="true"]) { flex-wrap: wrap; }
  .sf-nav:has(.sf-burger[aria-expanded="true"]) .sf-nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-basis: 100%;
    order: 5;
    gap: 14px;
    padding: 14px 0 8px;
  }
  .sf-nav:has(.sf-burger[aria-expanded="true"]) .sf-btn { display: inline-flex; }
  body:has(.mobile-menu.open) .sf-nav .sf-nav-links { display: none !important; }
}

/* SF-2 fix: inner-page prose-link colour (.page-content a, cyan in the
   per-page inline CSS) out-specifies .btn-primary above — restate the
   button ink colour inside prose so solid buttons stay readable. */
.page-content a.btn-primary { color: var(--sf-green-ink); }

/* --- SF-3 blog accessibility (D7): the two colour-contrast failures the
   Phase 1 audit + SF-3 local Lighthouse found on the blog index.
   .insight-meta sat at rgba(255,255,255,.35) over the card surface
   (3.2:1 at 12px); the disabled pagination button was opacity:.35
   (2.74:1). Both are lifted to AA (>=4.5:1) while staying visibly
   muted. These rules live here — not in blog.css — because this sheet
   loads after blog.css on every blog page and after the homepage's
   inline styles, so they win at equal specificity. --- */
.insight-meta { color: rgba(255, 255, 255, .62); }
.blog-pagination .pg-disabled { opacity: .62; }
