/* ==========================================================================
   New Paint S.r.l. - Cookie Consent & Preferences Center
   Allineato alla brand identity: Navy (#152440), Arancio (#FF8000), Carta (#FBFAF7)
   ========================================================================== */

#np-cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 960px;
  background: var(--chiaro, #ffffff);
  border: 1px solid var(--bordo, #E2DED6);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(14, 26, 46, 0.18);
  padding: 24px 28px;
  z-index: 99999;
  font-family: var(--corpo, 'Source Sans 3', 'Segoe UI', system-ui, sans-serif);
  color: var(--testo, #16202F);
  box-sizing: border-box;
  display: none;
  animation: npSlideUp 0.35s ease-out forwards;
}

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

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

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

.np-banner-title {
  font-family: var(--display, 'Archivo', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy, #152440);
  margin: 0;
}

.np-banner-text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--testo-2, #4C566B);
  margin: 0 0 18px;
}

.np-banner-text a {
  color: var(--arancio-testo, #B85400);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.np-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--corpo, sans-serif);
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.np-btn-primary {
  background: var(--arancio, #FF8000);
  color: var(--notte, #0E1A2E);
}

.np-btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.np-btn-secondary {
  background: var(--carta-2, #F2EFE9);
  color: var(--navy, #152440);
  border: 1px solid var(--bordo, #E2DED6);
}

.np-btn-secondary:hover {
  background: #E8E4DC;
}

.np-btn-link {
  background: transparent;
  color: var(--navy, #152440);
  border: 1px solid #C4CAD6;
}

.np-btn-link:hover {
  background: var(--carta, #FBFAF7);
}

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

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

.np-modal-container {
  background: var(--chiaro, #ffffff);
  border-radius: 14px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(14, 26, 46, 0.25);
  overflow: hidden;
  font-family: var(--corpo, sans-serif);
  animation: npModalZoom 0.25s ease-out;
}

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

.np-modal-header {
  padding: 22px 28px 16px;
  border-bottom: 1px solid var(--bordo, #E2DED6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.np-modal-title {
  font-family: var(--display, sans-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy, #152440);
  margin: 0;
}

.np-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--testo-2, #4C566B);
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
}

.np-modal-close:hover {
  color: var(--testo, #16202F);
  background: var(--carta-2, #F2EFE9);
}

.np-modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  color: var(--testo, #16202F);
  font-size: 0.95rem;
  line-height: 1.55;
}

.np-modal-desc {
  color: var(--testo-2, #4C566B);
  margin-bottom: 20px;
}

.np-category-card {
  border: 1px solid var(--bordo, #E2DED6);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 14px;
  background: var(--carta, #FBFAF7);
}

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

.np-category-title {
  font-weight: 700;
  color: var(--navy, #152440);
  font-size: 1.05rem;
  margin: 0;
}

.np-category-status {
  font-size: 0.82rem;
  font-family: var(--tecnico, monospace);
  font-weight: 600;
  color: #2E7D32;
  background: #E8F5E9;
  padding: 4px 10px;
  border-radius: 20px;
}

.np-category-desc {
  font-size: 0.88rem;
  color: var(--testo-2, #4C566B);
  margin: 0;
}

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

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

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

.np-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 + .np-slider {
  background-color: var(--arancio, #FF8000);
}

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

.np-modal-footer {
  padding: 18px 28px;
  border-top: 1px solid var(--bordo, #E2DED6);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--carta, #FBFAF7);
}

/* Floating Cookie Badge */
#np-cookie-badge {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: var(--navy, #152440);
  color: #ffffff;
  border: 1px solid var(--navy-2, #24344F);
  border-radius: 28px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--corpo, sans-serif);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(14, 26, 46, 0.2);
  z-index: 99990;
  transition: all 0.2s ease;
}

#np-cookie-badge:hover {
  background: var(--arancio, #FF8000);
  color: var(--notte, #0E1A2E);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 128, 0, 0.35);
}

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

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