/* ──────────────────────────────────────────────────────────────────────────
   DSGVO Cookie Banner – Frontend Styles
   Design: clean, trustworthy, accessible. Accent colour via CSS custom prop.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --dcb-accent:        #2563eb;
  --dcb-accent-dark:   color-mix(in srgb, var(--dcb-accent) 80%, #000);
  --dcb-bg:            #ffffff;
  --dcb-surface:       #f8fafc;
  --dcb-border:        #e2e8f0;
  --dcb-text:          #1e293b;
  --dcb-text-muted:    #64748b;
  --dcb-radius:        12px;
  --dcb-shadow:        0 4px 24px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.06);
  --dcb-z:             999999;
  --dcb-transition:    .22s cubic-bezier(.4,0,.2,1);
  --dcb-font:          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Reset inside banner only ─────────────────────────────────────────── */
#dcb-banner *,
#dcb-banner *::before,
#dcb-banner *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Hidden state ─────────────────────────────────────────────────────── */
#dcb-banner.dcb-hidden { display: none !important; }

/* ── Base banner ──────────────────────────────────────────────────────── */
#dcb-banner {
  position: fixed;
  z-index: var(--dcb-z);
  font-family: var(--dcb-font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--dcb-text);
  background: var(--dcb-bg);
  box-shadow: var(--dcb-shadow);
  animation: dcb-fade-in var(--dcb-transition) both;
}

@keyframes dcb-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ── Position variants ────────────────────────────────────────────────── */
#dcb-banner.dcb-banner--bottom {
  bottom: 0; left: 0; right: 0;
  border-radius: var(--dcb-radius) var(--dcb-radius) 0 0;
  border-top: 3px solid var(--dcb-accent);
}
#dcb-banner.dcb-banner--top {
  top: 0; left: 0; right: 0;
  border-radius: 0 0 var(--dcb-radius) var(--dcb-radius);
  border-bottom: 3px solid var(--dcb-accent);
}
#dcb-banner.dcb-banner--center {
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  max-width: 520px;
  width: calc(100% - 32px);
  border-radius: var(--dcb-radius);
  border-top: 3px solid var(--dcb-accent);
}

/* ── Layout: box ──────────────────────────────────────────────────────── */
#dcb-banner.dcb-banner--box {
  bottom: 24px; left: 24px;
  max-width: 420px;
  width: calc(100% - 48px);
  border-radius: var(--dcb-radius);
  border-top: 3px solid var(--dcb-accent);
}

/* ── Layout: wall (full overlay) ─────────────────────────────────────── */
#dcb-banner.dcb-banner--wall {
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,23,42,.65);
  backdrop-filter: blur(4px);
  border-radius: 0;
  border: none;
  box-shadow: none;
}
#dcb-banner.dcb-banner--wall .dcb-inner {
  background: var(--dcb-bg);
  border-radius: var(--dcb-radius);
  border-top: 3px solid var(--dcb-accent);
  box-shadow: var(--dcb-shadow);
  max-width: 540px;
  width: calc(100% - 32px);
  padding: 32px;
}

/* ── Inner layout ─────────────────────────────────────────────────────── */
.dcb-inner {
  padding: 20px 24px 20px;
  max-width: 900px;
  margin: 0 auto;
}

/* ── View switching ───────────────────────────────────────────────────── */
.dcb-view { display: block; }
.dcb-view[hidden] { display: none; }

/* ── Typography ───────────────────────────────────────────────────────── */
.dcb-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--dcb-text);
}
.dcb-intro {
  font-size: .9rem;
  color: var(--dcb-text-muted);
  margin-bottom: 16px;
  max-width: 68ch;
}

