/* Consenso cookie + link footer — estratto da styles.css (landing). Da caricare dopo styles.css in marketing-gratis.html */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.footer__link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.footer__link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* --------------------------------------------------------------------------
   14. CONSENSO COOKIE — card compatta, preferenze inline
   -------------------------------------------------------------------------- */

.cc {
  position: fixed;
  z-index: 140;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: clamp(10px, 1.6vw, 20px);
  padding-bottom: max(clamp(10px, 1.6vw, 20px), env(safe-area-inset-bottom));
  pointer-events: none;
}

.cc[hidden] {
  display: none;
}

.cc__card:focus {
  outline: none;
}

/* ---------------- Card ---------------- */
.cc__card {
  pointer-events: auto;
  position: relative;
  width: min(100%, 448px);
  padding: 18px 18px 14px;
  border: 1px solid rgba(228, 228, 231, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 1px 2px rgba(43, 43, 43, 0.05),
    0 24px 60px -24px rgba(43, 43, 43, 0.4), 0 8px 20px -12px rgba(43, 43, 43, 0.2);
  animation: cc-enter 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cc-enter {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cc__card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.9),
    rgba(228, 228, 231, 0.5) 45%,
    rgba(255, 255, 255, 0.9)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@media (min-width: 900px) {
  .cc {
    justify-content: flex-start;
    padding-left: clamp(16px, 2vw, 28px);
  }
}

/* ---------------- Vista principale ---------------- */
.cc__head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.cc__mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(43, 43, 43, 0.7);
}

.cc__mark svg {
  width: 17px;
  height: 17px;
}

.cc__headtext {
  min-width: 0;
}

.cc__title {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.cc__text {
  margin-top: 4px;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.5;
  text-wrap: pretty;
}

.cc__text--tight {
  margin-top: 3px;
  font-size: 11.5px;
}

/* ---------------- Azioni ---------------- */
.cc__actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
}

.cc__btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.22s var(--ease), background 0.22s var(--ease),
    border-color 0.22s var(--ease), box-shadow 0.22s var(--ease),
    color 0.22s var(--ease);
}

.cc__btn--primary {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(43, 43, 43, 0.75);
}

.cc__btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -12px rgba(43, 43, 43, 0.85);
}

.cc__btn--primary:active {
  transform: translateY(0) scale(0.99);
}

.cc__btn--ghost {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
}

.cc__btn--ghost:hover {
  border-color: rgba(43, 43, 43, 0.24);
  background: var(--ice);
}

.cc__btn--sm {
  flex: 0 0 auto;
}

.cc__link {
  flex: 0 0 auto;
  padding: 9px 2px 9px 8px;
  border: 0;
  background: none;
  color: var(--secondary);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(43, 43, 43, 0.25);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.22s var(--ease), text-decoration-color 0.22s var(--ease);
}

.cc__link:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.cc__policy {
  margin-top: 9px;
  text-align: center;
  color: var(--muted);
  font-size: 10.5px;
}

.cc__policy a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.22s var(--ease);
}

.cc__policy a:hover {
  color: var(--ink);
}

.cc__btn:focus-visible,
.cc__link:focus-visible,
.cc__close:focus-visible,
.cc__policy a:focus-visible {
  outline: 2px solid rgba(43, 43, 43, 0.45);
  outline-offset: 3px;
}

/* Il focus da click non deve disegnare l'anello sul bottone pieno */
.cc__btn--primary:focus:not(:focus-visible) {
  outline: none;
}

.cc__btn:focus-visible {
  outline-offset: 2px;
}

/* ---------------- Vista preferenze (inline, stessa card) ---------------- */
.cc__view--prefs {
  animation: cc-swap 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cc-swap {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cc__prefhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cc__close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--secondary);
  cursor: pointer;
  transition: background 0.22s var(--ease), color 0.22s var(--ease),
    border-color 0.22s var(--ease);
}

.cc__close:hover {
  background: var(--ice);
  color: var(--ink);
  border-color: rgba(43, 43, 43, 0.2);
}

.cc__rows {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.cc__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ice);
}

.cc__rowtext h3 {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.cc__rowtext p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.cc__always {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.11);
  color: #15803d;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Interruttore */
.cc__switch {
  position: relative;
  flex: 0 0 auto;
  display: block;
  width: 38px;
  height: 22px;
  cursor: pointer;
}

.cc__switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cc__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d8d8dd;
  transition: background 0.25s var(--ease);
  pointer-events: none;
}

.cc__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(43, 43, 43, 0.3);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.cc__switch input:checked + .cc__track {
  background: var(--ink);
}

.cc__switch input:checked + .cc__track .cc__knob {
  transform: translateX(16px);
}

.cc__switch input:focus-visible + .cc__track {
  outline: 2px solid rgba(43, 43, 43, 0.45);
  outline-offset: 2px;
}

.cc__preffoot {
  display: flex;
  gap: 7px;
  margin-top: 12px;
}

/* ---------------- Mobile: card a tutta larghezza ---------------- */
@media (max-width: 559px) {
  .cc {
    padding: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .cc__card {
    width: 100%;
    padding: 16px 15px 13px;
    border-radius: 18px;
  }

  .cc__text {
    font-size: 11.5px;
  }

  /* Mobile: CTA principale a tutta larghezza, poi Rifiuta | Personalizza */
  .cc__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 13px;
  }

  .cc__btn--primary {
    grid-column: 1 / -1;
    min-height: 42px;
  }

  .cc__link {
    padding: 9px 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
    text-decoration: none;
    color: var(--secondary);
  }

  .cc__link:hover {
    background: var(--ice);
    color: var(--ink);
  }

  .cc__policy {
    margin-top: 11px;
  }
}

/* La sticky CTA lascia spazio alla card */
body.is-cookie-open .sticky-cta {
  transform: translateY(160%);
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .cc__card,
  .cc__view--prefs,
  .cc__knob,
  .cc__btn {
    animation: none !important;
    transition: none !important;
  }
}
