/* Itam Kids – foglio di stile del sito
   Quaderno a quadretti di giorno (tema chiaro), lavagna di sera (tema scuro): segue il telefono.
   Nessuno stile in linea nelle pagine: la CSP permette solo questo file. */

@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/fredoka-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/fredoka-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/fredoka-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }

:root {
  --paper: #FAFCFF;
  --grid: rgba(64, 118, 204, .10);
  --ink: #22304A;
  --ink-soft: #56627C;
  --card: #FFFFFF;
  --line: #D7DFEC;
  --chip: #EEF3FB;
  --link: #1D5BB5;
  --red: #E8453C;
  --orange: #F3961A;
  --green: #2FA24A;
  --blue: #2F7FD8;
  --yellow: #FFD23F;
  --purple: #8E5CC2;
  --ok-bg: #E3F5E6;
  --ok-ink: #1C6B2E;
  --err-bg: #FDE7E5;
  --err-ink: #A8291F;
  --tag-bg: #FFD23F;
  --tag-ink: #22304A;
  --shadow: 0 10px 28px rgba(20, 30, 60, .14);
  --display: "Fredoka", "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1E2925;
    --grid: rgba(235, 245, 238, .05);
    --ink: #EEF3EC;
    --ink-soft: #AAB8B0;
    --card: #26332E;
    --line: #3A4A43;
    --chip: #2F3D37;
    --link: #8CC0FF;
    --red: #FF6A5E;
    --orange: #FFAA3B;
    --green: #5CC871;
    --blue: #6EABF3;
    --yellow: #FFD84F;
    --purple: #B78FEC;
    --ok-bg: #1F3D2A;
    --ok-ink: #A5E6B3;
    --err-bg: #4A2422;
    --err-ink: #FFB4AC;
    --shadow: 0 10px 28px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden]{display:none !important}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 80px); }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; text-wrap: balance; margin: 0; }
h1 { font-weight: 700; font-size: clamp(32px, 5.2vw, 54px); }
h2 { font-weight: 700; font-size: clamp(27px, 3.6vw, 40px); }
h3 { font-weight: 600; font-size: 21px; }
p { margin: 0; }

.sprite, .defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--yellow); color: #22304A; font-family: var(--display); font-weight: 600; padding: 8px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 10px); }
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- logo ---------- */
.logo { position: relative; display: inline-block; width: var(--logo-w, 320px); padding-bottom: calc(var(--logo-w, 320px) * .23); }
.logo--top { --logo-w: 84px; }
.logo--hero { --logo-w: min(380px, 70vw); }
.logo--small { --logo-w: 120px; }
/* "Itam" è la scritta vera di una bambina, ricalcata dalla foto (pennarello): una forma piena per lettera */
.itam { display: block; width: 100%; height: auto; overflow: visible; fill-rule: evenodd; }
.itam .l-i { fill: var(--red); }
.itam .l-t { fill: var(--orange); }
.itam .l-a { fill: var(--green); }
.itam .l-m { fill: var(--blue); }
.kids {
  position: absolute; right: -12%; bottom: 0;
  font-family: var(--display); font-weight: 700; font-size: calc(var(--logo-w, 320px) * .16); line-height: 1.05;
  color: var(--tag-ink); background: var(--tag-bg);
  border: max(2px, calc(var(--logo-w, 320px) * .011)) solid var(--tag-ink); border-radius: .28em;
  padding: .04em .36em .1em; transform: rotate(-6deg); box-shadow: .07em .09em 0 var(--tag-ink);
}
/* Le lettere arrivano una dopo l'altra, come scritte a mano */
.scrive path { transform-box: fill-box; transform-origin: 50% 100%; animation: lettera .42s cubic-bezier(.2, 1.5, .4, 1) both; }
.scrive .l-i { animation-delay: .05s; } .scrive .l-t { animation-delay: .22s; }
.scrive .l-a { animation-delay: .39s; } .scrive .l-m { animation-delay: .56s; }
@keyframes lettera { from { transform: translateY(12%) scale(.35) rotate(-10deg); opacity: 0; } }
.scrive ~ .kids { animation: etichetta .45s cubic-bezier(.2, 1.6, .4, 1) .85s both; }
@keyframes etichetta { from { transform: rotate(-20deg) scale(.3); opacity: 0; } }

