/**
 * Revert Consent Manager - Stile CSS Banner & Modale Preferenze GDPR
 * Colore Dominante Revert: #196c38 (Verde Foresta / Brand Revert)
 * Design: Dark Premium, Glassmorphism, Responsive Mobile-First
 */

:root {
  --revert-green: #196c38;
  --revert-green-hover: #14552c;
  --revert-green-glow: rgba(25, 108, 56, 0.4);
  --revert-black: #0a0a0a;
  --revert-card-bg: rgba(14, 14, 14, 0.97);
  --revert-modal-bg: #111111;
  --revert-modal-surface: #1a1a1a;
  --revert-white: #ffffff;
  --revert-gray-light: #e5e7eb;
  --revert-gray-muted: #9ca3af;
  --revert-border: rgba(255, 255, 255, 0.14);
  --revert-border-strong: rgba(255, 255, 255, 0.25);
}

/* Backdrop Opacizzato con Blocco Scroll Preventivo */
.revert-consent-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999990;
  animation: revertFadeIn 0.3s ease;
}

@keyframes revertFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.revert-consent-locked {
  overflow: hidden !important;
}

/* Banner Cookie Base */
.revert-consent-banner {
  position: fixed;
  bottom: 24px;
  left: 20px;
  right: 20px;
  max-width: 540px;
  margin: 0 auto;
  z-index: 9999999;
  animation: revertFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  .revert-consent-banner {
    bottom: 36px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    margin: 0;
  }
}

@keyframes revertFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 768px) {
  @keyframes revertFadeUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
  }
}

.revert-consent-card {
  background: var(--revert-card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--revert-white);
  border: 1px solid var(--revert-border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.revert-consent-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.revert-consent-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--revert-white);
  letter-spacing: -0.01em;
  margin: 0;
}

.revert-consent-text {
  font-size: 12.5px;
  color: var(--revert-gray-light);
  line-height: 1.5;
  margin: 0 0 18px 0;
}

.revert-consent-text a {
  color: var(--revert-white);
  font-weight: 600;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.revert-consent-text a:hover {
  color: var(--revert-green);
}

.revert-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Pulsanti Banner */
.revert-btn {
  flex: 1;
  min-width: 95px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-align: center;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: inherit;
}

.revert-btn-accept {
  background: var(--revert-green);
  color: var(--revert-white);
  box-shadow: 0 2px 10px var(--revert-green-glow);
}

.revert-btn-accept:hover {
  background: var(--revert-green-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--revert-green-glow);
}

.revert-btn-reject {
  background: transparent;
  color: var(--revert-white);
  border: 1px solid var(--revert-border-strong);
}

.revert-btn-reject:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--revert-white);
}

.revert-btn-customize {
  background: transparent;
  color: var(--revert-gray-muted);
  border: 1px solid transparent;
}

.revert-btn-customize:hover {
  color: var(--revert-white);
  text-decoration: underline;
}

/* Modale Preferenze Dettagliate */
.revert-consent-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.revert-consent-modal {
  background: var(--revert-modal-bg);
  color: var(--revert-white);
  width: 100%;
  max-width: 580px;
  border-radius: 16px;
  border: 1px solid var(--revert-border);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.revert-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 24px;
  background: var(--revert-modal-surface);
  border-bottom: 1px solid var(--revert-border);
}

.revert-modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--revert-white);
  margin: 0;
}

.revert-modal-subtitle {
  font-size: 11px;
  color: var(--revert-gray-muted);
  font-family: monospace;
  margin: 4px 0 0 0;
}

.revert-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--revert-gray-muted);
  line-height: 1;
  padding: 0;
}

.revert-modal-close:hover {
  color: var(--revert-white);
}

/* Schede / Tabs */
.revert-modal-tabs {
  display: flex;
  background: #0f0f0f;
  border-bottom: 1px solid var(--revert-border);
}

