/* ═══════════════════════════════════════════════════════════
   CHANGA Cookie-Banner
   Identische Datei auf dev2 (website/css) und kurse (entwicklung/css).
   Änderungen immer in beiden Kopien gleich machen.
   Werte stehen fest drin (nicht über Variablen der Seite), damit der
   Banner auf beiden Seiten exakt gleich aussieht.
   ═══════════════════════════════════════════════════════════ */

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

.ch-consent {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: rgba(13,14,16,.48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: 'Outfit', system-ui, sans-serif;
  color: #F5F6F7;
}

/* ── Panel (beide Ansichten) ───────────────────────────── */
.ch-consent-panel {
  width: min(100%, 760px);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  display: grid;
  gap: 1.15rem;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  background: rgba(13,14,16,.98);
  box-shadow: 0 28px 90px rgba(0,0,0,.42);
}
.ch-consent-panel:focus { outline: none; }

.ch-consent-copy { display: grid; gap: .45rem; }

.ch-consent-kicker {
  margin: 0;
  color: #F5874A;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ch-consent-title {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  font-weight: 700;
  line-height: 1.05;
  color: #F5F6F7;
}

.ch-consent-text {
  margin: 0;
  color: rgba(248,249,250,.84);
  font-size: .96rem;
  line-height: 1.6;
}

.ch-consent a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ch-consent a:hover { color: #E8621A; }

/* ── Buttons ───────────────────────────────────────────── */
.ch-consent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .65rem;
}

.ch-consent-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  border-radius: 999px;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: .9rem;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background .25s, border-color .25s, box-shadow .3s cubic-bezier(.2,.9,.2,1), transform .3s cubic-bezier(.2,.9,.2,1);
}
.ch-consent-btn span { position: relative; z-index: 1; }
.ch-consent-btn:focus-visible { outline: 2px solid #E8621A; outline-offset: 3px; }

.ch-consent-btn--primary {
  overflow: hidden;
  padding: 16px 32px;
  border: 1px solid rgba(232,98,26,.3);
  background: linear-gradient(135deg, #F5874A 0%, #E8621A 58%, #E8621A 100%);
  box-shadow: 0 0 10px 3px rgba(232,98,26,.25);
  color: #F5F6F7;
  font-weight: 500;
}
.ch-consent-btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, #F2C06E, #F5874A);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.ch-consent-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 18px 6px rgba(232,98,26,.3), 0 0 36px 12px rgba(232,98,26,.12);
}
.ch-consent-btn--primary:hover::before { transform: scaleX(1); transform-origin: left; }

.ch-consent-btn--ghost {
  padding: 15px 32px;
  border: 1.5px solid rgba(255,255,255,.38);
  background: rgba(255,255,255,.08);
  color: #F5F6F7;
  font-weight: 400;
}
.ch-consent-btn--ghost:hover {
  background: rgba(232,98,26,.14);
  border-color: rgba(232,98,26,.62);
  transform: translateY(-2px);
}

.ch-consent-btn--outline {
  padding: 14px 28px;
  border: 2px solid rgba(255,255,255,.32);
  background: rgba(255,255,255,.04);
  color: #F5F6F7;
  font-weight: 700;
  letter-spacing: .01em;
}
.ch-consent-btn--outline:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.58);
  transform: translateY(-2px);
}

/* ── Ansicht "Bearbeiten" ──────────────────────────────── */
.ch-consent-panel--edit {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.ch-consent-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.1rem, 3vw, 1.6rem) clamp(1.1rem, 3vw, 1.6rem) 1rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.ch-consent-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #F5F6F7;
  cursor: pointer;
  transition: background .25s, border-color .25s;
}
.ch-consent-close:hover { background: rgba(232,98,26,.14); border-color: rgba(232,98,26,.62); }
.ch-consent-close:focus-visible { outline: 2px solid #E8621A; outline-offset: 3px; }
.ch-consent-close svg { width: 1rem; height: 1rem; }

.ch-consent-edit-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 1.75rem;
  padding: 1.4rem clamp(1.1rem, 3vw, 1.6rem) 1.6rem;
}

.ch-consent-edit-foot {
  flex: 0 0 auto;
  padding: 1rem clamp(1.1rem, 3vw, 1.6rem);
  border-top: 1px solid rgba(255,255,255,.12);
  background: rgba(13,14,16,.98);
}

/* Kategorie: Schalter + Name, Satz darunter, Anbieter aufklappbar */
.ch-consent-cat { display: grid; gap: .7rem; }

.ch-consent-switch {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  width: max-content;
  cursor: pointer;
}
.ch-consent-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}
.ch-consent-switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 2.9rem;
  height: 1.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.22);
  transition: background .25s, border-color .25s;
}
.ch-consent-switch-track::after {
  content: '';
  position: absolute;
  top: 50%;
  left: .2rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #F5F6F7;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  transform: translateY(-50%);
  transition: transform .25s cubic-bezier(.2,.9,.2,1);
}
.ch-consent-switch input:checked + .ch-consent-switch-track {
  background: linear-gradient(135deg, #F5874A 0%, #E8621A 100%);
  border-color: rgba(232,98,26,.6);
}
.ch-consent-switch input:checked + .ch-consent-switch-track::after { transform: translate(1.25rem, -50%); }
.ch-consent-switch input:focus-visible + .ch-consent-switch-track { outline: 2px solid #E8621A; outline-offset: 3px; }
.ch-consent-switch input:disabled + .ch-consent-switch-track { opacity: .5; }
.ch-consent-switch.is-locked { cursor: default; }
.ch-consent-switch.is-locked .ch-consent-cat-name { color: rgba(248,249,250,.6); }

.ch-consent-cat-name {
  font-size: 1.02rem;
  font-weight: 600;
  color: #F5F6F7;
}

.ch-consent-cat-text {
  margin: 0;
  max-width: 62ch;
  color: rgba(248,249,250,.72);
  font-size: .9rem;
  line-height: 1.55;
}

.ch-consent-vendors { display: grid; gap: .5rem; }

.ch-consent-vendor {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
}
.ch-consent-vendor summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 1.1rem;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  list-style: none;
}
.ch-consent-vendor summary::-webkit-details-marker { display: none; }
.ch-consent-vendor summary::after {
  content: '';
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 8px solid rgba(248,249,250,.6);
  transition: transform .25s cubic-bezier(.2,.9,.2,1);
}
.ch-consent-vendor[open] summary::after { transform: rotate(-90deg); }
.ch-consent-vendor summary:focus-visible { outline: 2px solid #E8621A; outline-offset: 2px; border-radius: 12px; }

.ch-consent-vendor dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .45rem 1.2rem;
  margin: 0;
  padding: 0 1.1rem 1.05rem;
  font-size: .86rem;
  line-height: 1.5;
}
.ch-consent-vendor dt { color: rgba(248,249,250,.55); }
.ch-consent-vendor dd { margin: 0; color: rgba(248,249,250,.86); }
.ch-consent-vendor code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  color: #F5F6F7;
}

/* ── Handy ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ch-consent { align-items: stretch; padding: .75rem; }
  .ch-consent-panel { align-self: flex-end; border-radius: 18px; }
  .ch-consent-actions { display: grid; grid-template-columns: 1fr; }
  .ch-consent-btn { width: 100%; }
  .ch-consent-panel--edit { height: calc(100dvh - 1.5rem); max-height: none; }
  .ch-consent-vendor dl { grid-template-columns: 1fr; gap: .1rem; }
  .ch-consent-vendor dd + dt { margin-top: .5rem; }
}
