/* IBER Consent – Banner (C) 2026 IBER Datentechnik – GNU GPL v2 or later */

.iberconsent {
  --ibc-primary: #2f6ea8;
  --ibc-bg: #ffffff;
  --ibc-text: #2b2b2b;
  --ibc-radius: 8px;
  --ibc-muted: color-mix(in srgb, var(--ibc-text) 60%, var(--ibc-bg));
  --ibc-line: color-mix(in srgb, var(--ibc-text) 14%, var(--ibc-bg));
  --ibc-on: #3b8a3b;
  --ibc-off: #d9534f;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font: 400 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ibc-text);
  pointer-events: none;
  box-sizing: border-box;
}

.iberconsent[hidden] { display: none !important; }
.iberconsent *, .iberconsent *::before, .iberconsent *::after { box-sizing: border-box; }
.iberconsent--overlay { background: rgba(0, 0, 0, .45); pointer-events: auto; }

.iberconsent--bottom { align-items: flex-end; padding: 0; }
.iberconsent--bottom-left { align-items: flex-end; justify-content: flex-start; }
.iberconsent--bottom-right { align-items: flex-end; justify-content: flex-end; }
.iberconsent--bottom:not(.iberconsent--overlay),
.iberconsent--bottom-left:not(.iberconsent--overlay),
.iberconsent--bottom-right:not(.iberconsent--overlay) { inset: auto 0 0 0; }

.iberconsent-dialog {
  pointer-events: auto;
  background: var(--ibc-bg);
  color: var(--ibc-text);
  border-radius: var(--ibc-radius);
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px 28px 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}

.iberconsent--bottom .iberconsent-dialog { max-width: none; border-radius: var(--ibc-radius) var(--ibc-radius) 0 0; }
.iberconsent--bottom-left .iberconsent-dialog,
.iberconsent--bottom-right .iberconsent-dialog { max-width: 440px; }

.iberconsent-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.iberconsent-title { margin: 0 0 10px; font-size: 1.2em; line-height: 1.35; font-weight: 700; color: inherit; outline: none; }
.iberconsent-logo { max-height: 44px; max-width: 180px; width: auto; flex: none; }

.iberconsent-body { display: flow-root; }
.iberconsent-illustration { float: right; width: 110px; height: auto; margin: 0 0 8px 16px; }
.iberconsent-text { text-align: justify; hyphens: auto; }
.iberconsent-text p { margin: 0 0 .6em; }
.iberconsent-link, .iberconsent-text a { color: var(--ibc-primary); }

.iberconsent-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; margin: 16px 0 4px; }
.iberconsent-cat { display: flex; align-items: center; gap: 9px; min-height: 32px; }
.iberconsent-icon { width: 18px; height: 18px; flex: none; }
.iberconsent-cat__label { font-size: 1em; }

/* Schalter: aus = rotes X, an = grüner Haken, notwendig = grau */
.iberconsent-switch {
  position: relative; flex: none; width: 42px; height: 22px; padding: 0; margin: 0;
  border-radius: 11px; border: 1px solid #e5bcbc; background: #f6e4e4; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.iberconsent-switch__knob {
  position: absolute; top: 2px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--ibc-off); transition: left .15s, border-color .15s;
}
.iberconsent-switch__knob::after {
  content: "×"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font: 700 12px/1 system-ui, sans-serif; color: var(--ibc-off);
}
.iberconsent-switch[aria-checked="true"] { background: #dcebdc; border-color: #9fc89f; }
.iberconsent-switch[aria-checked="true"] .iberconsent-switch__knob { left: 21px; border-color: var(--ibc-on); }
.iberconsent-switch[aria-checked="true"] .iberconsent-switch__knob::after { content: "✓"; color: var(--ibc-on); font-size: 11px; }
.iberconsent-switch[disabled] { background: #ececec; border-color: #cfcfcf; cursor: not-allowed; }
.iberconsent-switch[disabled] .iberconsent-switch__knob { border-color: #8a8a8a; }
.iberconsent-switch[disabled] .iberconsent-switch__knob::after { color: #8a8a8a; }
.iberconsent-switch:focus-visible { outline: 2px solid var(--ibc-primary); outline-offset: 2px; }

.iberconsent-buttons { display: flex; gap: 16px; justify-content: center; margin: 20px 0 6px; flex-wrap: wrap; }
.iberconsent-btn {
  flex: 1 1 200px; max-width: 230px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 18px; border: 0; border-radius: 4px; background: var(--ibc-primary); color: #fff;
  font: inherit; font-size: 1em; font-weight: 500; cursor: pointer; transition: filter .15s;
}
.iberconsent-btn svg { width: 16px; height: 16px; flex: none; }
.iberconsent-btn:hover { filter: brightness(.9); }
.iberconsent-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--ibc-primary) 45%, transparent); outline-offset: 2px; }
.iberconsent-btn--ghost { background: transparent; color: var(--ibc-primary); border: 1px solid var(--ibc-primary); }

.iberconsent-save { text-align: center; margin: 2px 0 8px; color: var(--ibc-muted); }
.iberconsent-textbtn { background: none; border: 0; padding: 2px 4px; font: inherit; font-size: .9em; color: var(--ibc-primary); cursor: pointer; text-decoration: underline; }

.iberconsent-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: .82em; color: var(--ibc-muted); }
.iberconsent-footlink { color: var(--ibc-text); text-decoration: none; }
.iberconsent-footlink:hover, .iberconsent-footlink:focus-visible { color: var(--ibc-primary); text-decoration: underline; }

