/* ============================================================
   4Tex GmbH — consent.css
   Cookie consent banner + settings dialog.
   Uses the binding corporate design tokens from style.css;
   fully supported in light and dark mode via semantic vars.
   ============================================================ */

/* ---- Banner (first visit) -------------------------------- */
.consent-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200;
  background: var(--bg);
  color: var(--text);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 30px rgba(7, 26, 47, .18);
  padding: 1.25rem 0;
}
.consent-banner__inner {
  display: flex; flex-wrap: wrap; gap: 1.25rem;
  align-items: center; justify-content: space-between;
}
.consent-banner__text { flex: 1 1 34rem; min-width: 16rem; }
.consent-banner__title {
  font-size: 1.05rem; font-weight: 700; color: var(--text-strong);
  margin: 0 0 .35rem;
}
.consent-banner__desc { font-size: .92rem; margin: 0; line-height: 1.55; }
.consent-banner__desc a { color: var(--navy-600); text-decoration: underline; }
.consent-banner__actions {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
}

/* ---- Buttons --------------------------------------------- */
.consent-btn {
  font: inherit; font-size: .92rem; font-weight: 600;
  padding: .65rem 1.2rem; border-radius: var(--radius);
  cursor: pointer; border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s;
  min-height: 44px;
}
.consent-btn:focus-visible { outline: 2px solid var(--navy-600); outline-offset: 2px; }
.consent-btn--primary { background: var(--navy-800); color: #fff; }
.consent-btn--primary:hover { background: var(--navy-700); }
.consent-btn--secondary {
  background: transparent; color: var(--text-strong);
  border-color: var(--border-strong, var(--border));
}
.consent-btn--secondary:hover { border-color: var(--navy-600); color: var(--navy-600); }
.consent-btn--link {
  background: none; border: none; color: var(--navy-600);
  text-decoration: underline; padding: .65rem .4rem;
}
:root[data-theme="dark"] .consent-btn--primary { background: #1B76BE; }
:root[data-theme="dark"] .consent-btn--primary:hover { background: #2E8AD2; }

/* ---- Settings dialog ------------------------------------- */
.consent-modal {
  position: fixed; inset: 0; z-index: 1300;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: rgba(7, 26, 47, .55);
}
.consent-modal__dialog {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px;
  max-height: min(86vh, 46rem);
  display: flex; flex-direction: column;
}
.consent-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.consent-modal__title { font-size: 1.15rem; color: var(--text-strong); margin: 0; }
.consent-modal__close {
  background: none; border: none; cursor: pointer; color: var(--text);
  width: 40px; height: 40px; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
}
.consent-modal__close:hover { color: var(--navy-600); }
.consent-modal__close:focus-visible { outline: 2px solid var(--navy-600); outline-offset: 2px; }
.consent-modal__body { padding: 1.25rem 1.5rem; overflow-y: auto; font-size: .93rem; line-height: 1.6; }
.consent-modal__body h3 { font-size: 1rem; color: var(--text-strong); margin: 1.4rem 0 .4rem; }
.consent-modal__body h3:first-child { margin-top: 0; }
.consent-modal__foot {
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
}

/* ---- Category rows --------------------------------------- */
.consent-cat {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--border);
}
.consent-cat:last-of-type { border-bottom: none; }
.consent-cat__label { font-weight: 700; color: var(--text-strong); display: block; margin-bottom: .2rem; }
.consent-cat__desc { margin: 0; font-size: .88rem; }
.consent-cat__required {
  display: inline-block; font-size: .75rem; font-weight: 600;
  color: var(--text-muted); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: .1rem .6rem; margin-left: .4rem;
  vertical-align: middle;
}

/* Switch */
.consent-switch { position: relative; flex-shrink: 0; width: 46px; height: 26px; margin-top: .15rem; }
.consent-switch input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; margin: 0; cursor: pointer;
}
.consent-switch__track {
  position: absolute; inset: 0; border-radius: var(--radius-pill);
  background: var(--grey-200); transition: background .2s; pointer-events: none;
}
:root[data-theme="dark"] .consent-switch__track { background: var(--steel-500); }
.consent-switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.consent-switch input:checked + .consent-switch__track { background: var(--navy-600); }
:root[data-theme="dark"] .consent-switch input:checked + .consent-switch__track { background: #1B76BE; }
.consent-switch input:checked + .consent-switch__track::after { transform: translateX(20px); }
.consent-switch input:disabled + .consent-switch__track { opacity: .55; }
.consent-switch input:focus-visible + .consent-switch__track { outline: 2px solid var(--navy-600); outline-offset: 2px; }

/* ---- Consent ID ------------------------------------------ */
.consent-id-box {
  margin-top: .5rem; padding: .6rem .8rem;
  border: 1px dashed var(--border-strong, var(--border));
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .85rem; word-break: break-all; color: var(--text-strong);
  background: var(--bg-alt);
}

/* ---- Blocked external media placeholder ------------------ */
.consent-placeholder {
  aspect-ratio: 16/9; border-radius: 8px; max-width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .9rem; text-align: center; padding: 1.5rem;
  background: var(--bg-alt); border: 1px solid var(--border);
  color: var(--text);
}
.consent-placeholder p { margin: 0; font-size: .92rem; max-width: 42ch; }

/* ---- Responsive ------------------------------------------ */
@media (max-width: 640px) {
  .consent-banner { padding: 1rem 0; max-height: 85vh; overflow-y: auto; }
  .consent-banner__actions { width: 100%; }
  .consent-btn { flex: 1 1 auto; }
  .consent-modal { padding: .5rem; align-items: flex-end; }
  .consent-modal__dialog { max-height: 92vh; }
}

@media (prefers-reduced-motion: reduce) {
  .consent-btn, .consent-switch__track, .consent-switch__track::after { transition: none; }
}