/* ── Actions ──────────────────────────────────────────────────────────── */
.dcb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.dcb-actions--main { margin-bottom: 10px; }
.dcb-actions--detail { margin-top: 20px; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.dcb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-family: var(--dcb-font);
  font-size: .88rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 6px;
  transition: background var(--dcb-transition), color var(--dcb-transition), box-shadow var(--dcb-transition);
  text-decoration: none;
  white-space: nowrap;
  min-width: 120px;
}
.dcb-btn:focus-visible {
  outline: 2px solid var(--dcb-accent);
  outline-offset: 2px;
}
.dcb-btn--primary {
  background: var(--dcb-accent);
  color: #fff;
}
.dcb-btn--primary:hover {
  background: var(--dcb-accent-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.dcb-btn--secondary {
  background: var(--dcb-surface);
  color: var(--dcb-text);
  border: 1.5px solid var(--dcb-border);
}
.dcb-btn--secondary:hover {
  background: #e8eef6;
}
.dcb-btn--ghost {
  background: transparent;
  color: var(--dcb-text-muted);
  border: 1.5px solid var(--dcb-border);
}
.dcb-btn--ghost:hover {
  color: var(--dcb-text);
  background: var(--dcb-surface);
}

/* ── Close button ─────────────────────────────────────────────────────── */
.dcb-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dcb-text-muted);
  padding: 4px;
  border-radius: 4px;
  transition: color var(--dcb-transition);
}
.dcb-close:hover { color: var(--dcb-text); }
.dcb-close:focus-visible { outline: 2px solid var(--dcb-accent); outline-offset: 2px; }
#dcb-banner { position: fixed; } /* ensure absolute children work */

/* ── Footer links ─────────────────────────────────────────────────────── */
.dcb-footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.dcb-footer-links a {
  font-size: .8rem;
  color: var(--dcb-text-muted);
  text-decoration: none;
  transition: color var(--dcb-transition);
}
.dcb-footer-links a:hover { color: var(--dcb-accent); text-decoration: underline; }

/* ── Back button ──────────────────────────────────────────────────────── */
.dcb-back {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dcb-accent);
  font-size: .88rem;
  font-weight: 600;
  padding: 0 0 16px;
  display: inline-block;
  font-family: var(--dcb-font);
}
.dcb-back:hover { text-decoration: underline; }

/* ── Category list ────────────────────────────────────────────────────── */
.dcb-categories {
  display: grid;
  gap: 10px;
}
.dcb-category {
  background: var(--dcb-surface);
  border: 1.5px solid var(--dcb-border);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color var(--dcb-transition);
}
.dcb-category:has(.dcb-toggle:checked) {
  border-color: var(--dcb-accent);
}
.dcb-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dcb-category-label {
  font-weight: 600;
  font-size: .9rem;
}
.dcb-category-desc {
  font-size: .82rem;
  color: var(--dcb-text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Toggle switch ────────────────────────────────────────────────────── */
.dcb-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.dcb-toggle {
  appearance: none;
  width: 40px;
  height: 22px;
  background: var(--dcb-border);
  border-radius: 11px;
  cursor: pointer;
  position: relative;
  transition: background var(--dcb-transition);
  flex-shrink: 0;
}
.dcb-toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--dcb-transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.dcb-toggle:checked {
  background: var(--dcb-accent);
}
.dcb-toggle:checked::after {
  transform: translateX(18px);
}
.dcb-toggle:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.dcb-toggle:focus-visible {
  outline: 2px solid var(--dcb-accent);
  outline-offset: 2px;
}
.dcb-always-active {
  font-size: .78rem;
  font-weight: 600;
  color: #16a34a;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── Re-open badge ────────────────────────────────────────────────────── */
.dcb-reopen {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: calc(var(--dcb-z) - 1);
  background: var(--dcb-bg);
  border: 1.5px solid var(--dcb-border);
  border-radius: 50%;
  width: 42px; height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  color: var(--dcb-accent);
  transition: box-shadow var(--dcb-transition), transform var(--dcb-transition);
}
.dcb-reopen:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  transform: scale(1.07);
}
.dcb-reopen.dcb-hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .dcb-inner { padding: 16px; }
  .dcb-actions { flex-direction: column; }
  .dcb-btn { width: 100%; }
  #dcb-banner.dcb-banner--box {
    bottom: 0; left: 0;
    max-width: 100%;
    width: 100%;
    border-radius: var(--dcb-radius) var(--dcb-radius) 0 0;
  }
}

/* ── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #dcb-banner { animation: none; }
  .dcb-btn, .dcb-toggle, .dcb-toggle::after, .dcb-reopen { transition: none; }
}
