/* Il nome del marchio, l'unico posto con un font suo. Con font-display swap il
   nome si legge subito col font di sistema e cambia quando Manrope è pronto,
   invece di lasciare un buco bianco nell'header. */
@font-face {
  font-family: 'Manrope';
  src: url('/assets/manrope-extrabold.woff2') format('woff2');
  font-weight: 800; font-style: normal; font-display: swap;
}
:root {
  color-scheme: light dark;
  --fg: #0f0e0d;
  --muted: #6b655f;
  --bg: #fbf9f7;
  --scheda: #ffffff;
  --line: #e9e4de;
  --campo: #f7f4f1;
  --panno: #f3f0eb;
  --accento: #1b7f3b;
  --accento-vivo: #55b75d;
  --accento-scuro: #06180b;
  --accento-tenue: #e6f4e7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #f5f2ef;
    --muted: #a39d96;
    --bg: #0f0e0d;
    --scheda: #171513;
    --line: #2a2724;
    --campo: #141211;
    --panno: #171513;
    --accento: #6dc877;
    --accento-vivo: #55b75d;
    --accento-scuro: #06180b;
    --accento-tenue: #15301a;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main {
  max-width: 31rem;
  margin: 4rem auto;
  padding: 2.5rem;
  background: var(--scheda);
  border: 1px solid var(--line);
  border-radius: 20px;
}
main.largo { max-width: 68rem; border: 0; padding: 0 1.5rem 4rem; margin: 0 auto; }
@media (max-width: 40rem) {
  main { margin: 1.5rem 1rem; padding: 1.75rem; }
  main.largo { padding: 0 1rem 3rem; }
}

h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15;
  margin: 0 0 1.25rem; }
