/* ============================================================================
   site.css — stile comune delle pagine del sito:
   home (index.html, en/index.html) e come funziona (come-funziona.html,
   en/how-it-works.html). La guida ha il suo foglio (guida.css).
   ============================================================================ */

/* --- Colori e misure --- */
:root {
  --ink: #111111;     /* testo: nero del logo */
  --brand: #56a2c7;   /* azzurro del logo: riempimenti */
  --line: #e8b84a;    /* giallo matita: solo linee e bordi */
  --blue: #2d7396;    /* stesso azzurro, scurito: testo e pulsanti (contrasto AA) */
  --blue-d: #235a77;
  --soft: #eaf4f9;
  --muted: #4f6573;
  --edge: #cfe3ee;
  --maxw: 960px;
  --fs: clamp(1.05rem, 3.6vw, 1.15rem); /* corpo testo unico, come il lead della hero */
}
@media (min-width: 1000px) {
  :root { --maxw: 1140px; }
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.55;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { text-wrap: balance; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
section { padding: 68px 0; }
.rule { border: 0; border-top: 2px solid var(--line); max-width: var(--maxw); margin: 0 auto; }

/* --- Intestazione: si rimpicciolisce scorrendo (classe .small da site.js) --- */
header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
header .bar { padding: 14px 24px 10px; transition: padding .2s; }
header.small .bar { padding-top: 6px; padding-bottom: 6px; }
.logo { display: block; line-height: 0; }
.logo img { height: 64px; width: auto; transition: height .2s; }
@media (min-width: 1000px) { .logo img { height: 76px; } }
header.small .logo img { height: 44px; }

/* Selettore lingua: la lingua corrente e' testo, l'altra un link */
.lang { font-size: .95rem; color: var(--muted); }
.lang a, .lang .attiva { padding: 2px 4px; }
.lang a { color: inherit; text-decoration: none; }
.lang a:hover { color: var(--blue); text-decoration: underline; }
.lang .attiva { color: var(--blue); font-weight: 600; }

/* --- Titoli di sezione --- */
.badge { display: inline-block; background: var(--soft); border: 1.5px solid var(--brand); color: var(--blue-d); font-weight: 700; font-size: clamp(.66rem, 3.05vw, .85rem); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; padding: 8px 14px; border-radius: 999px; margin-bottom: 20px; }
@media (min-width: 600px) { .badge { letter-spacing: .1em; } }
@media (min-width: 1000px) { .badge { font-size: .98rem; letter-spacing: .12em; } }
.eyebrow { font-size: .85rem; letter-spacing: .28em; text-transform: uppercase; color: var(--blue); margin-bottom: 14px; font-weight: 500; }
.eyebrow-clk { display: flex; align-items: center; gap: 14px; }
.eyebrow-clk .clk { flex: none; }
h2 { font-size: clamp(1.7rem, 5.5vw, 2.6rem); line-height: 1.12; font-weight: 300; letter-spacing: -.02em; margin-bottom: 12px; }
h2 strong { font-weight: 700; color: var(--blue); }
.h2b { margin-top: 44px; }
.sub { color: var(--muted); max-width: 38em; font-size: 1.05rem; }

/* --- Pulsanti --- */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-block; padding: 15px 26px; border-radius: 999px; font-weight: 500; font-size: 1rem; text-decoration: none; border: 2px solid var(--blue); transition: transform .08s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-d); border-color: var(--blue-d); }
.btn.ghost { background: #fff; color: var(--blue); }

/* Pulsante per l'app mentre si controlla che risponda (site.js):
   il testo resta, per non cambiare la larghezza, ma diventa invisibile */
.btn[aria-busy="true"] { position: relative; color: transparent; cursor: progress; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%;
  animation: gira .8s linear infinite;
}
.btn.ghost[aria-busy="true"]::after { border-color: var(--edge); border-top-color: var(--blue); }
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn[aria-busy="true"]::after { animation-duration: 2s; } }
.app-offline { flex-basis: 100%; margin-top: 10px; font-size: .95rem; color: #9a3412; }

/* ============================================================================
   Home
   ============================================================================ */

/* --- Hero --- */
.hero { padding: 52px 0 60px; }
.hero h1 { font-size: clamp(1.95rem, 7.4vw, 3.4rem); line-height: 1.1; font-weight: 300; letter-spacing: -.025em; }
.hero h1 strong { font-weight: 700; color: var(--blue); }
.lead { margin-top: 22px; font-size: var(--fs); color: var(--muted); max-width: 34em; }
.claim { margin-top: 30px; font-size: clamp(1.35rem, 5vw, 1.7rem); font-weight: 300; letter-spacing: -.015em; line-height: 1.2; color: var(--ink); }
.claim strong { font-weight: 700; color: var(--blue); }
.claimsub { margin-top: 8px; max-width: 34em; }
.who { display: flex; gap: 14px; margin-top: 18px; }
.who img { flex: 1 1 0; min-width: 0; max-width: 200px; height: auto; }

/* Stessa verifica su carta e su schermo, affiancate */
.pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 44px; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 14px; border: 1px solid var(--edge); box-shadow: 0 6px 20px rgba(45, 115, 150, .12); }
.shot figcaption { margin-top: 10px; text-align: center; font-size: .85rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 500; color: var(--blue); }
.eq { font-size: clamp(1.6rem, 6vw, 2.6rem); font-weight: 200; color: var(--blue); }
.pair-note { margin-top: 14px; text-align: center; }
@media (max-width: 560px) {
  .pair { gap: 4px; margin-left: -12px; margin-right: -12px; }
  .shot figcaption { font-size: .72rem; letter-spacing: .14em; }
}

