:root {
  --fc-consent-primary: #0d746b;
  --fc-consent-primary-contrast: #ffffff;
  --fc-consent-text: #1d2927;
  --fc-consent-muted: #435451;
  --fc-consent-border: rgba(29, 41, 39, 0.18);
  --fc-consent-bg: rgba(255, 255, 255, 0.66);
  --fc-consent-surface: rgba(255, 255, 255, 0.8);
  --fc-consent-overlay: rgba(14, 24, 23, 0.44);
  --fc-consent-shadow: 0 22px 48px rgba(14, 24, 23, 0.24);
  --fc-consent-btn-bg: rgba(255, 255, 255, 0.68);
  --fc-consent-btn-border: rgba(29, 41, 39, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root.fc {
    --fc-consent-text: #ebf2f0;
    --fc-consent-muted: #c2cdcb;
    --fc-consent-border: rgba(217, 226, 224, 0.28);
    --fc-consent-bg: rgba(14, 24, 23, 0.74);
    --fc-consent-surface: rgba(14, 24, 23, 0.82);
    --fc-consent-overlay: rgba(14, 24, 23, 0.62);
    --fc-consent-shadow: 0 24px 52px rgba(14, 24, 23, 0.42);
    --fc-consent-btn-bg: rgba(29, 41, 39, 0.72);
    --fc-consent-btn-border: rgba(194, 205, 203, 0.28);
  }
}

.fc-consent-root {
  position: fixed;
  inset: auto 0 0;
  z-index: 2147483000;
  pointer-events: none;
  font-family: var(--fc-font-text);
}

.fc-consent-banner {
  pointer-events: auto;
  margin: 0 auto;
  max-width: 980px;
  border: 1px solid var(--fc-consent-border);
  border-radius: 16px 16px 0 0;
  background: var(--fc-consent-bg);
  color: var(--fc-consent-text);
  box-shadow: var(--fc-consent-shadow);
  backdrop-filter: blur(15px) saturate(140%);
  -webkit-backdrop-filter: blur(15px) saturate(140%);
  padding: 18px 20px;
}

.fc-consent-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
}

.fc-consent-text {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.45;
  color: var(--fc-consent-muted);
}

.fc-consent-links {
  margin-top: 10px;
  font-size: 0.9rem;
}

.fc-consent-links a {
  /* Più scuro del primario: il banner è semitrasparente e su sfondi colorati
     (es. /turni) il #0d746b scendeva a 3.4:1. #005b56 regge >= 4.5:1 ovunque. */
  color: #005b56;
  text-decoration: underline;
}

.fc-consent-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fc-consent-btn {
  appearance: none;
  border: 1px solid var(--fc-consent-btn-border);
  background: var(--fc-consent-btn-bg);
  color: var(--fc-consent-text);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 130ms ease, filter 130ms ease, background-color 130ms ease;
}

.fc-consent-btn:hover,
.fc-consent-btn:focus-visible {
  filter: brightness(1.03);
  transform: translateY(-1px);
  outline: none;
}

.fc-consent-btn:active {
  transform: translateY(0);
}

.fc-consent-btn-primary {
  background: linear-gradient(135deg, #128f80 0%, #0d746b 100%);
  color: var(--fc-consent-primary-contrast);
  border-color: rgba(13, 116, 107, 0.82);
}

.fc-consent-btn-outline {
  background: rgba(255, 255, 255, 0.7);
}

@media (prefers-color-scheme: dark) {
  html.fc .fc-consent-btn-outline {
    background: rgba(47, 62, 59, 0.78);
  }
}

.fc-consent-overlay {
  position: fixed;
  inset: 0;
  background: var(--fc-consent-overlay);
  z-index: 2147483002;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.fc-consent-modal {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 620px);
  max-height: 86vh;
  overflow: auto;
  z-index: 2147483003;
  border: 1px solid var(--fc-consent-border);
  border-radius: 16px;
  background: var(--fc-consent-surface);
  color: var(--fc-consent-text);
  box-shadow: var(--fc-consent-shadow);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  padding: 18px;
}

.fc-consent-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.fc-consent-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.fc-consent-close {
  border: 0;
  background: transparent;
  color: var(--fc-consent-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.fc-consent-modal-text {
  margin: 12px 0 0;
  color: var(--fc-consent-muted);
  line-height: 1.45;
}

.fc-consent-toggle-list {
  margin: 14px 0 0;
  display: grid;
  gap: 10px;
}

.fc-consent-toggle {
  border: 1px solid var(--fc-consent-border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 6px;
  background: rgba(255, 255, 255, 0.24);
}

@media (prefers-color-scheme: dark) {
  html.fc .fc-consent-toggle {
    background: rgba(29, 41, 39, 0.5);
  }
}

.fc-consent-toggle-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.fc-consent-toggle-label {
  font-size: 0.96rem;
  font-weight: 700;
}

.fc-consent-toggle-help {
  margin: 0;
  color: var(--fc-consent-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.fc-consent-toggle input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--fc-consent-primary);
  cursor: pointer;
}

.fc-consent-toggle input[type="checkbox"][disabled] {
  opacity: 0.78;
  cursor: not-allowed;
}

.fc-consent-modal-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-b .footer-column-b.fc-cookie-managed-row {
  width: 100%;
  position: relative;
  justify-content: center;
  flex-wrap: nowrap;
  min-height: 42px;
}

.footer-b .fc-cookie-manage-wrap {
  margin: 0;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* L'aspetto della pill viene dalla classe condivisa .footer-pill in _footer.css.
   Qui solo l'icona cookie (mask). */
.footer-b .fc-cookie-manage-btn::before {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask-image: url("/immagini/cookies-icon.svg");
  mask-image: url("/immagini/cookies-icon.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  flex-shrink: 0;
}

.footer-b .fc-cookie-manage-btn-label {
  display: inline-block;
}

.fc-consent-hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .fc-consent-banner {
    border-radius: 14px 14px 0 0;
    padding: 14px;
  }

  .fc-consent-actions,
  .fc-consent-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .fc-consent-btn {
    width: 100%;
  }

  .footer-b .footer-column-b.fc-cookie-managed-row {
    flex-wrap: wrap;
    justify-content: center;
    min-height: 0;
  }

  .footer-b .fc-cookie-manage-wrap {
    position: static;
    transform: none;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    margin-bottom: 8px;
  }
}
