/*
  Tarifchaos – Consent-Banner, Einstellungen und Sperrhinweis im Rechner
  ---------------------------------------------------------------
  DS-03-D-06, Prüfhalt 2 (25. Oktober 2026). Markup aus renderConsentManager()
  und renderConsentSperre() in scripts/build.mjs. Keine neuen Farben oder
  Assets: Tokens aus tokens.css (Brand-Dunkel und -Gold wie der dunkle
  Aktivierungskasten der Vergleichsseiten, Ink auf Gold wie .v2-button).
  „Alle akzeptieren“ und „Nicht notwendige ablehnen“ sind absichtlich
  identisch gestaltet (gleiche Klasse, Größe und Ebene; TC-ENT-20261025-005).
*/

.tc-consent {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--color-brand-dark);
  color: var(--color-surface);
  border-top: 3px solid var(--color-brand-gold);
  box-shadow: 0 -8px 24px rgba(30, 25, 15, 0.18);
  font-size: .95rem;
  line-height: 1.6;
}
.tc-consent[hidden] { display: none; }

.tc-consent__inner {
  box-sizing: border-box;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 20px 24px 22px;
}

.tc-consent__titel {
  margin: 0 0 8px;
  color: var(--color-brand-gold);
  font-size: 1.15rem;
  line-height: 1.3;
}
.tc-consent__titel:focus { outline: none; }
.tc-consent__titel:focus-visible {
  outline: 2px solid var(--color-brand-gold);
  outline-offset: 4px;
}

.tc-consent p { margin: 0 0 10px; max-width: 95ch; }
.tc-consent p[hidden] { display: none; }

.tc-consent__grund { font-weight: 700; }

.tc-consent a {
  color: var(--color-surface);
  text-decoration: underline;
  text-decoration-color: var(--color-brand-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.tc-consent__reload { font-size: .85rem; opacity: .9; }
.tc-consent__meldung { font-weight: 700; }
.tc-consent__meldung:empty { display: none; }

/* Einstellungen (Accordion) */
.tc-consent__einstellungen { margin: 6px 0 14px; }
.tc-consent__einstellungen[hidden] { display: none; }
.tc-consent__kategorien {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.tc-consent__kategorie {
  border-top: 1px solid color-mix(in srgb, var(--color-surface) 25%, transparent);
  padding: 4px 0;
}
.tc-consent__kategorie:last-child {
  border-bottom: 1px solid color-mix(in srgb, var(--color-surface) 25%, transparent);
}
.tc-consent__kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  min-height: 44px;
}
.tc-consent__check {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--color-brand-gold);
  cursor: pointer;
}
.tc-consent__check:disabled { cursor: not-allowed; }
.tc-consent__check:focus-visible {
  outline: 2px solid var(--color-brand-gold);
  outline-offset: 3px;
}
.tc-consent__name {
  flex: 1 1 12rem;
  font-weight: 700;
  cursor: pointer;
}
.tc-consent__fest {
  font-size: .8rem;
  color: var(--color-brand-gold);
  font-weight: 700;
}
.tc-consent__details {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--color-surface);
  font: 700 .85rem/1.2 var(--font-base);
  text-decoration: underline;
  text-decoration-color: var(--color-brand-gold);
  text-underline-offset: 4px;
  cursor: pointer;
}
.tc-consent__details::after { content: " ▾"; }
.tc-consent__details[aria-expanded="true"]::after { content: " ▴"; }
.tc-consent__kattext { font-size: .875rem; padding: 0 0 6px 34px; }

/* Schaltflächen */
.tc-consent__aktionen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.tc-consent__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 17rem;
  padding: 12px 22px;
  border: 2px solid var(--color-brand-gold);
  border-radius: 10px;
  background: var(--color-brand-gold);
  color: var(--color-brand-dark);
  font: 700 .95rem/1.3 var(--font-base);
  text-align: center;
  cursor: pointer;
}
.tc-consent__button[hidden] { display: none; }
.tc-consent__button--zweit {
  width: auto;
  background: transparent;
  color: var(--color-surface);
}
.tc-consent__button:disabled { cursor: progress; opacity: .7; }
.tc-consent__schliessen {
  min-height: 44px;
  margin-left: auto;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--color-surface);
  font: 700 .9rem/1.2 var(--font-base);
  text-decoration: underline;
  text-decoration-color: var(--color-brand-gold);
  text-underline-offset: 4px;
  cursor: pointer;
}
.tc-consent__schliessen[hidden] { display: none; }
.tc-consent a:focus-visible,
.tc-consent__details:focus-visible,
.tc-consent__schliessen:focus-visible,
.tc-consent__button:focus-visible {
  outline: 3px solid var(--color-brand-gold);
  outline-offset: 3px;
}
.tc-consent__button:not(.tc-consent__button--zweit):focus-visible { outline-color: var(--color-surface); }

/* Mobil: kompakter, damit der Banner möglichst wenig Inhalt verdeckt. */
@media (max-width: 767px) {
  .tc-consent { font-size: .85rem; line-height: 1.5; }
  .tc-consent__inner { padding: 14px 16px 16px; }
  .tc-consent__titel { font-size: 1.05rem; margin-bottom: 6px; }
  .tc-consent p { margin-bottom: 8px; }
  .tc-consent__reload { font-size: .8rem; }
  .tc-consent__aktionen { flex-direction: column; align-items: stretch; gap: 8px; }
  .tc-consent__button { width: 100%; min-height: 44px; padding: 10px 16px; font-size: .9rem; }
  .tc-consent__schliessen { margin-left: 0; align-self: center; }
  .tc-consent__kattext { padding-left: 0; }
}

/* Sperrhinweis im Rechnerbereich (dunkler Aktivierungskasten) */
.v2-consent-sperre {
  margin: 20px 0 4px;
  padding: 16px 18px 12px;
  border-left: 2px solid var(--color-brand-gold);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--color-surface) 7%, transparent);
  color: var(--color-surface);
  font-size: .9rem;
  line-height: 1.6;
}
.v2-consent-sperre[hidden] { display: none; }
.v2-consent-sperre__text { margin: 0 0 8px; max-width: 62ch; }
.v2-consent-sperre__text:focus { outline: none; }
.v2-consent-sperre__aktion {
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--color-brand-gold);
  font: 700 .9rem/1.2 var(--font-base);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.v2-consent-sperre__aktion[hidden] { display: none; }
.v2-consent-sperre__aktion:focus-visible {
  outline: 2px solid var(--color-brand-gold);
  outline-offset: 2px;
}