/* PC: testo a sinistra, immagini a destra */
@media (min-width: 1000px) {
  .hero { padding: 40px 0 64px; }
  .hero .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
  .hero h1 { font-size: 2.75rem; }
  .pair { margin-top: 0; }
}

/* --- Perche' TestGENIAL: righe, non schede --- */
.whys { list-style: none; display: grid; grid-template-columns: 1fr; gap: 0 32px; margin-top: 30px; }
@media (min-width: 700px) { .whys { grid-template-columns: repeat(2, 1fr); } }
.why { border-top: 2px solid var(--line); padding: 18px 0 26px; }
.why h3 { font-size: 1.1rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

/* --- Modi di somministrazione: schede --- */
.modes { display: grid; gap: 18px; margin-top: 34px; }
@media (min-width: 760px) { .modes { grid-template-columns: repeat(2, 1fr); } }
.card { border: 2px solid var(--line); border-radius: 18px; padding: 24px 22px; background: #fff; }
.card h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; margin-bottom: 8px; }
.card p b { color: var(--ink); font-weight: 600; }
.card ul { margin: 12px 0 0 18px; }
.card li { margin-top: 5px; }
.tag { display: inline-block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; border: 1.5px solid var(--brand); color: var(--blue); border-radius: 999px; padding: 3px 10px; margin-bottom: 12px; font-weight: 600; }

/* --- 0% / 100% --- */
.zeros { display: grid; gap: 0 32px; margin-top: 30px; }
@media (min-width: 700px) { .zeros { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .zeros { grid-template-columns: repeat(4, 1fr); } }
.zero { border-top: 2px solid var(--line); padding: 18px 0 26px; }
.zero h3 { font-size: 1.1rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.zero h3 span { color: var(--blue); }
.hundred { font-size: clamp(2rem, 8vw, 3.2rem); font-weight: 300; letter-spacing: -.02em; line-height: 1.1; margin: 18px 0 24px; color: var(--ink); }
.hundred strong { font-weight: 700; color: var(--blue); }

/* --- Casi d'uso --- */
.uses { display: grid; gap: 14px; margin-top: 30px; }
@media (min-width: 640px) { .uses { grid-template-columns: repeat(2, 1fr); } }
.use { background: var(--soft); border-radius: 16px; padding: 20px 22px; display: flex; gap: 14px; align-items: flex-start; }
.tick { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); display: flex; align-items: center; justify-content: center; margin-top: -1px; }
.use h3 { font-size: 1.05rem; font-weight: 700; color: var(--blue); margin-bottom: 6px; letter-spacing: -.01em; }

/* --- Testimonianze --- */
.quotes { display: grid; gap: 18px; margin-top: 30px; }
@media (min-width: 760px) { .quotes { grid-template-columns: repeat(3, 1fr); } }
figure.q { border-left: 3px solid var(--line); padding: 4px 0 4px 18px; }
figure.q.big { grid-column: 1 / -1; background: #fff; border: 0; border-radius: 16px; padding: 26px; box-shadow: 0 2px 0 var(--edge); }
figure.q figcaption { margin-top: 8px; font-size: .92rem; color: var(--muted); }

/* --- Chiusura --- */
.final h2 { font-size: clamp(2rem, 7vw, 3.2rem); }

/* Corpo testo unico: stesso carattere del lead */
.claimsub, .pair-note, .card p, .card ul, .use p, .why p, .zero p, figure.q blockquote {
  font-size: var(--fs); font-weight: 300; color: var(--muted); line-height: 1.55;
}

/* ============================================================================
   Come funziona
   ============================================================================ */
.pagehead { padding: 56px 0 24px; }
.pagehead h1 { font-size: clamp(2rem, 7.4vw, 3.2rem); line-height: 1.1; font-weight: 300; letter-spacing: -.025em; }
.pagehead h1 strong { font-weight: 700; color: var(--blue); }
.pagehead .sub { margin-top: 18px; font-size: clamp(1.05rem, 3.6vw, 1.25rem); max-width: 34em; }
.pagehead .cta-row { margin-top: 26px; }

/* Un ambiente: testo e schermata */
.feat { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .feat { grid-template-columns: 1fr 1.1fr; gap: 56px; } }
.feat .lead2 { color: var(--muted); font-size: 1.1rem; max-width: 30em; }
.feat ul { margin: 16px 0 0 18px; color: var(--muted); }
.feat li { margin-top: 8px; }
.feat img { display: block; width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--edge); box-shadow: 0 2px 0 var(--edge); }

.also { display: grid; gap: 14px; margin-top: 30px; }
@media (min-width: 760px) { .also { grid-template-columns: repeat(3, 1fr); } }
.also > div { background: var(--soft); border-radius: 16px; padding: 20px 22px; }
.also h3 { font-size: 1.05rem; font-weight: 700; color: var(--blue); margin-bottom: 6px; }
.also p { color: var(--ink); font-size: .98rem; }

.cta-end .cta-row { margin-top: 22px; }

/* ============================================================================
   Piede e banner dei cookie (tutte le pagine)
   ============================================================================ */
footer { padding: 34px 0 54px; border-top: 2px solid var(--blue); color: var(--muted); font-size: .95rem; }
footer .links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 14px; }

#cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 18px 24px;
  background: #fff; border-top: 2px solid var(--line); box-shadow: 0 -4px 24px rgba(0, 0, 0, .08);
  font-size: .95rem; color: var(--ink);
  transition: transform .35s ease, opacity .35s ease, visibility .35s;
}
#cookie-banner.hidden { transform: translateY(110%); opacity: 0; visibility: hidden; }
@media (prefers-reduced-motion: reduce) { #cookie-banner { transition: none; } }
#cookie-banner .cb-text { flex: 1 1 300px; line-height: 1.6; }
#cookie-banner .cb-text strong { font-weight: 600; }
#cookie-banner .cb-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#cookie-banner button { cursor: pointer; font: inherit; font-weight: 500; padding: 9px 20px; border-radius: 999px; border: 2px solid var(--blue); }
#cookie-banner button:active { transform: scale(.98); }
#btn-cookie-accept { background: var(--blue); color: #fff; }
#btn-cookie-accept:hover { background: var(--blue-d); border-color: var(--blue-d); }
#btn-cookie-reject { background: #fff; color: var(--blue); }
