/* ============================================================
   Banner consenso cookie (file identico in tutti i siti n99).
   Usa le variabili del tema del sito (--c-primary, --c-text, ...)
   con valori di riserva se un sito non le definisce.
   ============================================================ */

.cc-banner {
  --cc-primary: var(--c-primary, #1f5fbf);
  --cc-primary-dark: var(--c-primary-dark, #174a94);
  --cc-text: var(--c-text, #1a2027);
  --cc-muted: var(--c-text-muted, #5b6770);
  --cc-bg: var(--c-bg-card, var(--c-bg, #ffffff));
  --cc-alt: var(--c-bg-alt, #f5f5f4);
  --cc-border: var(--c-border, #e5e5e5);
  --cc-radius: var(--radius, 10px);

  position: fixed;
  z-index: 9999;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  font-family: var(--font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  animation: cc-in .28s cubic-bezier(.2, .8, .2, 1) both;
}
.cc-banner.cc-out { animation: cc-out .2s ease-in both; }

@keyframes cc-in  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes cc-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(16px); } }

.cc-card {
  position: relative;
  pointer-events: auto;
  width: 100%;
  max-width: 560px;
  padding: 22px 22px 18px;
  background: var(--cc-bg);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: calc(var(--cc-radius) + 6px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .06);
}

.cc-head { display: flex; align-items: center; gap: 10px; padding-right: 32px; }
.cc-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--cc-primary);
  background: var(--c-primary-light, rgba(0, 0, 0, .05));
}
.cc-head h2 {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--cc-text);
  font-family: inherit;
}

.cc-text {
  margin: 12px 0 0;
  font-size: .9rem;
  line-height: 1.55;
  color: var(--cc-muted);
}
.cc-text a {
  color: var(--c-primary-text, var(--cc-primary));
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-x {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cc-muted);
  cursor: pointer;
}
.cc-x:hover { background: var(--cc-alt); color: var(--cc-text); }

/* Pannello preferenze */
.cc-prefs { display: none; margin-top: 14px; border-top: 1px solid var(--cc-border); }
.cc-open .cc-prefs { display: block; }
.cc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--cc-border);
  cursor: default;
}
label.cc-row { cursor: pointer; }
.cc-row strong { display: block; font-size: .92rem; color: var(--cc-text); }
.cc-row span:not(.cc-switch):not(.cc-always) { display: block; margin-top: 2px; font-size: .82rem; color: var(--cc-muted); }
.cc-always {
  flex: none;
  font-size: .76rem;
  font-weight: 600;
  color: var(--cc-muted);
  white-space: nowrap;
}

.cc-switch { position: relative; flex: none; width: 44px; height: 26px; }
.cc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cc-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--cc-border);
  transition: background .2s;
  pointer-events: none;
}
.cc-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s;
}
.cc-switch input:checked + span { background: var(--cc-primary); }
.cc-switch input:checked + span::after { transform: translateX(18px); }
.cc-switch input:focus-visible + span { outline: 2px solid var(--cc-primary); outline-offset: 2px; }

/* Pulsanti: "Rifiuta" e "Accetta" hanno la stessa dimensione e la stessa evidenza */
.cc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.cc-btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--cc-radius);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.cc-btn:focus-visible, .cc-x:focus-visible { outline: 2px solid var(--cc-primary); outline-offset: 2px; }
.cc-ghost {
  margin-right: auto;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--cc-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cc-outline, .cc-solid { min-width: 112px; }
.cc-outline { border: 1.5px solid var(--cc-text); background: transparent; color: var(--cc-text); }
.cc-outline:hover { background: var(--cc-alt); }
.cc-solid { border: 1.5px solid var(--cc-primary); background: var(--cc-primary); color: var(--c-on-primary, #fff); }
.cc-solid:hover { background: var(--cc-primary-dark); border-color: var(--cc-primary-dark); }

.cc-only-open { display: none; }
.cc-open .cc-only-open { display: inline-block; }
.cc-open .cc-only-closed { display: none; }

@media (max-width: 520px) {
  .cc-banner { left: 8px; right: 8px; bottom: 8px; }
  .cc-card { padding: 18px 16px 14px; }
  .cc-actions { justify-content: stretch; }
  .cc-ghost { flex-basis: 100%; margin: 0 0 4px; text-align: left; min-height: 32px; }
  .cc-outline, .cc-solid { flex: 1 1 0; min-width: 0; }
}

@media (prefers-color-scheme: dark) {
  .cc-card { box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .04); }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-banner.cc-out { animation: none; }
  .cc-switch span, .cc-switch span::after { transition: none; }
}

/* Consenso privacy nel form newsletter del footer */
.newsletter-compact .news-privacy,
.news-privacy {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 8px 0 4px;
  font-size: .78rem;
  line-height: 1.4;
  font-weight: 400;
  cursor: pointer;
}
.news-privacy input[type="checkbox"] {
  flex: none;
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  accent-color: var(--c-primary, #1f5fbf);
}
.news-privacy a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Link "Preferenze cookie" nel footer */
.cc-prefs-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
