/* =====================================================================
   Einwilligungsbanner (DSGVO / TTDSG)
   ===================================================================== */

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

/* ------------------------------------------------------------------ *
   Erste Ebene: Banner am unteren Rand
 * ------------------------------------------------------------------ */
.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  display: block;
  padding: 24px;
  background: var(--palette-1);
  color: #ffffff;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
  animation: consent-in 0.35s var(--ease) both;
}

@keyframes consent-in {
  from { transform: translateY(100%); }
  to   { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .consent { animation: none; }
}

.consent__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  max-width: var(--content-width);
  margin-inline: auto;
}

.consent__text {
  flex: 1 1 420px;
  font-size: 16px;
  line-height: 1.55;
}
.consent__text h2 {
  margin-bottom: 6px;
  font-family: var(--font-heading);
  font-size: 30px;
  line-height: 1.2;
  color: #ffffff;
}
.consent__text p { margin: 0; }
.consent__text a { color: var(--palette-10); text-decoration: underline; }

.consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 0 1 auto;
}

/* Zustimmen und Ablehnen sind bewusst gleich gross und gleich auffaellig.
   Das verlangt die DSGVO: keine Schaltflaeche darf bevorzugt wirken. */
.consent__btn {
  min-width: 190px;
  padding: 14px 26px;
  border: 2px solid var(--palette-10);
  background: var(--palette-10);
  color: var(--palette-1);
  font-family: var(--font-button);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.consent__btn:hover { background: var(--btn-sec-bg-hover); border-color: var(--btn-sec-bg-hover); }

.consent__btn--deny {
  background: transparent;
  color: var(--palette-10);
}
.consent__btn--deny:hover { background: var(--palette-10); color: var(--palette-1); }

.consent__btn--link {
  min-width: 0;
  border-color: transparent;
  background: transparent;
  color: #ffffff;
  text-decoration: underline;
  padding-inline: 8px;
}
.consent__btn--link:hover { background: transparent; color: var(--palette-10); border-color: transparent; }

@media all and (max-width: 767px) {
  .consent { padding: 16px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .consent__inner { gap: 14px; }
  .consent__text h2 { font-size: 22px; margin-bottom: 4px; }
  .consent__text { font-size: 14px; line-height: 1.5; flex-basis: 100%; }
  /* Ein Satz weniger auf dem Handy: der Hinweis steht auch in den
     Einstellungen und in der Datenschutzerklaerung. */
  .consent__more { display: none; }
  .consent__actions { width: 100%; gap: 10px; }
  .consent__btn { flex: 1 1 100%; min-width: 0; padding: 13px 20px; font-size: 16px; }
  .consent__btn--link { padding-block: 6px; }
}

/* ------------------------------------------------------------------ *
   Zweite Ebene: Einstellungen
 * ------------------------------------------------------------------ */
.consent-settings {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.6);
}

.consent-settings__box {
  width: 100%;
  max-width: 640px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 32px;
  background: #ffffff;
  color: #000000;
  border-radius: 4px;
}

.consent-settings__box h2 {
  margin-bottom: 12px;
  font-family: var(--font-heading);
  font-size: 40px;
  line-height: 1.1;
}
.consent-settings__intro { margin-bottom: 24px; font-size: 16px; }

.consent-group {
  padding: 18px 0;
  border-top: 1px solid #d7ded8;
}
.consent-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.consent-group__title { font-size: 18px; font-weight: 700; }
.consent-group p { margin: 8px 0 0; font-size: 15px; line-height: 1.55; }
.consent-group__meta { color: #575757; font-size: 14px; }

/* Schalter */
.switch { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 24px; margin: 0; cursor: pointer; }
.switch__track {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #b8c2ba;
  position: relative;
  transition: background-color 0.2s var(--ease);
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s var(--ease);
}
.switch input:checked + .switch__track { background: var(--palette-2); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:disabled + .switch__track { background: var(--palette-2); opacity: 0.5; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--palette-10); outline-offset: 2px; }
.switch__label { font-size: 15px; }

.consent-settings__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.consent-settings__actions .consent__btn { border-color: var(--palette-1); }
.consent-settings__actions .consent__btn--save {
  background: var(--palette-1);
  color: #ffffff;
}
.consent-settings__actions .consent__btn--save:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); }
.consent-settings__actions .consent__btn--deny { color: var(--palette-1); }
.consent-settings__actions .consent__btn--deny:hover { background: var(--palette-1); color: #ffffff; }

.consent-settings__links {
  margin-top: 20px;
  font-size: 15px;
}
.consent-settings__links a { color: var(--palette-2); }

@media all and (max-width: 767px) {
  .consent-settings { padding: 12px; }
  .consent-settings__box { padding: 22px 18px; }
  .consent-settings__box h2 { font-size: 30px; }
  .consent-settings__actions .consent__btn { flex: 1 1 100%; }
}

/* ------------------------------------------------------------------ *
   Dauerhaft erreichbares Symbol zum Widerruf
 * ------------------------------------------------------------------ */
.consent-fab {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--palette-1);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.consent-fab:hover { background: var(--palette-2); }
/* Keks statt Warnzeichen: goldener Teig, dunkle Stueckchen */
.consent-fab svg { width: 26px; height: 26px; fill: #e8c877; }
.consent-fab:hover { transform: scale(1.06) rotate(-8deg); }

@media (prefers-reduced-motion: reduce) {
  .consent-fab { transition: none; }
  .consent-fab:hover { transform: none; }
}

@media all and (max-width: 767px) {
  .consent-fab { left: 12px; bottom: 12px; width: 42px; height: 42px; }
  .consent-fab svg { width: 24px; height: 24px; }
}

/* ------------------------------------------------------------------ *
   Platzhalter fuer blockierte externe Inhalte
 * ------------------------------------------------------------------ */
.consent-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 240px;
  padding: 28px;
  background: var(--palette-8);
  border: 1px dashed var(--palette-6);
  text-align: center;
}
.consent-placeholder p { margin: 0; font-size: 16px; max-width: 42ch; }

/* Aktionen im Platzhalter stehen oben, damit die Entscheidung sofort
   sichtbar ist und nicht erst nach dem Erklaertext kommt. */
.consent-placeholder__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 4px;
}
.consent-placeholder__actions .btn { padding: 12px 26px; font-size: 16px; }

@media all and (max-width: 767px) {
  .consent-placeholder__actions { width: 100%; }
  .consent-placeholder__actions .btn { flex: 1 1 100%; }
}
