/* Consenso nello stile Truck Program: controlli equivalenti, leggibili e raggiungibili da tastiera. */
.consent-banner { position:fixed; z-index:60; bottom:16px; left:16px; right:16px; width:min(520px,calc(100% - 32px)); max-height:calc(100svh - 32px); overflow:auto; padding:16px; background:var(--white); color:var(--ink); border:1px solid var(--line); border-radius:10px; box-shadow:0 8px 30px rgba(17,22,20,.18); }
.consent-banner[hidden] { display:none; }
.consent-dialog h2 { font-size:28px; line-height:1.12; }
.consent-banner h2 { font-size:20px; line-height:1.2; }
.consent-dialog p { margin-top:14px; font-size:15px; }
.consent-banner p { margin-top:8px; font-size:13px; line-height:1.45; }
.consent-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:20px; }
.consent-actions button,.consent-heading button { min-height:44px; padding:10px 16px; border:1px solid var(--ink); border-radius:7px; background:var(--white); color:var(--ink); font-weight:700; }
/* Il banner compatto conserva scelte equivalenti; la finestra delle preferenze mantiene controlli ampi. */
.consent-banner .consent-actions { gap:8px; margin-top:12px; }
.consent-banner .consent-actions button { min-height:36px; padding:7px 11px; font-size:12px; line-height:1.25; }
.consent-actions button:hover,.consent-heading button:hover { background:var(--paper); }
.consent-actions button:disabled { cursor:wait; opacity:.65; }
.consent-dialog { width:min(620px,calc(100% - 32px)); max-height:calc(100svh - 32px); padding:28px; border:0; border-radius:10px; background:var(--white); color:var(--ink); }
.consent-dialog::backdrop { background:rgba(17,22,20,.65); }
.consent-heading { display:flex; align-items:start; justify-content:space-between; gap:20px; }
.consent-category { display:flex; align-items:start; gap:14px; margin-top:20px; cursor:pointer; }
.consent-category input { width:20px; height:20px; flex:none; accent-color:var(--red); margin-top:3px; }
.consent-category strong,.consent-category span span { display:block; }
.consent-category span span { margin-top:4px; color:var(--muted); font-size:14px; }
.consent-error { color:var(--red-dark); }
.footer-meta button[data-consent-open] { min-height:44px; font-size:12px; border:0; padding:0; background:transparent; color:inherit; font:inherit; text-decoration:underline; cursor:pointer; }
@media(max-width:620px) { .consent-dialog { padding:20px; } .consent-actions button { flex:1 1 auto; } .consent-heading { gap:12px; } }

.footer-meta nav { display:flex; flex-wrap:wrap; gap:12px 22px; align-items:center; }

/* Tre azioni su una sola riga riducono l'altezza mobile, con area touch di almeno 44 px. */
@media(max-width:620px) {
  .consent-banner { bottom:10px; left:10px; right:10px; width:calc(100% - 20px); max-width:520px; max-height:calc(100svh - 20px); padding:14px; }
  .consent-banner h2 { font-size:18px; }
  .consent-banner p { font-size:12px; }
  .consent-banner .consent-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-top:10px; }
  .consent-banner .consent-actions button { min-width:0; min-height:44px; padding:7px 5px; font-size:11px; overflow-wrap:anywhere; }
}

/* Accettazione evidenziata in verde; tutte le azioni restano direttamente disponibili. */
.consent-actions [data-consent-action="accept"] { background:#00b73a; border-color:#00b73a; color:var(--ink); }
.consent-actions [data-consent-action="accept"]:hover { background:#00a834; border-color:#00a834; }

/* Il contesto video richiama la categoria esterni; il checkbox resta una scelta esplicita. */
.consent-dialog[data-requested-category="external"] [data-consent-category="external"] { padding:12px; margin-left:-12px; margin-right:-12px; border-left:4px solid #00b73a; border-radius:6px; background:#e9f8ee; }
.consent-dialog[data-requested-category="external"] [data-consent-category="external"] strong { color:var(--green-dark); }
.consent-dialog[data-requested-category="external"] input[name="external"] { accent-color:#00b73a; }

/* Un punto decorativo lampeggia brevemente nel contesto video; il testo resta fermo e leggibile. */
.consent-dialog[data-requested-category="external"] [data-consent-category="external"] strong::after { content:""; display:inline-block; width:7px; height:7px; margin-left:8px; vertical-align:middle; border-radius:50%; background:#00b73a; animation:consent-video-hint 1.4s ease-in-out 3; }
@keyframes consent-video-hint { 0%,100% { opacity:1; } 50% { opacity:.2; } }
@media(prefers-reduced-motion:reduce) {
  .consent-dialog[data-requested-category="external"] [data-consent-category="external"] strong::after { animation:none; }
}

/* Su mobile titolo e azioni restano visibili; solo i dettagli scorrono nei viewport bassi. */
@media(max-width:620px), (max-width:950px) and (max-height:540px) {
  .consent-dialog { width:calc(100% - 20px); max-height:calc(100dvh - 20px); padding:16px; overflow:hidden; }
  .consent-dialog[open] { display:flex; flex-direction:column; }
  .consent-dialog .consent-heading { flex:none; gap:10px; }
  .consent-dialog h2 { min-width:0; font-size:22px; line-height:1.15; overflow-wrap:anywhere; }
  .consent-dialog .consent-heading button { flex:none; min-height:36px; padding:6px 10px; font-size:12px; }
  .consent-dialog form { display:flex; flex-direction:column; min-height:0; }
  .consent-dialog .consent-body { min-height:0; overflow:auto; overscroll-behavior:contain; padding:0 8px; }
  .consent-dialog p { margin-top:8px; font-size:12px; line-height:1.4; }
  .consent-dialog .consent-category { gap:10px; margin-top:10px; }
  .consent-dialog .consent-category input { width:18px; height:18px; margin-top:1px; }
  .consent-dialog .consent-category > span { min-width:0; overflow-wrap:anywhere; }
  .consent-dialog .consent-category strong { font-size:13px; line-height:1.3; }
  .consent-dialog .consent-category span span { margin-top:2px; font-size:12px; line-height:1.35; }
  .consent-dialog[data-requested-category="external"] [data-consent-category="external"] { padding:8px; margin-left:-8px; margin-right:-8px; }
  .consent-dialog .consent-error { flex:none; }
  .consent-dialog .consent-actions { flex:none; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-top:10px; padding-top:10px; border-top:1px solid var(--line); }
  .consent-dialog .consent-actions button { min-width:0; min-height:44px; padding:7px 5px; font-size:11px; line-height:1.25; overflow-wrap:anywhere; }
}