/* ---------- testata ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 2px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top .wrap { display: flex; align-items: center; gap: 16px; padding-block: 10px; min-width: 0; }
.top__brand { flex: none; display: inline-flex; text-decoration: none; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; margin-left: auto; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--ink-soft); text-decoration: none; padding: 7px 12px; border-radius: 999px; }
.nav a:hover { color: var(--ink); background: var(--chip); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--chip); box-shadow: inset 0 0 0 2px var(--line); }
.nav a.nav__cta { background: var(--yellow); color: #22304A; }

/* ---------- elementi comuni ---------- */
section { padding-block: 64px 16px; }
.eyebrow { margin: 0 0 8px; font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.intro { margin: 12px 0 30px; max-width: 62ch; color: var(--ink-soft); font-size: 18px; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: 20px; min-width: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.1;
  color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 999px;
  padding: 10px 22px; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--ink-soft); }
.btn--primary { background: var(--yellow); border-color: var(--yellow); color: #22304A; box-shadow: 0 3px 0 rgba(34, 48, 74, .25); }
.btn--primary:hover { border-color: #22304A; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: default; box-shadow: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--display); font-weight: 500; font-size: 14px; padding: 4px 12px; border-radius: 999px; background: var(--chip); color: var(--ink); }
.nota { font-size: 15px; color: var(--ink-soft); }
.ico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- apertura ---------- */
.hero { padding-block: 44px 24px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; }
.hero__logo { margin-bottom: 22px; }
.hero h1 { margin-bottom: 16px; }
.hero__testo { color: var(--ink-soft); font-size: 19px; max-width: 52ch; margin-bottom: 26px; }
.store { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.store__btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 18px 8px 14px;
  border-radius: 14px; background: #111111; color: #FFFFFF; text-decoration: none; border: 2px solid #111111;
}
.store__btn svg { width: 26px; height: 26px; }
.store__btn span { display: flex; flex-direction: column; line-height: 1.1; font-family: var(--display); font-weight: 600; font-size: 18px; }
.store__btn small { font-family: var(--body); font-weight: 400; font-size: 11px; opacity: .85; }
.store__btn[aria-disabled="true"] { opacity: .78; }
.hero__visual { position: relative; }
.hero__foto { border-radius: 26px; overflow: hidden; border: 8px solid #FFFFFF; box-shadow: var(--shadow); transform: rotate(2deg); }
.hero__fiammo { position: absolute; width: 34%; left: -8%; bottom: -10%; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .25)); transform: rotate(-6deg); }
.bolla { position: absolute; top: 7%; right: -3%; font-family: var(--display); font-weight: 700; font-size: clamp(15px, 1.8vw, 20px); background: #FFFFFF; color: #22304A; border: 3px solid #22304A; border-radius: 999px; padding: .45em 1em .5em; transform: rotate(4deg); box-shadow: 3px 4px 0 rgba(34, 48, 74, .3); }

/* ---------- come funziona ---------- */
.passi { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: passo; }
.passi li { counter-increment: passo; padding: 24px 22px; display: flex; flex-direction: column; gap: 10px; }
.passi li::before { content: counter(passo); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: #22304A; font-family: var(--display); font-weight: 700; font-size: 20px; }
.passi p { color: var(--ink-soft); }

/* ---------- fiaba di esempio ---------- */
.esempio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 26px; }
.esempio__pagine { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.esempio__pagine img { border-radius: 14px; aspect-ratio: 1; object-fit: cover; width: 100%; }
.esempio__testo { display: flex; flex-direction: column; gap: 14px; }
.esempio__testo p { color: var(--ink-soft); }
.cibi { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cibi img { width: 44px; height: 44px; object-fit: contain; background: var(--chip); border-radius: 12px; padding: 4px; }

/* ---------- categorie ---------- */
.categorie { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.categoria { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 18px; background: var(--card); border: 2px solid var(--line); min-width: 0; }
.categoria__ico { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #FFFFFF; }
.categoria__ico svg { width: 26px; height: 26px; }
.categoria__nome { display: block; font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1.2; }
.categoria__desc { display: block; font-size: 15px; color: var(--ink-soft); line-height: 1.4; margin-top: 2px; }
.c-rosso { background: #E8453C; } .c-rosa { background: #E3527F; } .c-indaco { background: #5B4BB7; }
.c-verde { background: #2FA24A; } .c-azzurro { background: #2A86C4; } .c-arancio { background: #D9780A; }
.c-viola { background: #8E5CC2; } .c-mattone { background: #B9533A; } .c-alpino { background: #2F7A8A; }

/* ---------- sicurezza ---------- */
.fiducia { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fiducia > div { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.fiducia svg { width: 30px; height: 30px; color: var(--green); }
.fiducia p { color: var(--ink-soft); font-size: 16px; }
.fiducia__link { margin-top: 22px; }

/* ---------- prezzi ---------- */
.piani { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.piano { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.piano--regalo { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--yellow); }
.piano ul { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.piano li + li { margin-top: 6px; }
.prezzi { display: grid; gap: 10px; }
.prezzo { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--chip); }
.prezzo b { font-family: var(--display); font-weight: 600; font-size: 18px; }
.prezzo strong { font-family: var(--display); font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prezzo small { display: block; color: var(--ink-soft); font-size: 14px; }
.acquisti { display: grid; gap: 12px; }
.acquisto { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--chip); }
.acquisto b { font-family: var(--display); font-weight: 600; font-size: 19px; display: block; }
.acquisto strong { font-family: var(--display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; }
.esito { min-height: 1.6em; font-size: 16px; padding: 0; border-radius: 12px; }
.esito:not(:empty) { padding: 12px 14px; }
.esito--info { background: var(--chip); color: var(--ink); }
.esito--errore { background: var(--err-bg); color: var(--err-ink); }
.pagamento-sicuro { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-soft); font-size: 15px; }
.pagamento-sicuro svg { flex: none; width: 22px; height: 22px; color: var(--green); margin-top: 2px; }

/* ---------- domande ---------- */
.domande { display: grid; gap: 10px; max-width: 820px; }
.domande details { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 0 18px; }
.domande summary { cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 18px; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 14px; }
.domande summary::-webkit-details-marker { display: none; }
.domande summary::after { content: "+"; font-size: 24px; line-height: 1; color: var(--ink-soft); }
.domande details[open] summary::after { content: "–"; }
.domande details p { padding-bottom: 16px; color: var(--ink-soft); }

/* ---------- pagine semplici (grazie, attiva, legali) ---------- */
.pagina { padding-block: 48px 40px; }
.pagina__corpo { max-width: 760px; }
.pagina__corpo > * + * { margin-top: 16px; }
.pagina__corpo h1 { margin-bottom: 8px; }
.pagina__corpo h2 { font-size: clamp(23px, 2.6vw, 29px); margin-top: 38px; }
.pagina__corpo h3 { margin-top: 24px; }
.pagina__corpo ul, .pagina__corpo ol { padding-left: 22px; }
.pagina__corpo li + li { margin-top: 6px; }
.pagina__meta { color: var(--ink-soft); font-size: 15px; }
.avviso { padding: 14px 18px; border-radius: 14px; border: 2px dashed var(--orange); background: var(--card); font-weight: 700; }
.riquadro { padding: 22px; }
.passi-app { counter-reset: p; list-style: none; padding: 0 !important; display: grid; gap: 12px; }
.passi-app li { counter-increment: p; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: start; margin: 0 !important; }
.passi-app li::before { content: counter(p); width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); color: #22304A; display: grid; place-items: center; font-family: var(--display); font-weight: 700; }
.codice-esempio { font-family: var(--mono); font-size: clamp(18px, 4.6vw, 26px); letter-spacing: .06em; padding: 14px 18px; border-radius: 14px; background: var(--chip); display: inline-block; overflow-wrap: anywhere; }
.tabella { overflow-x: auto; border: 2px solid var(--line); border-radius: 14px; background: var(--card); }
.tabella table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15.5px; }
.tabella th, .tabella td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tabella th { font-family: var(--display); font-weight: 600; background: var(--chip); }
.tabella tr:last-child td { border-bottom: 0; }
.grande-icona { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok-ink); }
.grande-icona svg { width: 44px; height: 44px; }

/* ---------- piè di pagina ---------- */
footer { margin-top: 56px; border-top: 2px solid var(--line); background: var(--paper); padding-block: 32px 40px; }
.piede { display: grid; grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr)); gap: 28px; }
.piede p { color: var(--ink-soft); font-size: 15px; margin-top: 10px; max-width: 40ch; }
.piede h3 { font-size: 16px; margin-bottom: 8px; }
.piede ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.piede__fondo { margin-top: 26px; font-size: 14px; color: var(--ink-soft); }

@media (max-width: 900px) {
  .hero__grid, .esempio, .piani { grid-template-columns: minmax(0, 1fr); }
  .hero__visual { max-width: 460px; margin: 10px auto 30px; }
  .passi, .fiducia, .categorie { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .piede { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .piede > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  body { font-size: 16.5px; }
  section { padding-block: 48px 8px; }
  .passi, .fiducia, .categorie { grid-template-columns: minmax(0, 1fr); }
  .logo--top { --logo-w: 68px; }
  .nav a { padding: 7px 8px; font-size: 14px; }
  .solo-largo { display: none; }
  .top .wrap { gap: 10px; }
  .esempio { padding: 18px; }
  .piano { padding: 20px; }
  .hero__fiammo { width: 30%; left: -3%; }
  .bolla { right: 2%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
