/* Verifica del peso: il sistema visivo del sito delle classifiche GoOff (sito/modello.html),
   ridotto a una colonna da telefono. Elemento di carattere: il codice sul foglietto. */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/peso/file/Barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/peso/file/Barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("/peso/file/BarlowCondensed-700.woff2") format("woff2"); }

:root {
  --fondo: #f2f4f7; --foglio: #ffffff; --riga: #d5dae2;
  --inchiostro: #161a21; --grigio: #525b69;
  --azione: #c4402d; --su-azione: #ffffff; --azione-premuta: #a83423;
  --battito: #f05742; --ok: #1f7a4a;
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --testo: "Barlow", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #141920; --foglio: #1f2630; --riga: #333c49;
    --inchiostro: #e9edf2; --grigio: #a8b1be;
    --azione: #ff7d69; --su-azione: #141920; --azione-premuta: #ff9a8a;
    --battito: #f05742; --ok: #5fd69a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--inchiostro); font-family: var(--testo); font-size: 17px; line-height: 1.5; }
[hidden] { display: none !important; }

.telaio { min-height: 100vh; min-height: 100dvh; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column;
  padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.testata { padding-top: max(20px, env(safe-area-inset-top)); }
.logo { width: 92px; height: auto; display: block; }
.vista { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 22px 0 28px; }

.occhiello { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--azione); margin: 0; }
h1 { font-family: var(--display); font-weight: 700; font-size: 46px; line-height: 0.98; margin: 0; text-wrap: balance; }
.testo { margin: 0; color: var(--grigio); }
.testo b { color: var(--inchiostro); font-weight: 600; }
.piccolo { font-size: 15px; }

/* il foglietto col codice */
.codice { display: grid; gap: 8px; justify-items: start; margin-top: 4px; }
.codice .etichetta { font-size: 15px; color: var(--grigio); }
.foglietto { background: var(--foglio); border: 2px dashed var(--inchiostro); border-radius: 6px; padding: 6px 12px 8px 26px; margin: 8px 0 0 4px;
  font-family: var(--display); font-weight: 700; font-size: 68px; line-height: 1; letter-spacing: 14px;
  transform: rotate(-1.5deg); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.35); }

.passi { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 12px; counter-reset: passo; }
.passi li { counter-increment: passo; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.passi li::before { content: counter(passo); width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--inchiostro);
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1; }
.passi li span { padding-top: 3px; }

.scadenza { margin: 0; font-weight: 600; }
.riservata { margin: 0; font-size: 15px; color: var(--grigio); border-top: 1px solid var(--riga); padding-top: 14px; }

/* anteprima */
.foto { width: 100%; max-height: 48vh; object-fit: contain; border-radius: 10px; background: var(--foglio); display: block; }

/* ricevuta */
.spunta { width: 72px; height: 72px; }
.spunta circle { fill: none; stroke: var(--ok); stroke-width: 4; }
.spunta path { fill: none; stroke: var(--ok); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }

/* la barra del pollice */
.barra { position: sticky; bottom: 0; display: grid; gap: 4px; background: var(--fondo);
  padding: 12px 0 max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--riga); }
.bottone { -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer; border: 0; border-radius: 12px;
  min-height: 56px; padding: 0 20px; width: 100%; position: relative; overflow: hidden;
  font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 0.4px;
  background: var(--azione); color: var(--su-azione); transition: transform 0.08s ease; }
.bottone.secondario { background: transparent; color: var(--inchiostro); min-height: 48px; font-family: var(--testo); font-weight: 600; font-size: 17px; letter-spacing: 0;
  text-decoration: underline; text-underline-offset: 3px; }
.bottone:active { transform: scale(0.98); }
.bottone[aria-disabled="true"] { cursor: progress; }
.bottone .avanzamento { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--azione-premuta); transition: width 0.2s linear; }
.bottone .etichetta { position: relative; }
@media (hover: hover) and (pointer: fine) {
  .bottone:hover { background: var(--azione-premuta); }
  .bottone.secondario:hover { background: transparent; text-decoration-thickness: 2px; }
}
:focus-visible { outline: 3px solid var(--azione); outline-offset: 3px; }
.errore { margin: 6px 0 0; color: var(--inchiostro); font-size: 15px; font-weight: 600; border-left: 4px solid var(--azione); padding-left: 10px; }
.nota { margin: 2px 0 0; font-size: 15px; color: var(--grigio); text-align: center; }

/* caricamento */
.scheletro { display: grid; gap: 14px; }
.osso { display: block; background: var(--riga); border-radius: 6px; height: 18px; }
.osso.corto { width: 40%; height: 14px; }
.osso.titolo { width: 70%; height: 44px; }
.osso.riga { width: 90%; }
.osso.foglio { width: 230px; height: 84px; }

/* i due momenti: il foglietto che si appoggia, la spunta che si disegna */
@media (prefers-reduced-motion: no-preference) {
  .osso { animation: respiro 1.2s ease-in-out infinite alternate; }
  @keyframes respiro { from { opacity: 0.55; } to { opacity: 1; } }
  .foglietto { animation: appoggia 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both 0.1s; }
  /* senza opacità a zero: se l'animazione non parte, il codice si legge lo stesso */
  @keyframes appoggia { from { transform: translateY(-18px) rotate(-7deg); } to { transform: rotate(-1.5deg); } }
  .spunta circle { stroke-dasharray: 202; stroke-dashoffset: 202; animation: disegna 0.5s ease-out forwards; }
  .spunta path { stroke-dasharray: 50; stroke-dashoffset: 50; animation: disegna 0.35s ease-out 0.35s forwards; }
  @keyframes disegna { to { stroke-dashoffset: 0; } }
  .entra { animation: entra 0.3s ease-out both; }
  @keyframes entra { from { transform: translateY(8px); } to { transform: none; } }
}
@media (max-width: 360px) {
  h1 { font-size: 40px; }
  .foglietto { font-size: 58px; letter-spacing: 10px; }
}

/* la pagina del gruppo: cerca il tuo nome */
.etichetta-campo { font-size: 15px; color: var(--grigio); margin-bottom: -10px; }
.campo-testo { -webkit-appearance: none; appearance: none; font: inherit; font-size: 18px; color: var(--inchiostro); background: var(--foglio);
  border: 2px solid var(--riga); border-radius: 12px; min-height: 52px; padding: 0 14px; width: 100%; }
.campo-testo:focus { border-color: var(--inchiostro); outline: none; }
.elenco-nomi { list-style: none; margin: 0; padding: 0; display: grid; }
.elenco-nomi .nome { -webkit-appearance: none; appearance: none; font: inherit; color: var(--inchiostro); background: transparent; border: 0;
  border-bottom: 1px solid var(--riga); width: 100%; min-height: 52px; padding: 10px 2px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; text-align: left; cursor: pointer; }
.elenco-nomi .nome:active { background: var(--foglio); }
.elenco-nomi .gia { font-size: 14px; color: var(--ok); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .elenco-nomi .nome:hover { background: var(--foglio); } }
