/*
 * Pagina di accesso: a sinistra lo "schermo" con il logo e i pittogrammi che
 * fluttuano, a destra il modulo. Dopo un accesso riuscito parte l'animazione
 * di entrata (classe .ac-via sul body).
 *
 * Lo schermo resta scuro anche nel tema chiaro: è uno schermo.
 */
.ac-body {
  --ac-pannello: #0E0F0D;
  --ac-campo: #151614;
  margin: 0; min-height: 100vh; background: #060404; overflow-x: hidden;
}
.ac-body::before { display: none; }
[data-theme="light"] .ac-body { --ac-pannello: #FFFFFF; --ac-campo: #F6F7F3; background: #E9EBE4; }

.ac-pagina {
  box-sizing: border-box; display: flex; gap: 28px; padding: 28px;
  height: 100vh; min-height: 640px;
  transition: padding .6s cubic-bezier(.7, 0, .2, 1), gap .6s cubic-bezier(.7, 0, .2, 1);
}

/* ------------------------------------------------------------ lo schermo */
.ac-schermo {
  flex: 1 1 0; min-width: 0; position: relative; overflow: hidden; border-radius: 22px;
  background: radial-gradient(120% 90% at 30% 20%, #1D2408 0%, #0B0E05 55%, #050603 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
  transition: border-radius .6s ease;
}
.ac-righe {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .02) 0, rgba(255, 255, 255, .02) 1px, transparent 1px, transparent 4px);
}
.ac-pitto { position: absolute; overflow: visible; animation: ac-fluttua ease-in-out infinite; will-change: transform; }
.ac-pitto .ac-contorno rect { fill: none; stroke: rgba(243, 244, 241, .05); stroke-width: var(--tratto, 1.6); }
.ac-pitto .ac-barra { fill: rgba(203, 255, 0, .06); }
/* Durante l'entrata i pittogrammi si accendono un poco, mentre si raccolgono */
.ac-via .ac-pitto .ac-contorno rect { stroke: rgba(243, 244, 241, .14); transition: stroke .4s ease; }
.ac-via .ac-pitto .ac-barra { fill: rgba(203, 255, 0, .3); transition: fill .4s ease; }
.ac-alone {
  position: absolute; left: 50%; top: 50%; width: 620px; height: 420px; transform: translate(-50%, -50%);
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(203, 255, 0, .13), rgba(203, 255, 0, 0) 75%);
}
.ac-logo {
  position: absolute; left: 50%; top: 50%; width: 282px; max-width: 70%; height: auto;
  transform: translate(-50%, -50%);
}
.ac-grande {
  position: absolute; left: 50%; top: 47%; width: 300px; height: 407px; max-height: 60%;
  transform: translate(-50%, -50%); transform-origin: 43.4% 95%; opacity: 0; overflow: visible;
}
.ac-grande .ac-traccia rect { fill: none; stroke: #CBFF00; stroke-width: 1.4; stroke-dasharray: 700; stroke-dashoffset: 700; }
.ac-grande .ac-pieno { fill: #CBFF00; opacity: 0; }
.ac-grande .ac-sale { fill: #F3F4F1; transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); }
.ac-saluto {
  position: absolute; left: 0; right: 0; bottom: 12%; margin: 0; max-width: none; text-align: center; opacity: 0;
  font: 500 15px 'Space Grotesk', sans-serif; letter-spacing: .32em; text-transform: uppercase; color: #C9CEC2;
}

/* ------------------------------------------------------------ l'accesso */
.ac-accesso {
  flex: 1 1 0; min-width: 0; box-sizing: border-box; display: flex; flex-direction: column;
  justify-content: space-between; align-items: center; padding: 56px 48px 30px; border-radius: 22px;
  background: var(--ac-pannello); box-shadow: inset 0 0 0 1px var(--line-soft); overflow: hidden;
  transition: flex-grow .6s cubic-bezier(.7, 0, .2, 1), padding .6s cubic-bezier(.7, 0, .2, 1), opacity .3s ease;
}
.ac-spazio { height: 1px; }
.ac-modulo { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 26px; }
.ac-logo-piccolo { display: none; width: 190px; height: auto; }
.ac-titoli { display: flex; flex-direction: column; gap: 10px; }
.ac-titoli h1 {
  margin: 0; font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 46px;
  line-height: 1.05; letter-spacing: -.025em; color: var(--text);
}
.ac-titoli p { margin: 0; max-width: none; font-size: 16px; color: var(--muted); }
.ac-modulo .stack { gap: 14px; }
.ac-modulo label { font-size: 13px; }
.ac-modulo input[type=text], .ac-modulo input[type=email], .ac-modulo input[type=password], .ac-modulo input[type=number] {
  height: 54px; box-sizing: border-box; margin-top: 8px; padding: 0 16px; border-radius: 12px;
  background: var(--ac-campo); font-size: 16px; max-width: none;
}
.ac-modulo .btn.primary { height: 56px; width: 100%; justify-content: center; border-radius: 12px; font: 600 17px 'Space Grotesk', sans-serif; }
.ac-modulo .alert { margin: 0; }
.ac-stato { margin: 0; color: var(--acid-text); font-weight: 500; }
.ac-modulo .cf-turnstile { min-height: 65px; }
.ac-crediti { width: 100%; display: flex; justify-content: center; }
/* Registrazione */
.ac-nota-campo { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.ac-modulo label.ac-privacy { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; line-height: 1.45; }
.ac-privacy input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: #CBFF00; }
.ac-privacy a, .ac-cambia a { color: var(--acid-text); }
.ac-cambia { margin: 18px 0 0; text-align: center; font-size: 15px; color: var(--muted); }
.ac-cambia a { font-weight: 600; }
.ac-crediti .crediti { justify-content: center; }

/* ------------------------------------------------------------ telefono */
@media (max-width: 860px) {
  .ac-pagina { flex-direction: column; height: auto; min-height: 100vh; padding: 14px; gap: 14px; }
  .ac-schermo { flex: 0 0 230px; border-radius: 20px; }
  .ac-logo { width: 200px; }
  .ac-alone { width: 320px; height: 200px; }
  .ac-accesso { padding: 28px 22px 18px; border-radius: 20px; gap: 26px; }
  .ac-spazio { display: none; }
  .ac-titoli h1 { font-size: 30px; }
  /* Nello schermo piccolo restano solo i pittogrammi piccoli */
  .ac-pitto[data-w="150"], .ac-pitto[data-w="120"], .ac-pitto[data-w="110"], .ac-pitto[data-w="90"], .ac-pitto[data-w="86"] { display: none; }
  .ac-titoli p { font-size: 15px; }
}

/* ------------------------------------------------------------ l'entrata */
@keyframes ac-fluttua {
  0% { transform: translate(0, 0) rotate(var(--r)); }
  50% { transform: translate(14px, -26px) rotate(calc(var(--r) + 7deg)); }
  100% { transform: translate(0, 0) rotate(var(--r)); }
}
@keyframes ac-raccoglie {
  0% { transform: translate(0, 0) rotate(var(--r)) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, 0)) rotate(0deg) scale(.25); opacity: 0; }
}
@keyframes ac-sparisce { to { opacity: 0; transform: translate(-50%, -50%) scale(.9); filter: blur(6px); } }
@keyframes ac-traccia { to { stroke-dashoffset: 0; } }
@keyframes ac-compare { to { opacity: 1; } }
@keyframes ac-sale { to { transform: scaleY(1); } }
@keyframes ac-attraversa {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(13); opacity: 0; }
}
@keyframes ac-saluto {
  0% { opacity: 0; transform: translateY(8px); }
  15% { opacity: 1; transform: none; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes ac-buio { to { background: #060404; } }

.ac-via .ac-pagina { padding: 0; gap: 0; }
.ac-via .ac-accesso { flex-grow: 0; flex-basis: 0; padding-left: 0; padding-right: 0; opacity: 0; pointer-events: none; }
.ac-via .ac-schermo { border-radius: 0; animation: ac-buio .4s ease 2.5s forwards; }
.ac-via .ac-pitto { animation: ac-raccoglie .9s cubic-bezier(.6, 0, .3, 1) .55s forwards !important; }
.ac-via .ac-logo { animation: ac-sparisce .4s ease .4s forwards; }
.ac-via .ac-alone { width: 800px; height: 800px; top: 47%; transition: width .6s ease, height .6s ease; }
.ac-via .ac-grande { opacity: 1; animation: ac-attraversa .65s cubic-bezier(.6, 0, .9, .4) 2.3s forwards; }
.ac-via .ac-grande .ac-traccia rect { animation: ac-traccia .7s cubic-bezier(.4, 0, .2, 1) forwards; }
.ac-via .ac-grande .ac-traccia rect:nth-child(1) { animation-delay: .8s; }
.ac-via .ac-grande .ac-traccia rect:nth-child(2) { animation-delay: .9s; }
.ac-via .ac-grande .ac-traccia rect:nth-child(3) { animation-delay: 1s; }
.ac-via .ac-grande .ac-traccia rect:nth-child(4) { animation-delay: 1.1s; }
.ac-via .ac-grande .ac-traccia rect:nth-child(5) { animation-delay: 1.2s; }
.ac-via .ac-grande .ac-pieno { animation: ac-compare .35s ease 1.55s forwards; }
.ac-via .ac-grande .ac-sale { animation: ac-sale 1.1s cubic-bezier(.65, 0, .35, 1) 1.1s forwards; }
.ac-via .ac-saluto { animation: ac-saluto 1.9s ease .7s forwards; }
@media (max-width: 860px) {
  .ac-schermo { transition: border-radius .6s ease, flex-basis .6s cubic-bezier(.7, 0, .2, 1); }
  .ac-via .ac-schermo { flex-basis: calc(100vh - 0px); }
  .ac-via .ac-accesso { padding-top: 0; padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ac-pitto { animation: none; transform: rotate(var(--r)); }
}
.ac-dimenticata { align-self: flex-end; margin-top: -6px; font-size: 13.5px; color: var(--acid-text); font-weight: 500; text-decoration: none; }
.ac-dimenticata:hover { text-decoration: underline; }
.ac-modulo > .btn { display: flex; justify-content: center; margin-top: 4px; }

/* Doppia verifica: il codice dell'app */
.ac-codice { font: 600 1.6rem ui-monospace, SFMono-Regular, Menlo, monospace !important; letter-spacing: .28em; text-align: center; }
.ac-codice::placeholder { letter-spacing: .2em; opacity: .35; }
.ac-emergenza { font-size: .88rem; }
.ac-emergenza summary { cursor: pointer; color: var(--muted, #9AA096); width: max-content; max-width: 100%; }
.ac-emergenza summary:hover { color: inherit; }
.ac-emergenza p { margin: 8px 0 0; line-height: 1.5; }
.ac-emergenza code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
