/* ============================================================
   Democracy Intelligence – Cookie Consent Banner (DSGVO / CoMo v2)
   Design: Passend zum DI-Designsystem (Inter, Glassmorphism, DI-Gradient)
   ============================================================ */

.di-consent-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.di-consent-backdrop.di-show {
  opacity: 1;
  visibility: visible;
}

.di-consent-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 520px;
  width: calc(100% - 48px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid rgba(20, 26, 46, 0.1);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  color: var(--ink, #141a2e);
  z-index: 9999;
  padding: 28px;
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  visibility: hidden;
  transition: opacity 0.28s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1),
              visibility 0.28s ease;
}

.di-consent-banner.di-show {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

/* Header */
.di-consent-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.di-consent-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(32, 85, 115, 0.12), rgba(192, 38, 211, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c026d3;
  flex-shrink: 0;
}

.di-consent-title {
  margin: 0;
  font-family: var(--font-head, 'Montserrat', sans-serif);
  font-size: 19px;
  line-height: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink, #141a2e);
}

.di-consent-intro {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 22px;
  color: var(--text, #3b435b);
}

/* Details Accordion */
.di-consent-details {
  display: none;
  margin-bottom: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(20, 26, 46, 0.08);
}

.di-consent-details.di-open {
  display: block;
}

.di-consent-cat {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 14px;
  margin-bottom: 10px;
}

.di-consent-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.di-consent-cat-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.di-consent-cat-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, #141a2e);
}

.di-consent-cat-desc {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 18px;
  color: #64748b;
}

.di-consent-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #475569;
}

/* Custom Checkbox */
.di-consent-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  margin: 0;
}

.di-consent-toggle:checked {
  background: #c026d3;
  border-color: #c026d3;
}

.di-consent-toggle:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.di-consent-toggle:disabled {
  background: #cbd5e1;
  border-color: #cbd5e1;
  cursor: not-allowed;
}

/* Buttons */
.di-consent-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.di-consent-row {
  display: flex;
  gap: 10px;
}

.di-consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 12px;
  font-family: var(--font-head, 'Montserrat', sans-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.di-consent-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.di-consent-btn-accept {
  flex: 1;
  background: var(--grad, linear-gradient(90deg, #205573, #c026d3));
  color: #ffffff;
}

.di-consent-btn-reject {
  flex: 1;
  background: #f1f5f9;
  color: var(--ink, #141a2e);
}

.di-consent-btn-reject:hover {
  background: #e2e8f0;
}

.di-consent-btn-link {
  background: none;
  border: none;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 4px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.di-consent-btn-link:hover {
  color: var(--ink, #141a2e);
}

/* Footer Links */
.di-consent-footer {
  margin-top: 14px;
  font-size: 12px;
  text-align: center;
  color: #94a3b8;
}

.di-consent-footer a {
  color: #64748b;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin: 0 6px;
}

.di-consent-footer a:hover {
  color: var(--ink, #141a2e);
}

/* Mobile Optimierung */
@media (max-width: 600px) {
  .di-consent-banner {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    padding: 22px 18px;
    border-radius: 20px;
  }
  .di-consent-row {
    flex-direction: column;
  }
}
