/*
 * consent.css – DSGVO/§25 TDDDG consent banner
 * ────────────────────────────────────────────
 * Uses the site design tokens (--primary, core-theme vars) so the banner
 * matches the rest of the site. No inline styles → works under the strict
 * Content-Security-Policy (style-src 'self').
 */

.consent-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 540px;
  z-index: 2000;
}

.consent-banner[hidden] {
  display: none !important;
}

.consent-card {
  background: var(--surface, #fff);
  color: var(--forest, #0e1c10);
  border: 1px solid var(--line, rgba(14, 28, 16, 0.08));
  border-radius: var(--radius-lg, 20px);
  box-shadow: var(--shadow-lg, 0 20px 56px rgba(14, 28, 16, 0.13));
  padding: 24px;
  max-height: 85vh;
  overflow-y: auto;
}

.consent-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 10px;
  color: var(--forest, #0e1c10);
}

.consent-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--stone, #4a5e50);
  margin: 0 0 18px;
}

.consent-text a {
  color: var(--primary, #0f5132);
  text-decoration: underline;
}

/* ── Action buttons (equal weight: accept & reject side by side) ── */
.consent-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 480px) {
  .consent-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .consent-actions .consent-btn--primary,
  .consent-actions .consent-btn--reject {
    flex: 1 1 0;
  }
}

.consent-btn {
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 12px 18px;
  border-radius: var(--radius-sm, 9px);
  border: 1px solid transparent;
  transition: all 0.2s var(--ease-out, ease);
}

/* Accept and Reject are visually equivalent (no dark pattern). */
.consent-btn--primary {
  background: var(--primary, #0f5132);
  color: #fff;
}
.consent-btn--primary:hover {
  background: var(--primary-light, #198754);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md, 0 8px 32px rgba(14, 28, 16, 0.10));
}

.consent-btn--reject {
  background: var(--surface, #fff);
  color: var(--forest, #0e1c10);
  border-color: var(--line-strong, rgba(14, 28, 16, 0.15));
}
.consent-btn--reject:hover {
  background: var(--bg, #f7f9f5);
  transform: translateY(-1px);
}

/* Settings is the tertiary option. */
.consent-btn--settings {
  background: transparent;
  color: var(--muted, #6b7e70);
  text-decoration: underline;
  padding: 12px 8px;
}
.consent-btn--settings:hover {
  color: var(--primary, #0f5132);
}

.consent-btn:focus-visible {
  outline: 2px solid var(--primary, #0f5132);
  outline-offset: 2px;
}

/* ── Granular settings panel ── */
.consent-details {
  margin-top: 18px;
  border-top: 1px solid var(--line, rgba(14, 28, 16, 0.08));
  padding-top: 18px;
}

.consent-details[hidden] {
  display: none !important;
}

.consent-cat {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface-tinted, #f2f7f0);
  border: 1px solid var(--line, rgba(14, 28, 16, 0.08));
  border-radius: var(--radius-md, 14px);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.consent-cat-info {
  flex: 1;
}

.consent-cat-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--forest, #0e1c10);
}

.consent-cat-desc {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted, #6b7e70);
  margin-top: 4px;
}

.consent-always {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary, #0f5132);
  background: var(--mist, #c8e8d0);
  padding: 4px 10px;
  border-radius: var(--radius-pill, 999px);
  white-space: nowrap;
}

/* Toggle switch */
.consent-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.consent-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.consent-slider {
  position: absolute;
  inset: 0;
  background: var(--line-strong, rgba(14, 28, 16, 0.15));
  border-radius: var(--radius-pill, 999px);
  transition: background 0.25s var(--ease-out, ease);
  cursor: pointer;
}
.consent-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-xs, 0 1px 4px rgba(14, 28, 16, 0.05));
  transition: transform 0.25s var(--ease-out, ease);
}
.consent-switch input:checked + .consent-slider {
  background: var(--primary, #0f5132);
}
.consent-switch input:checked + .consent-slider::before {
  transform: translateX(20px);
}
.consent-switch input:focus-visible + .consent-slider {
  outline: 2px solid var(--primary, #0f5132);
  outline-offset: 2px;
}

.consent-save {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: var(--primary, #0f5132);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm, 9px);
  transition: background 0.2s var(--ease-out, ease);
}
.consent-save:hover {
  background: var(--primary-light, #198754);
}

.consent-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
  font-size: 0.8rem;
}
.consent-links a {
  color: var(--muted, #6b7e70);
  text-decoration: none;
}
.consent-links a:hover {
  color: var(--primary, #0f5132);
  text-decoration: underline;
}

/* Footer "Cookie-Einstellungen" trigger – styled like the other footer links */
.consent-reopen {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .consent-btn,
  .consent-slider,
  .consent-slider::before,
  .consent-save {
    transition: none;
  }
}
