/*!
 * MD Consent — Styles
 * Eigenständig, kollisionsarm (Präfix .mdc), respektiert prefers-reduced-motion.
 */

.mdc {
  --mdc-primary: #1b2530;
  --mdc-accent: #2f81f7;
  --mdc-fg: #1b2530;
  --mdc-muted: #5b6776;
  --mdc-surface: #ffffff;
  --mdc-line: #e4e8ee;
  --mdc-radius: 16px;
  --mdc-shadow: 0 12px 40px rgba(16, 24, 40, .18), 0 2px 8px rgba(16, 24, 40, .08);
  --mdc-z: 2147483000;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--mdc-fg);
  line-height: 1.55;
}

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

/* ---------- Banner ---------- */
.mdc-banner {
  position: fixed;
  z-index: var(--mdc-z);
  left: 24px; right: 24px; bottom: 24px;
  max-width: 460px;
  background: var(--mdc-surface);
  border: 1px solid var(--mdc-line);
  border-radius: var(--mdc-radius);
  box-shadow: var(--mdc-shadow);
  padding: 24px;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
}
.mdc-banner.is-open { opacity: 1; transform: none; pointer-events: auto; }

.mdc[data-layout="bar"] .mdc-banner {
  max-width: none; left: 0; right: 0; bottom: 0;
  border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.mdc[data-layout="bar"] .mdc-banner__body { flex: 1 1 320px; }

.mdc-banner__title { margin: 0 0 8px; font-size: 1.0625rem; font-weight: 700; }
.mdc-banner__text { margin: 0; font-size: .875rem; color: var(--mdc-muted); }
.mdc-banner__text a { color: var(--mdc-accent); text-decoration: none; }
.mdc-banner__text a:hover { text-decoration: underline; }

.mdc-banner__actions {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px;
}
.mdc[data-layout="bar"] .mdc-banner__actions { margin-top: 0; }

/* ---------- Buttons (Accept/Reject gleich prominent — DSGVO) ---------- */
.mdc-btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .875rem;
  padding: 11px 18px; border-radius: 10px; flex: 1 1 auto;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.mdc-btn:active { transform: translateY(1px); }
.mdc-btn:focus-visible { outline: 2px solid var(--mdc-accent); outline-offset: 2px; }
.mdc-btn--primary { background: var(--mdc-primary); color: #fff; }
.mdc-btn--primary:hover { background: #0f1822; }
.mdc-btn--ghost { background: transparent; color: var(--mdc-fg); border-color: var(--mdc-line); }
.mdc-btn--ghost:hover { background: #f3f5f8; border-color: #d4dae2; }

/* ---------- Modal / Einstellungen ---------- */
.mdc-overlay {
  position: fixed; inset: 0; z-index: calc(var(--mdc-z) - 1);
  background: rgba(11, 16, 22, .55); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .22s ease;
}
.mdc-overlay.is-open { opacity: 1; }

.mdc-modal {
  position: fixed; z-index: var(--mdc-z);
  left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.98);
  width: min(560px, calc(100vw - 32px));
  max-height: min(86vh, 760px);
  display: flex; flex-direction: column;
  background: var(--mdc-surface);
  border-radius: var(--mdc-radius);
  box-shadow: var(--mdc-shadow);
  opacity: 0; transition: opacity .22s ease, transform .22s ease;
}
.mdc-modal.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.mdc-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px; border-bottom: 1px solid var(--mdc-line);
}
.mdc-modal__head h2 { margin: 0; font-size: 1.125rem; font-weight: 700; }
.mdc-modal__close {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-size: 1.75rem; line-height: 1; color: var(--mdc-muted); padding: 0 4px;
}
.mdc-modal__close:hover { color: var(--mdc-fg); }

.mdc-modal__body { padding: 20px 24px; overflow-y: auto; }
.mdc-modal__intro { margin: 0 0 18px; font-size: .875rem; color: var(--mdc-muted); }

.mdc-modal__foot {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 18px 24px; border-top: 1px solid var(--mdc-line);
}
.mdc-modal__links { margin: 14px 0 0; font-size: .8125rem; }
.mdc-modal__links a { color: var(--mdc-accent); text-decoration: none; }

/* ---------- Kategorie-Reihen ---------- */
.mdc-cat { padding: 16px 0; border-top: 1px solid var(--mdc-line); }
.mdc-cat:first-of-type { border-top: 0; padding-top: 0; }
.mdc-cat__head { display: flex; align-items: center; gap: 12px; }
.mdc-cat__title { font-weight: 600; font-size: .9375rem; }
.mdc-cat__badge {
  font-size: .6875rem; font-weight: 600; color: var(--mdc-muted);
  background: #eef1f5; padding: 2px 8px; border-radius: 999px; margin-left: 4px;
}
.mdc-cat__desc { margin: 8px 0 0 56px; font-size: .8125rem; color: var(--mdc-muted); }

/* ---------- Toggle-Switch ---------- */
.mdc-switch { position: relative; display: inline-flex; flex: 0 0 auto; }
.mdc-switch input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.mdc-switch__track {
  width: 44px; height: 26px; border-radius: 999px; background: #c8d0da;
  position: relative; transition: background .18s ease;
}
.mdc-switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s ease;
}
.mdc-switch input:checked + .mdc-switch__track { background: var(--mdc-accent); }
.mdc-switch input:checked + .mdc-switch__track::after { transform: translateX(18px); }
.mdc-switch input:disabled + .mdc-switch__track { background: #9aa7b5; opacity: .8; cursor: not-allowed; }
.mdc-switch input:focus-visible + .mdc-switch__track { outline: 2px solid var(--mdc-accent); outline-offset: 2px; }

/* ---------- Embed-Platzhalter (für geblockte iframes) ---------- */
.mdc-embed-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; min-height: 200px; padding: 28px;
  background: #f3f5f8; border: 1px dashed var(--mdc-line); border-radius: 12px;
  color: var(--mdc-muted);
}
.mdc-embed-placeholder strong { color: var(--mdc-fg); }

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
  .mdc-banner { left: 12px; right: 12px; bottom: 12px; padding: 20px; }
  .mdc-banner__actions { flex-direction: column; }
  .mdc-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .mdc-banner, .mdc-modal, .mdc-overlay, .mdc-switch__track,
  .mdc-switch__track::after, .mdc-btn { transition: none !important; }
}

@media (prefers-color-scheme: dark) {
  .mdc {
    --mdc-fg: #e9edf2; --mdc-muted: #9aa7b5; --mdc-surface: #161d26;
    --mdc-line: #2a333f;
  }
  .mdc-btn--ghost:hover { background: #1f2832; border-color: #3a4554; }
  .mdc-cat__badge { background: #232c37; }
  .mdc-embed-placeholder { background: #1b2530; }
}