.iberconsent-brand { margin-top: 10px; text-align: right; font-size: .72em; }
.iberconsent-brand a { color: var(--ibc-muted); text-decoration: none; }

.iberconsent-details { margin: 6px 0 0; }
.iberconsent-group { border: 1px solid var(--ibc-line); border-radius: 6px; margin: 0 0 10px; padding: 10px 12px; }
.iberconsent-group__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.iberconsent-group__title { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.iberconsent-group__desc { margin: 6px 0 0; font-size: .9em; color: var(--ibc-muted); }
.iberconsent-required { margin-left: auto; font-size: .82em; color: var(--ibc-muted); }
.iberconsent-group__services { margin-top: 6px; }
.iberconsent-group__services > summary { cursor: pointer; font-size: .88em; color: var(--ibc-primary); width: max-content; }
.iberconsent-group__services > summary:focus-visible { outline: 2px solid var(--ibc-primary); outline-offset: 2px; }
.iberconsent-muted { padding: 6px 0 0; margin: 0; font-size: .88em; color: var(--ibc-muted); }

.iberconsent-service { border-top: 1px solid var(--ibc-line); padding: 10px 0 4px; margin-top: 8px; font-size: .9em; }
.iberconsent-service__head { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.iberconsent-service__info { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 8px 0 0; }
.iberconsent-service__info dt { color: var(--ibc-muted); }
.iberconsent-service__info dd { margin: 0; overflow-wrap: anywhere; }
.iberconsent-service__info a { color: var(--ibc-primary); }
.iberconsent-cookies { width: 100%; margin: 8px 0 0; border-collapse: collapse; font-size: .92em; }
.iberconsent-cookies th, .iberconsent-cookies td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--ibc-line); overflow-wrap: anywhere; }
.iberconsent-cookies th { font-weight: 600; color: var(--ibc-muted); }

/* Platzhalter für blockierte Inhalte */
.iberconsent-placeholder {
  --ibc-primary: #2f6ea8;
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 200px;
  padding: 20px; margin: 0 0 1em; border-radius: 8px; background: #f2f4f7; color: #2b2b2b;
  border: 1px dashed #b9c2cf; text-align: center; box-sizing: border-box;
  font: 400 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.iberconsent-placeholder__inner { max-width: 460px; }
.iberconsent-placeholder__text { margin: 0 0 8px; }
.iberconsent-placeholder__link { margin: 0 0 12px; font-size: .9em; }
.iberconsent-placeholder__link a { color: var(--ibc-primary); }
.iberconsent-placeholder__buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.iberconsent-placeholder .iberconsent-btn { flex: 0 1 auto; font-size: 14px; padding: 8px 14px; }

/* Widerrufs-Icon */
.iberconsent-fab {
  --ibc-primary: #2f6ea8;
  position: fixed; bottom: 16px; z-index: 2147482000; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: var(--ibc-primary); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 12px rgba(0, 0, 0, .25);
}
.iberconsent-fab[hidden] { display: none; }
.iberconsent-fab svg { width: 24px; height: 24px; }
.iberconsent-fab--left { left: 16px; }
.iberconsent-fab--right { right: 16px; }
.iberconsent-fab:focus-visible { outline: 3px solid #fff; box-shadow: 0 0 0 5px var(--ibc-primary); }

html.iberconsent-open.iberconsent-lock { overflow: hidden; }

@media (max-width: 560px) {
  .iberconsent { padding: 0; align-items: flex-end; }
  .iberconsent-dialog { max-width: none !important; border-radius: var(--ibc-radius) var(--ibc-radius) 0 0; padding: 18px 16px 12px; max-height: 92vh; max-height: 92dvh; }
  .iberconsent-illustration { width: 72px; }
  .iberconsent-cats { grid-template-columns: 1fr; }
  .iberconsent-text { text-align: left; }
  .iberconsent-btn { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .iberconsent-switch, .iberconsent-switch__knob { transition: none; }
}

@media print {
  .iberconsent, .iberconsent-fab { display: none !important; }
}
