/* F30 [Marcin, 7.10]: okno zgód (assets/consent.js). Własne kolory w obu motywach, niezależne od reguł stron
   (np. „[data-theme=light] p” strony głównej): selektory z prefiksem html body. Kontrast zmierzony (WCAG 2.2 AA):
   tekst >= 4,5:1, obramowania przycisków, przełączniki, ikona i fokus >= 3:1. Bez zewnętrznych zasobów. */
html body .wpro-consent,
html body .wpro-consent-settings {
  --c-bg: #161b22; --c-text: #f0f2f5; --c-muted: #c9ced6; --c-line: #9199a4; --c-link: #a8ceff;
  --c-btn: #f0f2f5; --c-on-btn: #11151b; --c-btn-hover: #ffffff;
  --c-on: #4c8dff; --c-off: #2a313c; --c-knob-off: #c9ced6;
  --wp-focus: #ffffff;
  box-sizing: border-box;
  position: fixed;
  z-index: 2147483000;
  color: var(--c-text);
  font: 400 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
}
html[data-theme="light"] body .wpro-consent,
html[data-theme="light"] body .wpro-consent-settings {
  --c-bg: #ffffff; --c-text: #15181d; --c-muted: #3d434c; --c-line: #646a75; --c-link: #1d4fb8;
  --c-btn: #15181d; --c-on-btn: #ffffff; --c-btn-hover: #333943;
  --c-on: #1d4fb8; --c-off: #eef1f5; --c-knob-off: #646a75;
  --wp-focus: #0f1115;
}
html body .wpro-consent[hidden],
html body .wpro-consent [hidden],
html body .wpro-consent-settings[hidden] { display: none !important; }
html body .wpro-consent *,
html body .wpro-consent *::before,
html body .wpro-consent *::after { box-sizing: border-box; letter-spacing: normal; text-transform: none; text-shadow: none; }

/* tło i okno na środku */
html body .wpro-consent {
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(5, 8, 12, .62);
  overscroll-behavior: contain;
}
html body .wpro-consent__box {
  width: min(600px, 100%);
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px;
  color: var(--c-text);
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .45);
}
/* strony polityki (regulamin*.html): okno bez tła na dole ekranu - polityki można przeczytać przed decyzją */
html body .wpro-consent--docked { inset: auto 0 0 0; padding: 0 12px 12px; background: none; pointer-events: none; }
html body .wpro-consent--docked .wpro-consent__box { max-height: min(70vh, 640px); pointer-events: auto; margin: 0 auto; }

html body .wpro-consent h2 {
  margin: 0 0 10px; padding: 0; border: 0; background: none;
  color: var(--c-text); font: 700 20px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
html body .wpro-consent h3 { margin: 0; padding: 0; border: 0; background: none; color: var(--c-text); font: 700 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
html body .wpro-consent p { margin: 0 0 12px; padding: 0; color: var(--c-muted); font: inherit; background: none; border: 0; }
html body .wpro-consent strong { color: var(--c-text); font-weight: 700; }
html body .wpro-consent a { color: var(--c-link); text-decoration: underline; text-underline-offset: 2px; background: none; font: inherit; }
html body .wpro-consent a:hover { text-decoration-thickness: 2px; }
html body .wpro-consent__policy { display: inline-block; padding: 2px 0; font-weight: 600; }

/* przyciski: Odrzuć i Akceptuj wyglądają tak samo (ten sam rozmiar, kolor i poziom) */
html body .wpro-consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 0; }
/* druga warstwa: przyciski przyklejone do dołu okna - wybór widoczny bez przewijania listy kategorii */
html body .wpro-consent__actions--3 {
  grid-template-columns: repeat(3, 1fr);
  position: sticky; bottom: -24px; z-index: 1;
  margin: 4px -24px -24px; padding: 14px 24px 24px;
  background: var(--c-bg); border-top: 1px solid var(--c-line);
}
html body .wpro-consent__btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 46px; margin: 0; padding: 10px 14px;
  color: var(--c-on-btn); background: var(--c-btn);
  border: 2px solid var(--c-btn); border-radius: 10px; box-shadow: none;
  font: 700 15px/1.25 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  text-align: center; cursor: pointer;
}
html body .wpro-consent__btn:hover { background: var(--c-btn-hover); border-color: var(--c-btn-hover); }
html body .wpro-consent__btn--more { grid-column: 1 / -1; color: var(--c-text); background: transparent; border-color: var(--c-line); }
html body .wpro-consent__btn--more:hover { background: transparent; border-color: var(--c-text); }
html body .wpro-consent button:focus-visible,
html body .wpro-consent a:focus-visible,
html body .wpro-consent input:focus-visible { outline: 3px solid var(--wp-focus); outline-offset: 2px; }

