/*
 * Banner cookie per le pagine statiche in public/ (pti.html,
 * richiesta-ricovero.html). Gemello dell'interfaccia React usata dall'app
 * Next.js; lo stato è gestito da consent-init.js, condiviso fra i due contesti.
 *
 * Usa le custom property già definite da queste pagine, con fallback sui
 * valori di src/sass/_variables.scss.
 */

.mc-wrap {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 9000;
  display: flex;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}

.mc-wrap[data-view="panel"] {
  inset: 0;
  align-items: center;
  padding: 16px;
}

.mc-scrim {
  position: absolute;
  inset: 0;
  background-color: rgba(45, 63, 134, 0.38);
  pointer-events: auto;
}

.mc-card {
  position: relative;
  pointer-events: auto;
  width: 100%;
  max-width: 940px;
  padding: 22px 24px 24px;
  background-color: var(--bg-surface, #f4f4f5);
  border: 1px solid var(--bg-4, #dee1ed);
  border-radius: var(--radius, 14px);
  box-shadow: 0 6px 28px rgba(45, 63, 134, 0.14);
  animation: mc-in 0.32s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)) both;
}

.mc-wrap[data-view="panel"] .mc-card {
  max-width: 620px;
  max-height: 86vh;
  overflow-y: auto;
}

.mc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.mc-title {
  margin: 0;
  font-family: var(--serif, Georgia, serif);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  color: var(--title-l, #3e4975);
}

.mc-close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 24px;
  line-height: 1;
  color: var(--title-s, #515b7e);
  background-color: transparent;
  border: 1.5px solid var(--bg-4, #dee1ed);
  border-radius: 50px;
  cursor: pointer;
  transition: 0.2s;
}

.mc-close:hover {
  color: var(--primary, #2d3f86);
  border-color: var(--border-strong, #576bb7);
  background-color: rgba(45, 63, 134, 0.06);
}

.mc-text {
  margin: 12px 0 0;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted, #7a7c85);
  max-width: 72ch;
}

.mc-link {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 14px;
  font-weight: 500;
  color: var(--primary, #2d3f86);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mc-link:hover {
  color: var(--tertiary, #604ab0);
}

.mc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

/* "Accetta tutti" e "Rifiuta tutti" sono identici per dimensione, peso e
   contrasto. "Personalizza" è secondario ma con la stessa area di tocco. */
.mc-btn {
  flex: 1 1 190px;
  font-family: var(--sans, system-ui, sans-serif);
  font-weight: 600;
  letter-spacing: 0.1px;
  font-size: 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: 0.2s;
  text-align: center;
}

.mc-btn-primary {
  padding: 0.75rem 1.25rem;
  color: #f3f6fc;
  background-color: var(--primary, #2d3f86);
  border: none;
}

.mc-btn-primary:hover {
  background-color: var(--primary-hover, #7d6fae);
}

.mc-btn-outline {
  padding: calc(0.75rem - 1.5px) calc(1.25rem - 1.5px);
  color: var(--primary, #2d3f86);
  background-color: transparent;
  border: 1.5px solid var(--border-strong, #576bb7);
}

.mc-btn-outline:hover {
  background-color: rgba(45, 63, 134, 0.08);
}

.mc-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mc-cat {
  padding: 12px 16px 16px;
  border: 1px solid var(--bg-4, #dee1ed);
  border-radius: 10px;
  background-color: var(--bg-1, #e4e7f1);
}

.mc-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mc-cat-title {
  font-family: var(--sans, system-ui, sans-serif);
  font-weight: 600;
  font-size: 16px;
  color: var(--title, #3d4b7f);
  cursor: pointer;
}

.mc-cat-text {
  margin: 8px 0 0;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted, #7a7c85);
}

.mc-switch {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  position: relative;
  width: 48px;
  height: 28px;
  margin: 0;
  border: none;
  border-radius: 50px;
  background-color: #7e8296;
  cursor: pointer;
  transition: background-color 0.2s;
}

.mc-switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--bg-surface, #f4f4f5);
  transition: transform 0.2s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.mc-switch:checked {
  background-color: var(--primary, #2d3f86);
}

.mc-switch:checked::after {
  transform: translateX(20px);
}

.mc-switch:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

@media (prefers-reduced-motion: reduce) {
  .mc-card {
    animation: none;
  }
  .mc-switch::after {
    transition: none;
  }
}

@media (max-width: 521px) {
  .mc-wrap {
    padding: 8px;
  }
  .mc-card {
    padding: 16px 16px 20px;
    max-height: 82vh;
    overflow-y: auto;
  }
  .mc-title {
    font-size: 20px;
  }
}
