/* Pupilee base: tokens, fonts and shared components. Site and demo app both load this file. */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/fredoka-400.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/fredoka-500.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/fredoka-600.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/nunito-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/nunito-sans-600.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../fonts/nunito-sans-800.woff2') format('woff2'); }

/* ---------- Tokens ---------- */
:root {
  --azul:#2450E6; --tinta:#101B3F; --faisca:#FFC23D; --giz:#F4F6FC; --branco:#FFFFFF;
  --tinta-70: rgba(16,27,63,.7); --tinta-50: rgba(16,27,63,.5); --linha: rgba(16,27,63,.10);
  --t-ambiente:#2FA65A; --t-economia:#0E9C8C; --t-saude:#F05A5A; --t-cidadania:#FF8A2A; --t-multicultura:#D2448F; --t-ciencia:#7552EE;
  --r-card:20px; --r-btn:12px;
  --font-title:'Fredoka', 'Arial Rounded MT Bold', Arial, sans-serif; --font-text:'Nunito Sans', Arial, sans-serif;
  --shadow: 0 10px 30px rgba(16,27,63,.08);
}

/* ---------- Reset and base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-text); font-size: 17px; line-height: 1.6;
  color: var(--tinta); background: var(--branco);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }
p { margin: 0 0 1em; }
a { color: var(--azul); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
strong, b { font-weight: 800; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(36,80,230,.18); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Text helpers ---------- */
.muted { color: var(--tinta-70); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font-family: var(--font-text); font-size: .78rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; color: var(--azul);
}
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border: 2px solid transparent; border-radius: var(--r-btn);
  font-family: var(--font-title); font-weight: 600; font-size: 1.05rem; line-height: 1.1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--azul); color: var(--branco); box-shadow: 0 6px 16px rgba(36,80,230,.25); }
.btn-primary:hover { background: #1c43cc; }
.btn-secondary { background: var(--branco); color: var(--azul); border-color: var(--azul); }
.btn-secondary:hover { background: rgba(36,80,230,.06); }
.btn-ghost { background: transparent; color: var(--tinta); }
.btn-ghost:hover { background: var(--giz); }
.btn-white { background: var(--branco); color: var(--azul); }
.btn-white:hover { background: var(--giz); }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: .95rem; }
.btn-block { display: flex; width: 100%; }

/* ---------- Cards, badges, chips ---------- */
.card {
  background: var(--branco); border: 1px solid var(--linha); border-radius: var(--r-card);
  padding: 24px; box-shadow: var(--shadow);
}
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--c, var(--azul)); color: var(--branco);
  font-size: .78rem; font-weight: 800; line-height: 1.4; letter-spacing: .02em;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--giz); color: var(--tinta); border: 1px solid var(--linha);
  font-size: .88rem; font-weight: 600; line-height: 1.3;
}

/* ---------- Progress ---------- */
.progress { height: 10px; border-radius: 999px; background: var(--linha); overflow: hidden; }
.progress > .progress-bar { height: 100%; border-radius: inherit; background: var(--c, var(--azul)); transition: width .4s ease; }

/* ---------- Icon circle (trail icon on its color) ---------- */
.icon-circle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%; background: var(--c, var(--azul)); color: var(--branco);
}
.icon-circle img, .icon-circle svg { width: 22px; height: 22px; }
/* <img> icons use currentColor in the file, which renders black; this filter turns them white. */
.icon-circle img { filter: brightness(0) invert(1); }
.icon-circle.sm { width: 32px; height: 32px; }
.icon-circle.sm img, .icon-circle.sm svg { width: 16px; height: 16px; }
.icon-circle.lg { width: 64px; height: 64px; }
.icon-circle.lg img, .icon-circle.lg svg { width: 30px; height: 30px; }

/* ---------- Faísca (AI mark) ---------- */
.spark {
  display: inline-block; width: .9em; height: .9em; flex: none; vertical-align: -.08em;
  background: var(--faisca);
  -webkit-mask: url('../brand/spark.svg') center / contain no-repeat;
  mask: url('../brand/spark.svg') center / contain no-repeat;
}
