/**
 * Cookie Guardian Standalone - banner.css
 * centrostudimonte.com
 * Charset: ASCII-safe (no special characters in comments)
 */

/* ── Reset scoped ─────────────────────────────────────────────────────────── */
#cg-banner *,
#cg-banner *::before,
#cg-banner *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: inherit;
  line-height: normal;
}

/* ── Variabili colore ─────────────────────────────────────────────────────── */
#cg-banner {
  --cg-bg:        #ffffff;
  --cg-text:      #1e293b;
  --cg-muted:     #64748b;
  --cg-border:    #e2e8f0;
  --cg-surface:   #f8fafc;
  --cg-accent:    #2563eb;
  --cg-accept:    #16a34a;
  --cg-reject-bg: #f8fafc;
  --cg-shadow:    0 -4px 24px rgba(0,0,0,.10);
  --cg-radius:    12px;
  --cg-z:         999999;
}

/* ── Banner container ─────────────────────────────────────────────────────── */
#cg-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--cg-z);
  background: var(--cg-bg);
  border-top: 1px solid var(--cg-border);
  box-shadow: var(--cg-shadow);
  padding: 20px 24px;
  display: none;
  font-size: 14px;
  color: var(--cg-text);
}

#cg-banner.cg-visible {
  display: block;
}

/* ── Layout interno ───────────────────────────────────────────────────────── */
.cg-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cg-text {
  flex: 1 1 320px;
  font-size: 13px;
  color: var(--cg-text);
  line-height: 1.55;
}

.cg-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--cg-text);
}

.cg-text a {
  color: var(--cg-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cg-text a:hover {
  color: #1d4ed8;
}

/* ── Badge giurisdizione ──────────────────────────────────────────────────── */
.cg-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 6px;
  background: #dbeafe;
  color: #1e40af;
}

.cg-badge.nlpd  { background: #dcfce7; color: #166534; }
.cg-badge.gdpr  { background: #dbeafe; color: #1e40af; }
.cg-badge.ccpa  { background: #d1fae5; color: #065f46; }
.cg-badge.lgpd  { background: #fef9c3; color: #854d0e; }

/* ── Bottoni ──────────────────────────────────────────────────────────────── */
.cg-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  flex-wrap: wrap !important;
}

.cg-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 9px 18px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  border: 1px solid transparent !important;
  transition: background .15s, border-color .15s, color .15s !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  line-height: 1 !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  outline: none !important;
  vertical-align: middle !important;
}

/* Accetta tutto */
.cg-btn-accept {
  background: #16a34a !important;
  background-color: #16a34a !important;
  color: #ffffff !important;
  border-color: #16a34a !important;
}

.cg-btn-accept:hover,
.cg-btn-accept:focus {
  background: #15803d !important;
  background-color: #15803d !important;
  border-color: #15803d !important;
  color: #ffffff !important;
}

/* Solo necessari */
.cg-btn-reject {
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  color: #1e293b !important;
  border-color: #e2e8f0 !important;
}

.cg-btn-reject:hover,
.cg-btn-reject:focus {
  background: #f1f5f9 !important;
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #1e293b !important;
}

/* Personalizza */
.cg-btn-manage {
  background: transparent !important;
  background-color: transparent !important;
  color: #64748b !important;
  border-color: transparent !important;
  font-weight: 500 !important;
  font-size: 12px !important;
  padding: 9px 10px !important;
  box-shadow: none !important;
}

.cg-btn-manage:hover,
.cg-btn-manage:focus {
  color: #1e293b !important;
  text-decoration: underline !important;
  background: transparent !important;
  background-color: transparent !important;
}

/* ── Pannello preferenze ──────────────────────────────────────────────────── */
#cg-panel {
  position: fixed;
  inset: 0;
  z-index: 99999999999999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45);
  padding: 16px;
}

#cg-panel.cg-open {
  display: flex;
}

.cg-modal {
  background: #fff;
  border-radius: var(--cg-radius);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.20);
}

.cg-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  border-bottom: 1px solid var(--cg-border);
  padding-bottom: 16px;
}

.cg-modal-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--cg-text);
  margin: 0;
}

.cg-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cg-muted);
  font-size: 22px;
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
  transition: color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cg-close:hover {
  color: var(--cg-text);
}

.cg-modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Categoria (riga con toggle) ──────────────────────────────────────────── */
.cg-category {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cg-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cg-category-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cg-text);
}

.cg-category-desc {
  font-size: 12px;
  color: var(--cg-muted);
  line-height: 1.5;
}

/* Toggle switch */
.cg-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.cg-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cg-toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 22px;
  transition: background .2s;
  cursor: pointer;
}

.cg-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}

.cg-toggle input:checked + .cg-toggle-slider {
  background: #16a34a;
}

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

.cg-toggle input:disabled + .cg-toggle-slider {
  background: #94a3b8;
  cursor: not-allowed;
}

/* ── Cookie list nel modale ───────────────────────────────────────────────── */
.cg-cookie-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cg-cookie-list li {
  font-size: 11px;
  color: var(--cg-muted);
  padding-left: 12px;
  position: relative;
}

.cg-cookie-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cg-border);
}

/* ── Footer modale ────────────────────────────────────────────────────────── */
.cg-modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--cg-border);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Toast notifica ───────────────────────────────────────────────────────── */
#cg-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: calc(var(--cg-z) + 2);
  background: #1e293b;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

#cg-toast.cg-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Floating button (riapertura) ─────────────────────────────────────────── */
#cg-fab {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 999999 !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: #2563eb !important;
  background-color: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 16px rgba(37,99,235,.35) !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background .15s, transform .15s !important;
  font-size: 20px !important;
  line-height: 1 !important;
  padding: 0 !important;
  text-decoration: none !important;
}

#cg-fab.cg-visible {
  display: flex !important;
}

#cg-fab:hover {
  background: #1d4ed8 !important;
  background-color: #1d4ed8 !important;
  transform: scale(1.08) !important;
  color: #ffffff !important;
}

/* ── Responsive mobile ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #cg-banner {
    padding: 16px;
  }

  .cg-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .cg-actions {
    flex-direction: column;
    gap: 8px;
  }

  .cg-btn {
    width: 100%;
    justify-content: center;
    padding: 11px 16px;
  }

  .cg-btn-manage {
    text-align: center;
  }

  .cg-modal-footer {
    flex-direction: column;
  }

  .cg-modal-footer .cg-btn {
    width: 100%;
  }

  #cg-fab {
    bottom: 12px;
    right: 12px;
  }
}