/**
 * Darco Italia - Stile CMP Nativo Apple SF UI
 */

:root {
  --gdpr-primary: #e63946;
  --gdpr-primary-hover: #c32f3a;
  --gdpr-dark: #1a1a1b;
  --gdpr-bg: rgba(255, 255, 255, 0.96);
  --gdpr-text: #1d1d1f;
  --gdpr-gray: #86868b;
  --gdpr-border: rgba(0, 0, 0, 0.08);
  --gdpr-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* --- BANNER PRINCIPALE --- */
.gdpr-banner {
  position: fixed;
  bottom: -400px;
  left: 20px;
  right: 20px;
  max-width: 960px;
  margin: 0 auto;
  background: var(--gdpr-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 24px;
  padding: 30px 35px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--gdpr-border);
  z-index: 99999;
  transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--gdpr-font);
  color: var(--gdpr-text);
}

.gdpr-banner.gdpr-show {
  bottom: 25px;
}

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

.gdpr-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--gdpr-dark);
}

.gdpr-shield-icon {
  color: var(--gdpr-primary);
}

.gdpr-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #4a4a4f;
  margin-bottom: 22px;
}

.gdpr-text a {
  color: var(--gdpr-primary);
  text-decoration: underline;
  font-weight: 500;
}

.gdpr-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- BOTTONI A PARI EVIDENZA VISIVA --- */
.gdpr-btn {
  font-family: var(--gdpr-font);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gdpr-btn-primary {
  background: var(--gdpr-primary);
  color: #ffffff;
}

.gdpr-btn-primary:hover {
  background: var(--gdpr-primary-hover);
  transform: translateY(-1px);
}

.gdpr-btn-secondary {
  background: var(--gdpr-dark);
  color: #ffffff;
}

.gdpr-btn-secondary:hover {
  background: #333336;
  transform: translateY(-1px);
}

.gdpr-btn-outline {
  background: transparent;
  color: var(--gdpr-dark);
  border: 1px solid #d2d2d7;
}

.gdpr-btn-outline:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* --- MODALE PREFERENZE --- */
.gdpr-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100000;
  font-family: var(--gdpr-font);
}

.gdpr-modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  border-radius: 28px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gdpr-modal-header {
  padding: 25px 30px;
  border-bottom: 1px solid #f0f0f2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gdpr-modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.gdpr-close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--gdpr-gray);
  cursor: pointer;
}

.gdpr-modal-body {
  padding: 25px 30px;
  overflow-y: auto;
}

.gdpr-modal-desc {
  font-size: 0.9rem;
  color: var(--gdpr-gray);
  margin-bottom: 25px;
}

.gdpr-pref-group {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid #f2f2f5;
}

.gdpr-pref-info h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gdpr-pref-info p {
  font-size: 0.86rem;
  color: var(--gdpr-gray);
  margin: 0;
  line-height: 1.5;
}

.gdpr-badge-always {
  background: #e5e5ea;
  color: #1c1c1e;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

/* --- APPLE STYLE TOGGLE SWITCH --- */
.gdpr-switch-box {
  flex-shrink: 0;
  margin-top: 4px;
}

.gdpr-switch-box input[type="checkbox"] {
  display: none;
}

.gdpr-switch {
  display: inline-block;
  width: 48px;
  height: 28px;
  background-color: #e5e5ea;
  border-radius: 28px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

.gdpr-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease;
}

.gdpr-switch-box input:checked + .gdpr-switch {
  background-color: #34c759;
}

.gdpr-switch-box input:checked + .gdpr-switch::after {
  transform: translateX(20px);
}

.gdpr-switch-box input:disabled + .gdpr-switch {
  opacity: 0.7;
  cursor: not-allowed;
}

.gdpr-modal-footer {
  padding: 20px 30px;
  border-top: 1px solid #f0f0f2;
  display: flex;
  justify-content: flex-end;
  background: #fbfbfd;
}

/* --- SCUDO FLUTTUANTE REVOCA --- */
.gdpr-floating-shield {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid var(--gdpr-border);
  color: var(--gdpr-dark);
  padding: 10px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--gdpr-font);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  z-index: 1999;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gdpr-floating-shield:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  color: var(--gdpr-primary);
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
  .gdpr-banner {
    left: 12px;
    right: 12px;
    padding: 22px 20px;
    border-radius: 20px;
  }
  .gdpr-banner.gdpr-show {
    bottom: 15px;
  }
  .gdpr-actions {
    flex-direction: column;
  }
  .gdpr-actions .gdpr-btn {
    width: 100%;
  }
  .gdpr-floating-shield {
    bottom: 20px;
    left: 20px;
    padding: 8px 12px;
  }
  .gdpr-floating-shield span {
    display: none;
  }
}