/*
 * Consent-Leiste der Lernplattform.
 * Farben aus dem Corporate Design, als Variablen gesetzt und nirgends direkt
 * als Hex verwendet. Wo Astra eine passende Farbe fuehrt, wird sie als
 * Rueckfallwert genutzt, damit Aenderungen am Theme durchschlagen.
 */

.ap-consent {
  --ap-c-dunkelblau: var(--mx-primaer);
  --ap-c-rosa: var(--mx-akzent);
  --ap-c-rosa-dunkel: var(--mx-akzent-dunkel);
  --ap-c-text-hell: var(--mx-warm);
  --ap-c-text-dunkel: var(--mx-text);

  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  background: var(--ap-c-dunkelblau);
  color: var(--ap-c-text-hell);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
  font-size: 15px;
  line-height: 1.5;
}

.ap-consent[hidden] { display: none; }

.ap-consent__innen {
  max-width: 919px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.ap-consent__text {
  margin: 0;
  flex: 1 1 auto;
  color: var(--ap-c-text-hell);
}

.ap-consent__link {
  color: var(--ap-c-rosa);
  text-decoration: underline;
  white-space: nowrap;
}

.ap-consent__link:hover,
.ap-consent__link:focus { color: var(--ap-c-text-hell); }

.ap-consent__knoepfe {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
}

/*
 * Alle drei Knoepfe tragen dieselbe Groesse. Zustimmen und Ablehnen sind
 * zusaetzlich in Farbe und Gewicht gleich; das verlangt Paragraf 25 TDDDG.
 * Nur "Einstellungen" ist als Umriss abgesetzt, weil es keine Entscheidung
 * ist, sondern zur zweiten Ebene fuehrt.
 */
.ap-consent__knopf {
  min-width: 148px;
  padding: 11px 18px;
  border-radius: 6px;
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ap-consent__knopf--ja,
.ap-consent__knopf--nein {
  background: var(--ap-c-rosa);
  color: var(--ap-c-text-dunkel);
}

.ap-consent__knopf--ja:hover,
.ap-consent__knopf--nein:hover { background: var(--ap-c-rosa-dunkel); }

.ap-consent__knopf--mehr {
  background: transparent;
  color: var(--ap-c-text-hell);
  border-color: var(--ap-c-text-hell);
}

.ap-consent__knopf--mehr:hover {
  background: var(--ap-c-text-hell);
  color: var(--ap-c-text-dunkel);
}

.ap-consent__knopf:focus-visible {
  outline: 3px solid var(--ap-c-rosa);
  outline-offset: 2px;
}

/* Tablet und Telefon: Text ueber die Knoepfe, Knoepfe gleich breit. */
@media (max-width: 782px) {
  .ap-consent__innen {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
  }
  .ap-consent__knoepfe { flex-wrap: wrap; }
  .ap-consent__knopf { flex: 1 1 140px; min-width: 0; }
}

/* ---------- Zweite Ebene: Auswahl je Kategorie ---------- */

.ap-consent__ebene2 {
  border-top: 1px solid rgba(255, 249, 242, 0.25);
  background: rgba(0, 0, 0, 0.15);
}

.ap-consent__ebene2[hidden] { display: none; }

.ap-consent__innen--ebene2 {
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.ap-consent__liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.ap-consent__eintrag { margin: 0; }

.ap-consent__schalter {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "box titel" "box text";
  column-gap: 12px;
  align-items: start;
  cursor: pointer;
}

.ap-consent__schalter input {
  grid-area: box;
  width: 20px;
  height: 20px;
  margin: 2px 0 0 0;
  accent-color: var(--ap-c-rosa);
  cursor: pointer;
}

.ap-consent__schalter input:disabled { cursor: default; opacity: 0.7; }

.ap-consent__eintrag-titel {
  grid-area: titel;
  font-weight: 600;
}

.ap-consent__eintrag-text {
  grid-area: text;
  font-size: 14px;
  color: rgba(255, 249, 242, 0.8);
}

/* ---------- Widerrufs-Link in der Fusszeile ---------- */

.ap-consent-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.ap-consent-link:hover,
.ap-consent-link:focus { text-decoration: none; }