.revert-tab-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--revert-gray-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.revert-tab-btn.active {
  color: var(--revert-white);
  border-bottom-color: var(--revert-green);
  background: rgba(255, 255, 255, 0.03);
}

.revert-modal-body {
  padding: 20px 24px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--revert-modal-bg);
}

.revert-category-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.revert-cat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13.5px;
  color: var(--revert-white);
}

.revert-badge-always {
  font-size: 9.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: var(--revert-gray-light);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.revert-cat-desc {
  font-size: 12px;
  color: var(--revert-gray-muted);
  margin: 0;
  line-height: 1.45;
}

/* Accordion Dettagli Fornitori */
.revert-accordion-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--revert-gray-light);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 9px;
  border-radius: 5px;
  transition: all 0.2s ease;
  user-select: none;
}

.revert-accordion-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--revert-white);
  border-color: var(--revert-green);
}

.revert-accordion-chevron {
  font-size: 8px;
  color: var(--revert-gray-muted);
  transition: transform 0.2s ease;
}

.revert-vendor-list {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--revert-gray-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: revertFadeIn 0.2s ease;
}

.revert-vendor-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 5px 9px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.revert-vendor-item a {
  color: var(--revert-green);
  text-decoration: underline;
  font-size: 11px;
}

.revert-vendor-item code {
  font-family: monospace;
  font-size: 10.5px;
  color: var(--revert-gray-light);
}

/* Riquadro Diritti Privacy */
.revert-privacy-rights-box {
  background: var(--revert-modal-surface);
  border: 1px solid var(--revert-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--revert-gray-light);
  line-height: 1.5;
}

.revert-privacy-rights-box a {
  color: var(--revert-green);
  text-decoration: underline;
  font-weight: 700;
}

.revert-controller-info {
  font-size: 11px;
  color: var(--revert-gray-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  line-height: 1.5;
}

.revert-controller-info a {
  color: var(--revert-white);
}

/* Cookie Policy Tab Testo */
.revert-policy-text-container {
  font-size: 12.5px;
  color: var(--revert-gray-light);
  line-height: 1.6;
}

.revert-policy-text-container h4 {
  font-size: 16px;
  color: var(--revert-white);
  margin: 0 0 4px 0;
}

.revert-policy-date {
  font-size: 11px;
  color: var(--revert-gray-muted);
  margin-bottom: 14px;
}

.revert-policy-text-container h5 {
  font-size: 13.5px;
  color: var(--revert-white);
  margin: 16px 0 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}

.revert-policy-text-container h6 {
  font-size: 12.5px;
  color: var(--revert-green);
  margin: 12px 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.revert-policy-text-container p { margin-bottom: 10px; }
.revert-policy-text-container ul { margin-left: 18px; margin-bottom: 12px; }
.revert-policy-text-container li { margin-bottom: 6px; }
.revert-policy-text-container a { color: var(--revert-white); text-decoration: underline; }
.revert-policy-text-container a:hover { color: var(--revert-green); }

/* Footer Modale */
.revert-modal-footer {
  padding: 16px 24px;
  background: var(--revert-modal-surface);
  border-top: 1px solid var(--revert-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.revert-btn-revoke {
  background: transparent;
  color: var(--revert-gray-muted);
  border: 1px solid var(--revert-border);
  font-size: 11.5px;
  padding: 9px 14px;
  flex: none;
}

.revert-btn-revoke:hover {
  color: #dc2626;
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.12);
}

.revert-btn-save {
  background: var(--revert-green);
  color: var(--revert-white);
  padding: 10px 22px;
  font-size: 12.5px;
  flex: none;
}

.revert-btn-save:hover {
  background: var(--revert-green-hover);
}

/* Switch Toggle Verde Revert (#196c38) */
.revert-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

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

.revert-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #333338;
  transition: .3s;
  border-radius: 22px;
}

.revert-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .revert-slider {
  background-color: var(--revert-green);
}

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

.revert-checkbox-disabled {
  accent-color: var(--revert-green);
}
