/* =============================================================================
   CONSENT.CSS — Banner cookie + modale preferenze (GDPR / ePrivacy)
   Coerente con i token di style.css (variabili in :root). Nessun colore fisso.
   ========================================================================== */

/* --------------------------------------------------------------- BANNER */
.cc-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-glass);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  transform: translateY(140%);
  opacity: 0;
  transition: transform .45s cubic-bezier(.22,1,.36,1), opacity .45s ease;
}
.cc-banner.cc-show { transform: translateY(0); opacity: 1; }

.cc-banner__title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.cc-banner__title svg { width: 20px; height: 20px; color: var(--accent); }
.cc-banner__text {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.6;
}
.cc-banner__text a { color: var(--accent); text-decoration: underline; }

.cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cc-btn {
  font-family: var(--body);
  font-weight: 600;
  font-size: .9rem;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .1s ease;
}
.cc-btn:hover { border-color: var(--accent); }
.cc-btn:active { transform: translateY(1px); }
.cc-btn--primary {
  background: var(--grad);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 700;
}
.cc-btn--primary:hover { filter: brightness(1.05); border-color: transparent; }
.cc-btn--grow { flex: 1 1 auto; }

/* --------------------------------------------------------------- MODALE */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 5, 10, .62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.cc-modal.cc-show { display: flex; }
.cc-modal__panel {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-soft);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  animation: cc-pop .3s cubic-bezier(.22,1,.36,1);
}
@keyframes cc-pop {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.cc-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.cc-modal__title { font-family: var(--font); font-weight: 700; font-size: 1.25rem; margin: 0; }
.cc-modal__lead { color: var(--muted); font-size: .9rem; margin: 0 0 18px; }
.cc-close {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--muted);
  border-radius: 9px;
  width: 34px; height: 34px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.cc-close:hover { color: var(--text); border-color: var(--accent); }

.cc-cat {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 16px;
  margin-bottom: 12px;
  background: var(--bg-soft-2);
}
.cc-cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.cc-cat__name { font-weight: 600; font-size: .98rem; }
.cc-cat__desc { color: var(--muted); font-size: .85rem; margin: 0; line-height: 1.55; }
.cc-cat__badge {
  font-family: var(--mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
  border: 1px solid var(--line-2);
  border-radius: 99px;
  padding: 3px 9px;
}

/* Switch accessibile */
.cc-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cc-track {
  position: absolute; inset: 0;
  background: var(--line-2);
  border-radius: 99px;
  transition: background .2s ease;
}
.cc-track::before {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: var(--text);
  border-radius: 50%;
  transition: transform .2s ease;
}
.cc-switch input:checked + .cc-track { background: var(--accent); }
.cc-switch input:checked + .cc-track::before { transform: translateX(20px); background: var(--accent-ink); }
.cc-switch input:disabled { cursor: not-allowed; }
.cc-switch input:disabled + .cc-track { opacity: .65; }
.cc-switch input:focus-visible + .cc-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.cc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* Slot per riaprire le preferenze (link in footer) */
.cc-link {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.cc-link:hover { color: var(--accent); }

/* ----------------------------------------------- PAGINA LEGALE (privacy) */
.article-body.legal h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.15; margin: 0 0 .4rem; }
.article-body.legal h2 {
  font-family: var(--font);
  font-size: 1.25rem;
  margin: 2rem 0 .7rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.article-body.legal h2:first-of-type { border-top: none; padding-top: 0; }
.article-body.legal ul { margin: 0 0 1.1em; padding-left: 1.2rem; }
.article-body.legal a { color: var(--accent); text-decoration: underline; }

.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
.cc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cc-table th, .cc-table td {
  text-align: left;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.cc-table thead th {
  background: var(--bg-soft-2);
  font-family: var(--mono);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.cc-table tbody tr:last-child td { border-bottom: none; }
.cc-table td:first-child { font-family: var(--mono); color: var(--accent); white-space: nowrap; }

/* ----------------------------------------------- FOOTER: link legali */
.footer__legal { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.footer__legal a, .footer__legal .cc-link { color: var(--muted); font-size: .9rem; }
.footer__legal a:hover, .footer__legal .cc-link:hover { color: var(--accent); }

@media (max-width: 520px) {
  .cc-actions { flex-direction: column; }
  .cc-btn { width: 100%; }
  .cc-modal__actions .cc-btn { flex: 1 1 100%; }
}
