/* ============================================================
   Cookie Consent Banner & Modal — Dott. Eugenio Bruni
   GDPR / ePrivacy / Google Consent Mode v2 Compliant
   ============================================================ */

/* Banner principale */
#dottbruni-cookie-banner {
   position: fixed;
   bottom: 0;
   left: 0;
   right: 0;
   z-index: 999999;
   background: #1e293b;
   color: #f8fafc;
   padding: 18px 24px;
   font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
   font-size: 14px;
   line-height: 1.6;
   box-shadow: 0 -4px 25px rgba(0,0,0,0.4);
   display: none;
   border-top: 3px solid #0284c7;
}

#dottbruni-cookie-banner.dottbruni-visible {
   display: block;
   animation: dottbruniFadeUp 0.3s ease-out;
}

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

#dottbruni-cookie-banner .dottbruni-cookie-inner {
   max-width: 1200px;
   margin: 0 auto;
   display: flex;
   align-items: center;
   flex-wrap: wrap;
   gap: 16px;
}

#dottbruni-cookie-banner .dottbruni-cookie-text {
   flex: 1 1 360px;
}

#dottbruni-cookie-banner .dottbruni-cookie-text strong {
   color: #38bdf8;
   font-weight: 600;
}

#dottbruni-cookie-banner .dottbruni-cookie-text a {
   color: #38bdf8;
   text-decoration: underline;
}

#dottbruni-cookie-banner .dottbruni-cookie-text a:hover {
   color: #ffffff;
}

#dottbruni-cookie-banner .dottbruni-cookie-actions {
   display: flex;
   gap: 10px;
   flex-wrap: wrap;
   flex-shrink: 0;
   align-items: center;
}

.dottbruni-btn-accept {
   background: #0284c7;
   color: #ffffff !important;
   border: none;
   border-radius: 4px;
   padding: 10px 20px;
   font-size: 13.5px;
   font-weight: 600;
   cursor: pointer;
   transition: background 0.2s, transform 0.15s;
   white-space: nowrap;
}

.dottbruni-btn-accept:hover {
   background: #0369a1;
   transform: translateY(-1px);
}

.dottbruni-btn-reject {
   background: transparent;
   color: #cbd5e1 !important;
   border: 1px solid #64748b;
   border-radius: 4px;
   padding: 10px 20px;
   font-size: 13.5px;
   font-weight: 600;
   cursor: pointer;
   transition: all 0.2s;
   white-space: nowrap;
}

.dottbruni-btn-reject:hover {
   border-color: #38bdf8;
   color: #38bdf8 !important;
}

.dottbruni-btn-settings {
   background: transparent;
   color: #94a3b8 !important;
   border: none;
   padding: 10px 12px;
   font-size: 13px;
   cursor: pointer;
   text-decoration: underline;
   white-space: nowrap;
}

.dottbruni-btn-settings:hover {
   color: #f8fafc !important;
}

/* Floating Badge */
#dottbruni-cookie-badge {
   position: fixed;
   bottom: 20px;
   left: 20px;
   width: 42px;
   height: 42px;
   border-radius: 50%;
   background: #1e293b;
   color: #38bdf8;
   display: flex;
   align-items: center;
   justify-content: center;
   box-shadow: 0 4px 16px rgba(0,0,0,0.3);
   cursor: pointer;
   z-index: 999990;
   transition: all 0.25s ease;
   border: 1px solid rgba(56,189,248,0.4);
   font-size: 17px;
}

#dottbruni-cookie-badge:hover {
   transform: scale(1.1);
   background: #0284c7;
   color: #ffffff;
}

/* Modal Preferenze Avanzate */
#dottbruni-cookie-overlay {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: rgba(15, 23, 42, 0.75);
   z-index: 1000000;
   display: none;
   align-items: center;
   justify-content: center;
   padding: 20px;
   backdrop-filter: blur(2px);
}

#dottbruni-cookie-overlay.dottbruni-visible {
   display: flex;
}

#dottbruni-cookie-panel {
   background: #ffffff;
   color: #1e293b;
   border-radius: 8px;
   padding: 28px;
   max-width: 620px;
   width: 100%;
   max-height: 85vh;
   overflow-y: auto;
   font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
   box-shadow: 0 10px 40px rgba(0,0,0,0.4);
   position: relative;
   border-top: 4px solid #0284c7;
}

#dottbruni-cookie-panel h3 {
   font-size: 20px;
   font-weight: 700;
   margin: 0 0 12px 0;
   color: #0f172a;
   display: flex;
   align-items: center;
   justify-content: space-between;
}

#dottbruni-cookie-panel .dottbruni-modal-close {
   background: none;
   border: none;
   font-size: 24px;
   cursor: pointer;
   color: #64748b;
   line-height: 1;
}

#dottbruni-cookie-panel .dottbruni-modal-close:hover {
   color: #0f172a;
}

#dottbruni-cookie-panel .dottbruni-modal-intro {
   font-size: 13.5px;
   color: #475569;
   margin-bottom: 18px;
   line-height: 1.5;
}

#dottbruni-cookie-panel .dottbruni-cookie-category {
   border: 1px solid #e2e8f0;
   border-radius: 6px;
   padding: 14px 16px;
   margin-bottom: 12px;
   display: flex;
   align-items: flex-start;
   gap: 14px;
   background: #f8fafc;
}

#dottbruni-cookie-panel .dottbruni-cat-label {
   font-weight: 600;
   font-size: 14.5px;
   margin-bottom: 4px;
   color: #0f172a;
   display: flex;
   align-items: center;
   gap: 8px;
}

#dottbruni-cookie-panel .dottbruni-badge-always {
   font-size: 11px;
   background: #e0f2fe;
   color: #0369a1;
   padding: 2px 7px;
   border-radius: 4px;
   font-weight: 700;
}

#dottbruni-cookie-panel .dottbruni-cat-desc {
   font-size: 13px;
   color: #64748b;
   line-height: 1.5;
}

#dottbruni-cookie-panel .dottbruni-cat-toggle {
   flex-shrink: 0;
   margin-top: 3px;
}

#dottbruni-cookie-panel .dottbruni-cat-toggle input[type="checkbox"] {
   width: 18px;
   height: 18px;
   cursor: pointer;
   accent-color: #0284c7;
}

#dottbruni-cookie-panel .dottbruni-panel-actions {
   display: flex;
   gap: 10px;
   margin-top: 22px;
   flex-wrap: wrap;
   justify-content: flex-end;
}

#dottbruni-cookie-reopen, .dottbruni-cookie-reopen-link {
   cursor: pointer;
   text-decoration: underline;
}

@media (max-width: 600px) {
   #dottbruni-cookie-banner .dottbruni-cookie-actions {
      width: 100%;
   }
   .dottbruni-btn-accept, .dottbruni-btn-reject {
      flex: 1;
      text-align: center;
   }
   #dottbruni-cookie-panel {
      padding: 18px;
   }
   #dottbruni-cookie-panel .dottbruni-panel-actions {
      flex-direction: column;
   }
   #dottbruni-cookie-panel .dottbruni-panel-actions button {
      width: 100%;
      text-align: center;
   }
}
