﻿/* ==========================================================================
   GDPR COOKIE CONSENT BANNER & PREFERENCES MODAL
   Design System: Assist Luce & Gas (Dark Glassmorphic & Brand Accents)
   ========================================================================== */

/* 1. Floating Bottom Banner */
.cookie-banner-wrapper {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 1180px;
  margin: 0 auto;
  z-index: 99990;
  background: rgba(11, 19, 43, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(196, 28, 124, 0.15);
  display: flex;
  flex-direction: column;
  gap: 18px;
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner-wrapper.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

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

.cookie-banner-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-magenta), var(--brand-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.cookie-banner-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #FFFFFF;
}

.cookie-banner-body {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #CBD5E1;
}

.cookie-banner-body a {
  color: var(--brand-cyan-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-banner-body a:hover {
  color: #FFFFFF;
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 9999px;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cookie-btn-accept {
  background: linear-gradient(135deg, var(--brand-magenta) 0%, #E11D48 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(196, 28, 124, 0.4);
}

.cookie-btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 28, 124, 0.6);
}

.cookie-btn-reject {
  background: rgba(255, 255, 255, 0.08);
  color: #F1F5F9;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.cookie-btn-reject:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

.cookie-btn-settings {
  background: transparent;
  color: #94A3B8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-btn-settings:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.3);
}

/* 2. Modal Preferenze Cookie */
.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99995;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cookie-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.cookie-modal-container {
  background: #0D1527;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(14, 165, 233, 0.15);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-modal-backdrop.open .cookie-modal-container {
  transform: scale(1);
}

.cookie-modal-header {
  padding: 24px 28px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cookie-modal-header h3 {
  font-size: 1.25rem;
  color: #FFFFFF;
  margin: 0;
}

.cookie-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #94A3B8;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.cookie-modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

.cookie-modal-content {
  padding: 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: #CBD5E1;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.cookie-category-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cookie-category-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.0625rem;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cookie-badge-required {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Custom Switch Toggle */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

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

.cookie-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 34px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
}

.cookie-switch input:checked + .cookie-slider {
  background-color: var(--brand-magenta);
}

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

.cookie-switch input:disabled + .cookie-slider {
  cursor: not-allowed;
  opacity: 0.7;
}

.cookie-category-desc {
  font-size: 0.875rem;
  color: #94A3B8;
  margin: 0;
}

.cookie-modal-footer {
  padding: 20px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(3, 7, 18, 0.3);
}

@media (max-width: 768px) {
  .cookie-banner-wrapper {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 20px;
    border-radius: 16px;
  }
  .cookie-banner-actions {
    flex-direction: column;
    width: 100%;
  }
  .cookie-btn {
    width: 100%;
    text-align: center;
  }
  .cookie-modal-footer {
    flex-direction: column;
  }
  .cookie-modal-footer .cookie-btn {
    width: 100%;
  }
}