/*
 * Cookie-Hinweis: ein Stylesheet für alle Hüllen (V8 und Branchenseiten direkt, Magazin und Unterseiten über
 * public-pages.css). Markup: landing/v8/partials/cookie-banner.blade.php, Verhalten: landing/js/cookie-banner.js.
 * Das Skript arbeitet mit den Tailwind-Klassennamen der V2-Seite (hidden, translate-y-full, opacity-0, rotate-180);
 * sie sind hier nachgebaut.
 *
 * Alle Regeln hängen an .consent: Die Startseite lädt mobile.css nach dieser Datei, und die Unterseiten bringen
 * Tailwind mit. So sieht der Hinweis überall gleich aus: eine ruhige dunkle Karte (--ink-2, die erhöhte Fläche auf Tinte,
 * damit sie sich auch über dunklen Kapiteln abhebt) mit zwei gleich großen Entscheidungen.
 */

div.consent {
  --c-ink: var(--ink, #19291e);
  --c-surface: var(--ink-2, #263e2d);    /* erhöhte Fläche auf Tinte: hebt die Karte auch über dunklen Kapiteln ab */
  --c-mint: var(--mint, #b9f49d);
  --c-mint-hover: #c9f9ba;
  --c-white: #f7f9f8;
  --c-text: #d1ddc7;                     /* Lesetext auf der Karte: 8,2:1 */
  --c-line: rgba(255, 255, 255, 0.14);
  --c-line-strong: rgba(255, 255, 255, 0.45); /* Rand der Umriss-Knöpfe: 3,7:1 */
  --c-body: var(--font-body, "Inter", system-ui, sans-serif);
  --c-ease: var(--ease, cubic-bezier(0.32, 0.72, 0, 1));

  position: fixed;
  inset: auto 0 0 0;
  z-index: 110;
  padding: 16px;
  /* Nur die Karte nimmt Klicks an; der Rand daneben bleibt für die Seite bedienbar. */
  pointer-events: none;
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease;
}

div.consent.hidden {
  display: none;
}

div.consent.translate-y-full {
  transform: translateY(24px);
}

div.consent.opacity-0 {
  opacity: 0;
}

div.consent.translate-y-0 {
  transform: none;
}

div.consent.opacity-100 {
  opacity: 1;
}

.consent *,
.consent *::before,
.consent *::after {
  box-sizing: border-box;
}

.consent .consent-card {
  width: min(960px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 auto;
  border: 1px solid var(--c-line);
  border-radius: 16px;
  padding: 24px 28px;
  background: var(--c-surface);
  color: var(--c-text);
  font-family: var(--c-body);
  text-align: left;
  box-shadow: 0 18px 40px rgba(27, 42, 33, 0.08);
  pointer-events: auto;
}

.consent :is(button, a, input):focus-visible {
  outline: 2px solid var(--c-mint);
  outline-offset: 3px;
}

.consent .consent-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "kicker actions"
    "copy actions"
    "links actions";
  align-items: center;
  column-gap: 40px;
}

.consent .consent-kicker { grid-area: kicker; }
.consent .consent-copy { grid-area: copy; }
.consent .consent-actions { grid-area: actions; }
.consent .consent-links { grid-area: links; }

.consent .consent-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--c-mint);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.consent .consent-kicker::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  background: currentColor;
}

.consent .consent-copy {
  max-width: 76ch;
  margin: 10px 0 0;
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.6;
  text-wrap: pretty;
}

.consent .consent-mobile {
  display: none;
}

.consent .consent-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 28px;
  margin-top: 6px;
}

.consent .consent-toggle,
.consent .consent-privacy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
  border: 0;
  padding: 0;
  background: none;
  color: var(--c-white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}

.consent .consent-privacy {
  text-decoration: underline;
  text-decoration-color: var(--c-line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 200ms ease;
}

.consent .consent-privacy:hover {
  text-decoration-color: var(--c-white);
}

.consent .consent-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--c-mint);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms var(--c-ease);
}

.consent .consent-toggle svg.rotate-180 {
  transform: rotate(180deg);
}

.consent .consent-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
}

.consent .consent-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  border: 1px solid var(--c-line-strong);
  border-radius: 5px;
  padding: 0 22px;
  background: transparent;
  color: var(--c-white);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease, transform 200ms var(--c-ease);
}

.consent .consent-button:hover {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.consent .consent-button:active {
  transform: translateY(0) scale(0.99);
}

.consent .consent-button--primary {
  border-color: var(--c-mint);
  background: var(--c-mint);
  color: var(--c-ink);
}

.consent .consent-button--primary:hover {
  border-color: var(--c-mint-hover);
  background: var(--c-mint-hover);
}

/* ---------- Details ---------- */

.consent .consent-details {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  border-top: 1px solid var(--c-line);
  padding-top: 20px;
}

.consent .consent-details.hidden {
  display: none;
}

.consent .consent-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin: 0;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
}

.consent .consent-row--toggle {
  cursor: pointer;
  transition: border-color 200ms ease;
}

.consent .consent-row--toggle:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.consent .consent-row-text {
  display: block;
  min-width: 0;
}

.consent .consent-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--c-white);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.consent .consent-row-title em {
  border: 1px solid var(--c-line-strong);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--c-text);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.consent .consent-row-desc {
  display: block;
  margin: 4px 0 0;
  color: var(--c-text);
  font-size: 13px;
  line-height: 1.55;
}

.consent .consent-switch {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  margin-top: 0;
}

.consent .consent-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.consent .consent-switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  pointer-events: none;
  transition: background-color 200ms ease;
}

.consent .consent-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-white);
  transition: transform 220ms var(--c-ease), background-color 200ms ease;
}

.consent .consent-switch input:checked + i,
.consent .consent-switch.is-fixed i {
  background: var(--c-mint);
}

.consent .consent-switch input:checked + i::after,
.consent .consent-switch.is-fixed i::after {
  background: var(--c-ink);
  transform: translateX(20px);
}

.consent .consent-switch input:focus-visible + i {
  outline: 2px solid var(--c-mint);
  outline-offset: 3px;
}

.consent .consent-details-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ---------- Schmale Fenster: Text, dann beide Entscheidungen nebeneinander, dann Details und Datenschutz ---------- */

@media (max-width: 760px) {
  div.consent {
    padding: 12px;
  }

  .consent .consent-card {
    border-radius: 16px;
    padding: 20px;
  }

  .consent .consent-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "kicker"
      "copy"
      "actions"
      "links";
  }

  .consent .consent-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    margin-top: 16px;
  }

  .consent .consent-button {
    padding: 0 12px;
    font-size: 14px;
    white-space: normal;
  }

  .consent .consent-links {
    justify-content: space-between;
    margin-top: 4px;
  }

  .consent .consent-row {
    gap: 12px;
    padding: 12px;
  }

  .consent .consent-details-actions .consent-button {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .consent .consent-desktop {
    display: none;
  }

  .consent .consent-mobile {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  div.consent,
  .consent .consent-button,
  .consent .consent-privacy,
  .consent .consent-row--toggle,
  .consent .consent-toggle svg,
  .consent .consent-switch i,
  .consent .consent-switch i::after {
    transition: none;
  }

  div.consent.translate-y-full {
    transform: none;
  }
}