h2 { font-weight: 800; letter-spacing: -.02em; line-height: 1.18; }
h3 { line-height: 1.3; }
a { color: var(--accento); text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* Etichette di stato: verde per ciò che vale, rosso tenue per ciò che no. */
.badge { display: inline-block; padding: .3rem .85rem; border-radius: 999px;
  font-size: .9rem; font-weight: 550; }
.badge-ok { background: var(--accento-tenue); color: var(--accento); }
.badge-no { background: #fdeaea; color: #a23b3b; }
@media (prefers-color-scheme: dark) { .badge-no { background: #3a1a1a; color: #f3b4b4; } }

/* Righe dato: etichetta a sinistra, valore a destra, una riga per volta. */
dl { display: grid; grid-template-columns: max-content 1fr; gap: 0 2rem;
  margin: 1.75rem 0 0; padding: 0; }
dt, dd { padding: .7rem 0; border-top: 1px solid var(--line); }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 550; text-align: right; }
@media (max-width: 30rem) {
  dl { grid-template-columns: 1fr; }
  dt { padding-bottom: 0; }
  dd { text-align: left; padding-top: .15rem; border-top: 0; }
}

footer { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

p.intro { color: var(--muted); margin-top: -.5rem; }
form { display: grid; gap: 1.1rem; margin-top: 2rem; }
label { display: grid; gap: .35rem; font-size: .95rem; font-weight: 550; }
input, textarea {
  font: inherit; font-weight: 400; color: inherit; background: var(--campo);
  border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accento); outline-offset: 1px; background: var(--scheda);
}
textarea { min-height: 6rem; resize: vertical; }
button {
  font: inherit; font-size: .95rem; font-weight: 600; color: #fff;
  background: var(--accento-vivo); border: 0; border-radius: 13px;
  padding: .8rem 1.6rem; cursor: pointer; justify-self: start;
}
button:hover { filter: brightness(1.06); }
button:disabled { opacity: .6; cursor: default; }
.hint { color: var(--muted); font-size: .85rem; margin: 0; font-weight: 400; }
.errore { background: #fdeaea; color: #a23b3b; border-radius: 12px;
  padding: .8rem 1rem; margin: 1.5rem 0 0; font-size: .95rem; }
@media (prefers-color-scheme: dark) { .errore { background: #3a1a1a; color: #f3b4b4; } }
.links { margin-top: 2rem; font-size: .95rem; }

label.check { grid-template-columns: auto 1fr; align-items: start; gap: .7rem;
  font-weight: 400; }
label.check input { width: auto; margin-top: .3rem; accent-color: var(--accento-vivo); }

.bozza { background: #fef3c7; color: #6b4a0f; border-radius: 12px;
  padding: .8rem 1rem; margin: 0 0 2rem; font-size: .9rem; }
@media (prefers-color-scheme: dark) { .bozza { background: #3a2f0f; color: #f5dca0; } }

article h2 { margin: 2.25rem 0 .5rem; font-size: 1.1rem; }
article p { margin: .5rem 0; }

nav.legale { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line);
  font-size: .9rem; }
nav.legale a { margin-right: 1.25rem; }

/* Elenco degli attestati nell'area del partecipante: una riga per attestato. */
ul.elenco { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: .75rem; }
ul.elenco li { background: var(--campo); border: 1px solid var(--line);
  border-radius: 14px; padding: 1rem 1.15rem; }
ul.elenco small { color: var(--muted); }

/* ---- Pagina di presentazione ---- */

/*
 * La testata è una barra bianca staccata dai bordi, non una fascia attaccata
 * in alto: si vede che galleggia sopra la pagina, e sotto di lei il contenuto
 * scorre via. Resta appiccicata mentre si scorre e, appena la pagina si
 * muove, l'ombra si fa più profonda.
 */
.testata { position: sticky; top: .75rem; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin: .75rem 0 0; padding: .3rem .42rem;
  background: var(--scheda); border: 1px solid transparent; border-radius: 18px; }
.testata .pillola, .testata .pillola-vuota { padding: .48rem 1.1rem; font-size: .92rem;
  border-radius: 11px; }
.testata .marchio { font-size: 1.18rem; gap: .6rem; }
.testata .marchio .segno { width: 38px; height: 38px; border-radius: 11px; }
.testata .marchio .segno svg { width: 22px; height: 22px; }
.marchio { display: flex; align-items: center; gap: .6rem;
  font-family: 'Manrope', Inter, system-ui, sans-serif; font-weight: 800;
  letter-spacing: -.8px; color: #111111; text-decoration: none; }
/* Col tema scuro il nero del marchio sparirebbe dentro la fascia scura: lì
   torna il colore del testo, che segue il tema. */
@media (prefers-color-scheme: dark) { .marchio { color: var(--fg); } }
/* Il segno è sempre bianco sul verde: la tessera non cambia colore con il
   tema, quindi nemmeno la A deve farlo. */
.marchio .segno { width: 30px; height: 30px; border-radius: 9px;
  background: var(--accento-vivo); color: #fff;
  display: grid; place-items: center; }
.marchio .segno svg { width: 17px; height: 17px; }
.testata nav { display: flex; align-items: center; gap: .6rem; font-size: .95rem; }

.pillola { background: var(--accento-vivo); color: #fff;
  border-radius: 13px; padding: .6rem 1.2rem; font-weight: 600; text-decoration: none; }
.pillola:hover { filter: brightness(1.06); }
.pillola-vuota { border: 1px solid var(--line); color: var(--fg);
  border-radius: 13px; padding: .6rem 1.2rem; font-weight: 600; text-decoration: none; }
.pillola-vuota:hover { border-color: var(--fg); }

.apertura { text-align: center; padding: 4.5rem 0 3.5rem; }
.occhiello { display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--line); border-radius: 999px; padding: .4rem 1rem;
  font-size: .85rem; color: var(--muted); }
.occhiello::before { content: ""; width: 7px; height: 7px; border-radius: 999px;
  background: var(--accento-vivo); }
.apertura h1 { font-size: 3.4rem; line-height: 1.06; margin: 1.5rem auto 0;
  max-width: 20ch; }
.apertura h1 em { font-style: normal; color: var(--accento); }
.apertura p { max-width: 40rem; margin: 1.35rem auto 0; color: var(--muted);
  font-size: 1.12rem; line-height: 1.55; }
.apertura p.cta { display: flex; flex-wrap: wrap; justify-content: center;
  gap: .75rem; margin-top: 2rem; }

ul.fatti { list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
  gap: .5rem 1.5rem; margin: 2.5rem 0 0; padding: 0; font-size: .9rem; color: var(--muted); }
ul.fatti li { display: flex; align-items: center; gap: .5rem; }
ul.fatti li::before { content: ""; width: 5px; height: 5px; border-radius: 999px;
  background: var(--accento-vivo); }

@media (max-width: 34rem) {
  /* Sul telefono il pulsante della testata finirebbe su due righe: l'invito
     sta comunque sotto, due volte, grande quanto serve. */
  .testata { padding: .26rem .36rem; border-radius: 16px; }
  .testata .marchio { font-size: 1.05rem; }
  .testata .marchio .segno { width: 34px; height: 34px; }
  .testata .marchio .segno svg { width: 20px; height: 20px; }
  .testata nav a.pillola { display: none; }
  ul.fatti { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 40rem) {
  .apertura { padding: 2.5rem 0 2rem; }
  .apertura h1 { font-size: 2.2rem; }
  .apertura p { font-size: 1rem; }
}

.sezione { padding: 3.5rem 0; border-top: 1px solid var(--line); }
.etichetta { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accento); }
.sezione h2 { margin: .8rem 0 0; font-size: 2rem; max-width: 26ch; }
.sezione p.sommario { margin: 1rem 0 0; max-width: 46rem; color: var(--muted);
  font-size: 1.05rem; }
@media (max-width: 40rem) {
  .sezione { padding: 2.5rem 0; }
  .sezione h2 { font-size: 1.6rem; }
}

/* I passi: il numero lo disegna il contatore, non è scritto nel markup. */
ol.passi { counter-reset: passo; list-style: none; margin: 2.5rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
ol.passi li { counter-increment: passo; border-top: 2px solid var(--line);
  padding-top: 1rem; }
ol.passi li::before { content: counter(passo); font-size: .85rem; font-weight: 700;
  color: var(--accento); font-variant-numeric: tabular-nums; }
ol.passi h3 { margin: .5rem 0 0; font-size: 1.05rem; font-weight: 700;
  letter-spacing: -.01em; }
ol.passi p { margin: .4rem 0 0; color: var(--muted); font-size: .93rem; }
@media (max-width: 52rem) { ol.passi { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 34rem) { ol.passi { grid-template-columns: 1fr; } }

.schede { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  margin-top: 2.5rem; }
@media (max-width: 52rem) { .schede { grid-template-columns: 1fr; } }
.scheda { background: var(--panno); border: 1px solid var(--line);
  border-radius: 18px; padding: 1.6rem; }
.scheda h3 { margin: 1rem 0 0; font-size: 1.02rem; font-weight: 700;
  letter-spacing: -.01em; }
.scheda p { margin: .4rem 0 0; color: var(--muted); font-size: .93rem; }
.scheda svg { width: 22px; height: 22px; color: var(--accento); }

/* Il riquadro dei punti: dove si dice com'è fatto, con il segno di spunta. */
.panno { margin-top: 3.5rem; background: var(--panno); border: 1px solid var(--line);
  border-radius: 24px; padding: 3rem; }
.panno h2 { margin: .8rem 0 0; font-size: 2rem; max-width: 26ch; }
.panno p { margin: 1rem 0 0; max-width: 46rem; color: var(--muted); font-size: 1.05rem; }
ul.punti { list-style: none; margin: 2rem 0 0; padding: 0; display: grid;
  grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
ul.punti li { position: relative; padding-left: 1.9rem; font-size: .95rem;
  color: var(--fg); }
ul.punti li::before { content: ""; position: absolute; left: 0; top: .25rem;
  width: 18px; height: 18px; border-radius: 999px; background: var(--accento-tenue);
  box-shadow: inset 0 0 0 1.5px var(--accento-vivo); }
@media (max-width: 52rem) { ul.punti { grid-template-columns: 1fr; } }
@media (max-width: 40rem) {
  .panno { padding: 2rem 1.5rem; }
  .panno h2 { font-size: 1.6rem; }
}

.chiusura { text-align: center; padding: 4.5rem 0 3.5rem; }
.chiusura h2 { margin: 0 auto; font-size: 2.6rem; max-width: 20ch; }
.chiusura p { margin: 1rem auto 0; max-width: 34rem; color: var(--muted); font-size: 1.05rem; }
.chiusura p.cta { display: flex; flex-wrap: wrap; justify-content: center;
  gap: .75rem; margin-top: 2rem; }
@media (max-width: 40rem) {
  .chiusura { padding: 3rem 0 2rem; }
  .chiusura h2 { font-size: 1.8rem; }
}

/* ---- Movimento ----
 *
 * Tutto in CSS, perché le pagine pubbliche restano senza JavaScript.
 * L'entrata in scena usa animation-timeline: view(): il browser lega
 * l'animazione alla posizione dell'elemento nella finestra, senza che
 * nessuno stia a guardare lo scorrimento. Dove non c'è (è recente), il
 * blocco @supports non si applica e la pagina resta ferma e leggibile:
 * la comparsa è un di più, non il modo di vedere il contenuto.
 *
 * Chi ha chiesto meno animazioni al sistema non ne vede nessuna.
 */
@keyframes sali { from { opacity: 0; transform: translateY(18px); } }
@keyframes entra { from { opacity: 0; transform: translateY(10px) scale(.98); } }
/* In cima alla pagina la fascia non ha né bordo né ombra: è bianca sul fondo
   avorio e basta. Bordo e ombra — appena accennata — compaiono quando il
   contenuto comincia a passarle sotto, che è l'unico momento in cui serve
   dire dove finisce. */
@keyframes testata-posata {
  to { border-color: var(--line);
       box-shadow: 0 1px 2px rgba(15, 14, 13, .04), 0 8px 18px -16px rgba(15, 14, 13, .22); }
}

.marchio .segno, .pillola, .pillola-vuota, .scheda, button {
  transition: transform .16s cubic-bezier(.23, 1, .32, 1),
    filter .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.pillola:hover, button:hover:not(:disabled) { transform: translateY(-1px); }
.pillola:active, button:active:not(:disabled) { transform: translateY(0) scale(.98); }
.pillola-vuota:hover { transform: translateY(-1px); }
.scheda:hover { transform: translateY(-3px); border-color: var(--accento-vivo);
  box-shadow: 0 18px 30px -24px rgba(15, 14, 13, .5); }
.marchio:hover .segno { transform: rotate(-6deg) scale(1.05); }
ul.elenco li { transition: border-color .2s ease; }
ul.elenco li:hover { border-color: var(--accento-vivo); }

/* L'apertura entra da sé al caricamento, una cosa per volta. */
.apertura > * { animation: sali .8s cubic-bezier(.16, 1, .3, 1) backwards; }
.apertura > .occhiello { animation-delay: .05s; }
.apertura > h1 { animation-delay: .14s; animation-duration: .9s; }
.apertura > p { animation-delay: .24s; animation-duration: .9s; }
.apertura > p.cta { animation-delay: .34s; }
.apertura > ul.fatti { animation-delay: .44s; animation-duration: 1.1s; }

@supports (animation-timeline: view()) {
  .testata { animation: testata-posata linear both; animation-timeline: scroll();
    animation-range: 0 120px; }

  .sezione > .etichetta,
  .sezione > h2,
  .sezione > p.sommario,
  .panno > .etichetta,
  .panno > h2,
  .panno > p,
  .chiusura > *,
  ol.passi li,
  .scheda,
  ul.punti li {
    animation: entra .7s cubic-bezier(.16, 1, .3, 1) both;
    animation-timeline: view();
    animation-range: entry 0% cover 28%;
  }

  /* Le file di schede entrano sfalsate: la fila si legge da sinistra. */
  ol.passi li:nth-child(2), .scheda:nth-child(2), ul.punti li:nth-child(2) {
    animation-range: entry 0% cover 32%;
  }
  ol.passi li:nth-child(3), .scheda:nth-child(3), ul.punti li:nth-child(3) {
    animation-range: entry 0% cover 36%;
  }
  ol.passi li:nth-child(4), .scheda:nth-child(4) { animation-range: entry 0% cover 40%; }
  .scheda:nth-child(5) { animation-range: entry 0% cover 44%; }
  .scheda:nth-child(6) { animation-range: entry 0% cover 48%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

ul { padding-left: 1.2rem; }
li { margin: .35rem 0; }