/* BE/html/public/consent.css — Banner di consenso cookie v2, generato da consent.js.
   Nessuno stile inline nelle pagine (CSP-safe). Colori dai token delle landing C/E
   quando esistono (var(--token, fallback)); altrove i fallback neutri qui sotto,
   con contrasto >= 4,5:1 su fondo chiaro e scuro. Nessun backdrop-filter. */
.tps-consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 85;
  max-width: 720px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 44px 20px 20px;
  border: 1px solid var(--line, rgba(255, 255, 255, .16));
  border-radius: var(--r-sm, 16px);
  background: var(--navy-2, #10141c);
  color: var(--ivory-dim, #d7dae2);
  box-shadow: var(--shadow, 0 20px 60px -20px rgba(0, 0, 0, .6));
  font: 400 .92rem/1.5 var(--fb, "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease-out, transform 180ms ease-out;
}
.tps-consent[hidden] { display: none; }
.tps-consent.is-open { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .tps-consent { transition: none; transform: none; }
}

/* Il banner (fixed, bottom) copre lo sticky-cta delle landing quando è aperto:
   consent.js aggiunge/toglie questa classe sul body in showBanner/hideBanner. */
body.tps-consent-open .sticky-cta { display: none; }

/* La ✕ vale quanto gli altri comandi (Linee guida Garante: «una evidenza grafica
   pari a quella degli ulteriori comandi»): stessa dimensione minima (44×44) e
   stesso bordo/colore di .tps-consent__btn, non un cerchio 32px quasi invisibile. */
.tps-consent__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--teal-2, #8cebcc);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
}
.tps-consent__close:hover { background: rgba(255, 255, 255, .08); }

.tps-consent__title {
  margin: 0;
  font: 700 1.05rem/1.3 var(--fd, var(--fb, "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif));
  color: var(--ivory, #f2f3f5);
}
.tps-consent__body { margin: 0; max-width: 62ch; }
.tps-consent__body a {
  color: var(--teal-2, #8cebcc);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tps-consent__panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
  border-top: 1px solid var(--line, rgba(255, 255, 255, .16));
}
.tps-consent__panel[hidden] { display: none; }
.tps-consent__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.tps-consent__switch-label { display: flex; flex-direction: column; gap: 2px; max-width: 46ch; }
.tps-consent__switch-title { font-weight: 700; color: var(--ivory, #f2f3f5); }
.tps-consent__switch-desc { font-size: .82rem; opacity: .85; }
.tps-consent__switch {
  flex: none;
  width: 44px;
  height: 26px;
  min-height: 26px;
  border-radius: 999px;
  /* Bordo dedicato (non --line): sulle pagine legali --line vale
     rgba(168,178,197,.14), contrasto ~1.3:1 sul fondo del banner. --teal-2 è già
     usato per link/pulsanti del banner e garantisce >= 3:1 ovunque. */
  border: 1px solid var(--teal-2, #8cebcc);
  background: transparent;
  position: relative;
  cursor: pointer;
}
.tps-consent__switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: currentColor;
  opacity: .55;
  transition: transform 150ms ease-out;
}
.tps-consent__switch.is-on { border-color: var(--teal, #3ecfa0); }
.tps-consent__switch.is-on::after { transform: translateX(18px); background: var(--teal, #3ecfa0); opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .tps-consent__switch::after { transition: none; }
}

.tps-consent__actions, .tps-consent__save {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tps-consent__actions[hidden], .tps-consent__save[hidden] { display: none; }

/* I tre comandi (Accetta tutti · Rifiuta · Personalizza) condividono la STESSA
   classe: pari evidenza grafica, nessun pulsante "pieno" accanto a "ghost". */
.tps-consent__btn {
  min-height: 44px;
  flex: 1 1 auto;
  padding: 10px 18px;
  border-radius: var(--r-pill, 999px);
  border: 1px solid var(--teal-2, #8cebcc);
  background: transparent;
  color: var(--ivory, #f2f3f5);
  font: 700 .85rem/1 var(--fb, "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  cursor: pointer;
}
.tps-consent__btn:hover { background: rgba(255, 255, 255, .08); }

.tps-consent :focus-visible {
  outline: 2px solid var(--teal-2, #8cebcc);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .tps-consent { left: 12px; right: 12px; padding: 40px 16px 16px; }
  .tps-consent__actions .tps-consent__btn,
  .tps-consent__save .tps-consent__btn { flex: 1 1 100%; }
}
