/* DGRM · banner dei cookie e pulsante «Preferenze cookie» (assets/consenso.js), su tutte le pagine.
   «Accetta» e «Rifiuta» hanno lo stesso peso, come chiede il Garante: stessa forma, stesso colore. */

.consenso {
  position: fixed;
  z-index: 2147482000; /* sopra barre fisse, menu e passaggi animati della pagina */
  bottom: 24px;
  inset-inline-start: 24px;
  box-sizing: border-box;
  width: min(440px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  margin: 0;
  padding: 22px 22px 20px;
  overflow-y: auto;
  border: 1px solid rgba(var(--primary-rgb, 192, 31, 22), 0.6);
  background: var(--background, #070707);
  color: var(--copy, #c9cddb);
  font-family: var(--font-mono, "Space Mono", ui-monospace, monospace);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  text-align: start;
  text-transform: none;
  animation: consenso-in 260ms ease-out both;
}

.consenso[hidden] {
  display: none;
}

.consenso:focus {
  outline: none;
}

.consenso:focus-visible {
  outline: 2px solid var(--accent-text, #e73b32);
  outline-offset: 3px;
}

.consenso * {
  box-sizing: border-box;
}

.consenso p {
  margin: 0;
}

.consenso__label {
  margin-bottom: 10px !important;
  color: var(--accent-text, #e73b32);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.consenso__text a {
  color: var(--foreground, #ffffff);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.consenso__text a:hover {
  color: var(--accent-text, #e73b32);
}

.consenso__text a:focus-visible,
.consenso__btn:focus-visible,
.cookie-preferenze:focus-visible {
  outline: 2px solid var(--accent-text, #e73b32);
  outline-offset: 3px;
}

.consenso__now {
  margin-top: 10px !important;
  color: var(--muted, #9aa3b5);
  font-size: 12px;
}

.consenso__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.consenso__btn {
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--foreground, #ffffff);
  border-radius: 0;
  background: transparent;
  color: var(--foreground, #ffffff);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.consenso__btn:hover {
  background: var(--foreground, #ffffff);
  color: var(--background, #070707);
}

/* In fondo alle pagine: sembra un link come i suoi vicini (Privacy Policy, Cookie Policy). */
.cookie-preferenze {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--copy, #c9cddb);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color 160ms ease;
}

.cookie-preferenze[hidden] {
  display: none;
}

.cookie-preferenze:hover {
  color: var(--foreground, #ffffff);
}

/* Pagine dei servizi: come i link vicini, nel colore del servizio */
.footer .cookie-preferenze:hover {
  color: var(--accent-ink, var(--foreground, #ffffff));
  text-shadow: 0 0 18px var(--accent-glow, transparent);
}

/* Nella Cookie Policy: un pulsante vero, dentro il testo. */
.legal-page .cookie-preferenze {
  min-height: 44px;
  margin: 4px 0 8px;
  padding: 10px 16px;
  border: 1px solid var(--foreground, #ffffff);
  color: var(--foreground, #ffffff);
  font-family: var(--font-mono, "Space Mono", ui-monospace, monospace);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.legal-page .cookie-preferenze:hover {
  background: var(--foreground, #ffffff);
  color: var(--background, #070707);
}

:root:lang(ar) .consenso,
:root:lang(ar) .consenso *,
:root:lang(ar) .cookie-preferenze {
  letter-spacing: 0;
}

@keyframes consenso-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .consenso {
    animation: none;
  }
}

/* main riceve il fuoco dopo una scelta fatta dalla tastiera: niente contorno attorno a tutta la pagina */
main[tabindex="-1"]:focus {
  outline: none;
}

@media (max-width: 720px) {
  .consenso {
    bottom: 12px;
    inset-inline: 12px;
    width: auto;
    max-height: calc(100vh - 24px);
    padding: 18px 16px 16px;
  }

  .consenso__actions {
    margin-top: 16px;
  }

  .legal-footer__links .cookie-preferenze,
  .footer-links .cookie-preferenze {
    padding-block: 12px;
  }
}

@media print {
  .consenso {
    display: none !important;
  }
}
