/* ==========================================================================
   Morandi Consulenze - Tactical Cookie Consent & Preferences Center
   Allineato all'identità visiva: Accent Blue (#52A7E0), Slate (#5F6C7A), Dark (#171717)
   Font: 'Merriweather Sans', sans-serif
   ========================================================================== */

#mc-cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 960px;
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(23, 23, 23, 0.15);
  padding: 24px 28px;
  z-index: 999999;
  font-family: 'Merriweather Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #171717;
  box-sizing: border-box;
  display: none;
  animation: mcSlideUp 0.35s ease-out forwards;
}

@keyframes mcSlideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

#mc-cookie-banner.show {
  display: block;
}

.mc-banner-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.mc-banner-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #171717;
  margin: 0;
  line-height: 1.3;
}

.mc-banner-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555555;
  margin: 0 0 18px;
}

.mc-banner-text a {
  color: #52A7E0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mc-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.mc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  font-family: 'Merriweather Sans', sans-serif;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s ease;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mc-btn-primary {
  background: #52A7E0;
  color: #ffffff;
}

.mc-btn-primary:hover {
  background: #3B92CE;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(82, 167, 224, 0.3);
}

.mc-btn-secondary {
  background: #F1F5F9;
  color: #171717;
  border: 1px solid #CBD5E1;
}

.mc-btn-secondary:hover {
  background: #E2E8F0;
}

.mc-btn-link {
  background: transparent;
  color: #5F6C7A;
  border: 1px solid #5F6C7A;
}

.mc-btn-link:hover {
  background: #F8FAFC;
  color: #171717;
  border-color: #171717;
}

/* Modale Preferenze */
#mc-cookie-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 23, 23, 0.65);
  backdrop-filter: blur(3px);
  z-index: 1000000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

#mc-cookie-modal-overlay.show {
  display: flex;
}

.mc-modal-container {
  background: #ffffff;
  border-radius: 12px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  font-family: 'Merriweather Sans', sans-serif;
  animation: mcModalZoom 0.25s ease-out;
}

@keyframes mcModalZoom {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.mc-modal-header {
  padding: 22px 28px 16px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mc-modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #171717;
  margin: 0;
}

.mc-modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #828282;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
}

.mc-modal-close:hover {
  color: #171717;
  background: #F1F5F9;
}

.mc-modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  color: #171717;
  font-size: 0.95rem;
  line-height: 1.6;
}

.mc-modal-desc {
  color: #555555;
  margin-bottom: 20px;
}

.mc-category-card {
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 14px;
  background: #F8FAFC;
}

.mc-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.mc-category-title {
  font-weight: 700;
  color: #171717;
  font-size: 1.05rem;
  margin: 0;
}

.mc-category-status {
  font-size: 0.8rem;
  font-weight: 700;
  color: #166534;
  background: #DCFCE7;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mc-category-desc {
  font-size: 0.88rem;
  color: #555555;
  margin: 0;
}

/* Switch toggle */
.mc-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.mc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.mc-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #CBD5E1;
  transition: .3s;
  border-radius: 24px;
}

.mc-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .mc-slider {
  background-color: #52A7E0;
}

input:checked + .mc-slider:before {
  transform: translateX(20px);
}

.mc-modal-footer {
  padding: 18px 28px;
  border-top: 1px solid #E2E8F0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #F8FAFC;
}

/* Floating Cookie Badge */
#mc-cookie-badge {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: #5F6C7A;
  color: #ffffff;
  border: 1px solid #4B5563;
  border-radius: 28px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: 'Merriweather Sans', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  z-index: 999990;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#mc-cookie-badge:hover {
  background: #52A7E0;
  border-color: #52A7E0;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(82, 167, 224, 0.35);
}

#mc-cookie-badge svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

@media (max-width: 600px) {
  #mc-cookie-banner {
    bottom: 12px;
    width: calc(100% - 24px);
    padding: 18px;
  }
  .mc-banner-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .mc-btn {
    width: 100%;
  }
  .mc-modal-footer {
    flex-direction: column;
  }
  .mc-modal-footer .mc-btn {
    width: 100%;
  }
}
