/* Cookie Consent Manager – DSGVO/TTDSG-konform
   Port des gleichnamigen Bausteins von praevera.de, angepasst an die
   MARA-Assist-Designtokens aus themes.css (--primary, --surface, --border, …),
   damit Banner/Modal automatisch zu [data-theme="light"|"dark"] passen. */

#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px -4px rgba(0, 0, 0, 0.12);
  padding: 1rem 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
#cookie-banner.cookie-banner--hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}
#cookie-banner .cookie-banner__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
#cookie-banner .cookie-banner__text {
  flex: 1 1 280px;
  font-size: 0.875rem;
  color: var(--on-surface);
  margin: 0;
}
#cookie-banner .cookie-banner__text a { color: var(--primary); }
#cookie-banner .cookie-banner__actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
}

/* Self-contained buttons (kein Abhängigkeit von Bootstrap/Tailwind-Utilities) */
.ccm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ccm-btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.ccm-btn-primary:hover { background: var(--primary-dark); }
.ccm-btn-outline {
  background: transparent;
  color: var(--on-surface);
  border-color: var(--border);
}
.ccm-btn-outline:hover { background: var(--surface-variant); }

/* Einstellungs-Modal */
#ccm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}
#ccm-modal {
  background: var(--surface);
  color: var(--on-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl, 0 24px 60px -12px rgba(0, 0, 0, 0.4));
  max-width: 680px;
  width: 100%;
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ccm-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ccm-modal__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}
.ccm-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--on-surface-variant);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.ccm-close:hover { background: var(--surface-variant); color: var(--on-surface); }
.ccm-modal__body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
}
.ccm-intro {
  font-size: 0.875rem;
  color: var(--on-surface-variant);
  margin-bottom: 1.25rem;
}
.ccm-intro a { color: var(--primary); }
.ccm-category {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.ccm-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}
.ccm-category__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ccm-category__name {
  font-weight: 600;
  font-size: 0.95rem;
}
.ccm-category__desc {
  font-size: 0.825rem;
  color: var(--on-surface-variant);
  margin: 0 0 0.5rem;
}
/* Toggle Switch */
.ccm-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.ccm-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.ccm-toggle__slider {
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  transition: background 0.2s;
  position: relative;
}
.ccm-toggle__slider::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: var(--on-primary);
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.ccm-toggle input:checked + .ccm-toggle__slider { background: var(--primary); }
.ccm-toggle input:checked + .ccm-toggle__slider::after { transform: translateX(20px); }
.ccm-toggle input:disabled + .ccm-toggle__slider { background: var(--primary); opacity: 0.65; cursor: not-allowed; }
.ccm-toggle input:disabled + .ccm-toggle__slider::after { transform: translateX(20px); }
.ccm-toggle input:focus-visible + .ccm-toggle__slider { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Badges */
.ccm-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15em 0.5em;
  border-radius: 2rem;
  white-space: nowrap;
}
.ccm-badge--required { background: var(--alert-info-bg, rgba(37, 99, 235, 0.12)); color: var(--primary); }
.ccm-badge--ok { background: var(--alert-success-bg, #dcfce7); color: var(--alert-success-text, #166534); }
.ccm-badge--warn { background: var(--alert-warning-bg, #fef9c3); color: var(--alert-warning-text, #854d0e); }
/* Details Toggle */
.ccm-details-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
.ccm-details-toggle:hover { text-decoration: underline; }
.ccm-services { margin-top: 0.75rem; }
.ccm-service {
  background: var(--surface-variant);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}
.ccm-service__name {
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--on-surface);
}
.ccm-service__details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.75rem;
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 0.8rem;
}
.ccm-service__details dt { font-weight: 600; color: var(--on-surface); white-space: nowrap; }
.ccm-service__details dd { margin: 0; }
.ccm-no-services { font-size: 0.8rem; color: var(--on-surface-variant); margin: 0.25rem 0 0; }
/* Modal Footer */
.ccm-modal__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}
/* Scroll lock */
.ccm-body-lock { overflow: hidden; }
/* Footer cookie settings link (siehe partials, die .cookie-settings-link nutzen) */
.cookie-settings-link {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
}