/* druga warstwa */
html body .wpro-consent__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
html body .wpro-consent__close {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: -10px -10px 0 0; padding: 0;
  color: var(--c-text); background: transparent; border: 0; border-radius: 50%; cursor: pointer;
}
html body .wpro-consent__close:hover { background: var(--c-off); }
html body .wpro-consent__gpc { padding: 10px 12px; border-left: 4px solid var(--c-on); background: var(--c-off); color: var(--c-text); border-radius: 6px; }
html body .wpro-consent__cats { list-style: none; margin: 0; padding: 0; }
html body .wpro-consent__cat { margin: 0 0 10px; padding: 14px 16px 2px; border: 1px solid var(--c-line); border-radius: 10px; list-style: none; background: none; }
html body .wpro-consent__cat::before,
html body .wpro-consent__cat::marker { content: none; }
html body .wpro-consent__cat-head { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
html body .wpro-consent__cat-head h3 { flex: 1 1 auto; }
html body .wpro-consent__cat-head label { cursor: pointer; color: inherit; font: inherit; }
html body .wpro-consent__always { color: var(--c-text); font-size: 13px; font-weight: 600; }
html body .wpro-consent__vendors,
html body .wpro-consent__transfer { font-size: 14px; }

/* przełącznik (checkbox role=switch): tor i gałka >= 3:1 względem tła w obu stanach */
html body .wpro-consent__switch {
  -webkit-appearance: none; appearance: none;
  flex: 0 0 auto; position: relative;
  width: 48px; height: 28px; margin: 0; padding: 0;
  background: var(--c-off); border: 2px solid var(--c-line); border-radius: 14px;
  cursor: pointer; transition: background-color .15s, border-color .15s;
}
html body .wpro-consent__switch::before {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--c-knob-off); transition: transform .15s;
}
html body .wpro-consent__switch:checked { background: var(--c-on); border-color: var(--c-on); }
html body .wpro-consent__switch:checked::before { background: #fff; transform: translateX(20px); }
html body .wpro-consent__switch:disabled { cursor: default; opacity: 1; }

/* ikona ciasteczka po decyzji: lewy dolny róg, nad dolnym paskiem reklamy (#ad-anchor, zmienna z consent.js) */
html body .wpro-consent-settings {
  left: 12px;
  bottom: calc(12px + var(--wpro-consent-lift, 0px) + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: 0; padding: 0;
  color: var(--c-text); background: var(--c-bg);
  border: 1px solid var(--c-line); border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  cursor: pointer;
}
html body .wpro-consent-settings:hover { border-color: var(--c-text); }
html body .wpro-consent-settings svg { display: block; width: 24px; height: 24px; }

@media (max-width: 520px) {
  html body .wpro-consent { padding: 8px; }
  html body .wpro-consent__box { padding: 18px 16px; }
  html body .wpro-consent--docked { padding: 0 8px 8px; }
  html body .wpro-consent__actions { grid-template-columns: 1fr; }
  html body .wpro-consent__actions--3 { grid-template-columns: 1fr 1fr; bottom: -18px; margin: 4px -16px -18px; padding: 12px 16px 16px; }
  html body .wpro-consent__btn--save { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  html body .wpro-consent__switch,
  html body .wpro-consent__switch::before { transition: none; }
}
@media print {
  html body .wpro-consent,
  html body .wpro-consent-settings { display: none !important; }
}
