/* Il caricamento d'avvio (index.html → #avvio): si vede appena arriva la
 * pagina, PRIMA del JavaScript, e lo toglie la prima schermata vera
 * (src/avvio.ts). Colori a mano perché il CSS dell'app non c'è ancora: gli
 * stessi di --background/--foreground, chiaro e scuro (la classe `dark` la
 * mette theme-init.js prima del primo disegno). */
#avvio {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  background: #ffffff;
  color: #0a0a0a;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  text-align: center;
  transition: opacity 0.2s ease-out;
}
html.dark #avvio { background: #0a0a0a; color: #fafafa; }
#avvio[data-via] { opacity: 0; pointer-events: none; }
#avvio .marchio { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
#avvio .giro {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: 0.45;
  animation: avvio-giro 0.8s linear infinite;
}
@keyframes avvio-giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #avvio .giro { animation-duration: 2.4s; } }
#avvio .messaggio, #avvio button { display: none; }
#avvio .messaggio { margin: 0; font-size: 15px; opacity: 0.7; max-width: 280px; line-height: 1.4; }
#avvio button {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
#avvio[data-stato='lento'] .messaggio-lento,
#avvio[data-stato='errore'] .messaggio-errore,
#avvio[data-stato] button { display: block; }
#avvio[data-stato='errore'] .giro { display: none; }
