/* ==========================================================================
   NJY Technology — okno zgody na liczenie odwiedzin („Jasne szkło”, 1b)
   Kolory z księgi znaku 1.0 („Linia pióra”): Papier, Noc, Las, Zieleń NJY.
   Jasna szklana karta na środku nad rozmytą stroną, na telefonie przy dolnej
   krawędzi. Znacznik składa assets/njy.js (showCookieBar). Plik jest osobno,
   bo okno pokazuje się na dwóch arkuszach: landingu (njy-landing.css) i
   stronach prawnych (njy.css). Z nich bierze tylko kroje i kolory tekstu,
   resztę ustawiają zmienne --z-* poniżej.
   Zasłona i karta animują się osobno. Kontener nie może mieć ani opacity,
   ani transform: odciąłby karcie tło, które rozmywa backdrop-filter.
   ========================================================================== */

.zgoda {
  --z-veil:      rgba(245, 246, 243, 0.6);
  --z-glass:     rgba(255, 255, 255, 0.74);
  --z-glass-line: rgba(255, 255, 255, 0.92);
  --z-sh:        0 28px 64px rgba(11, 14, 16, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --z-ink:       #0B0E10;   /* Noc */
  --z-muted:     #5B6661;   /* Szum */
  --z-accent:    #0B6B45;   /* Las — zieleń w tekście */
  --z-tint:      rgba(34, 181, 115, 0.16);
  --z-neutral:   rgba(0, 0, 0, 0.06);
  --z-hover:     rgba(0, 0, 0, 0.05);
  --z-hair:      rgba(11, 14, 16, 0.10);
  --z-r-card:    28px;
  --z-r-btn:     999px;
  --z-cta:       #22B573;   /* Zieleń NJY, tekst w Nocy (7,3:1) */
  --z-cta-sh:    0 10px 26px rgba(34, 181, 115, 0.28);
  --z-cta-sh-h:  0 14px 32px rgba(34, 181, 115, 0.38);
  --z-ease:      cubic-bezier(0.16, 1, 0.3, 1);

  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: var(--font-body, var(--font));
  font-size: 16px;
  line-height: 1.6;
  color: var(--z-ink);
  -webkit-font-smoothing: antialiased;
}
.zgoda.is-closing { pointer-events: none; }

.zgoda__veil {
  position: absolute;
  inset: 0;
  background: var(--z-veil);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  animation: zgoda-veil-in .38s ease both;
}

.zgoda__card {
  position: relative;
  width: min(100%, 600px);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(22px, 5vw, 30px) clamp(20px, 5vw, 32px) clamp(16px, 4vw, 22px);
  border-radius: var(--z-r-card);
  background: var(--z-glass);
  backdrop-filter: blur(24px) saturate(155%);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
  border: 1px solid var(--z-glass-line);
  box-shadow: var(--z-sh);
  animation: zgoda-in .52s var(--z-ease) both;
}
/* Fokus trafia na kartę tylko po to, żeby czytnik ekranu przeczytał tytuł. */
.zgoda__card:focus { outline: none; }

.zgoda.is-closing .zgoda__veil { animation: zgoda-veil-out .28s ease both; }
.zgoda.is-closing .zgoda__card { animation: zgoda-out .28s var(--z-ease) both; }

.zgoda svg { display: block; flex: none; }

.zgoda__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.zgoda__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--z-accent);
}
.zgoda__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  background: var(--z-tint);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--z-accent);
}

.zgoda__title {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(23px, 5.5vw, 27px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--z-ink);
  text-wrap: balance;
}
.zgoda__text {
  margin: 12px 0 0;
  max-width: 52ch;
  font-size: clamp(15px, 4vw, 16.5px);
  line-height: 1.6;
  color: var(--z-muted);
  text-wrap: pretty;
}

/* ------------------------------------------------------------------ przyciski */
.zgoda__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 22px;
}
.zgoda__cta,
.zgoda__quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--z-r-btn);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}
.zgoda__cta {
  flex: 1 1 220px;
  min-height: 52px;
  padding: 14px 28px;
  background: var(--z-cta);
  color: var(--z-ink);
  font-size: 16px;
  letter-spacing: -0.005em;
  box-shadow: var(--z-cta-sh);
  transition: box-shadow .22s var(--z-ease);
}
.zgoda__cta:hover { box-shadow: var(--z-cta-sh-h); }
.zgoda__quiet {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 10px 16px;
  background: none;
  color: var(--z-muted);
  font-size: 15px;
  transition: background .18s ease, color .18s ease;
}
.zgoda__quiet:hover { background: var(--z-hover); color: var(--z-ink); }
/* Globalny :focus-visible obu arkuszy zmienia też border-radius — tu zostaje pigułka. */
.zgoda__cta:focus-visible,
.zgoda__quiet:focus-visible {
  outline: 3px solid var(--z-accent);
  outline-offset: 3px;
  border-radius: var(--z-r-btn);
}
.zgoda__quiet:focus-visible { outline-offset: 2px; }
.zgoda__hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--z-muted);
}

/* ---------------------------------------------------- szczegóły i polityka */
.zgoda__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 16px;
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--z-hair);
}
.zgoda__more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  margin-left: -4px;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--z-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.zgoda__more:hover { color: var(--z-accent); }
.zgoda__more svg { color: var(--z-accent); transition: transform .24s var(--z-ease); }
.zgoda__more[aria-expanded="true"] svg { transform: rotate(180deg); }
.zgoda__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--z-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--z-hair);
}
.zgoda__link:hover { color: var(--z-accent); }

.zgoda__details { margin-top: 4px; animation: zgoda-panel .24s var(--z-ease) both; }
.zgoda__rows { margin: 0; padding: 0; list-style: none; }
.zgoda__rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 9px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--z-ink);
}
.zgoda__rows li + li { border-top: 1px solid var(--z-hair); }
.zgoda__pill {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--z-tint);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--z-accent);
  white-space: nowrap;
}
.zgoda__status--off,
.zgoda__pill--off { background: var(--z-neutral); color: var(--z-muted); }
.zgoda__fine {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--z-hair);
  font-size: 13px;
  line-height: 1.5;
  color: var(--z-muted);
}

/* ---------------------------------------------------------------- animacje */
@keyframes zgoda-in       { from { opacity: 0; transform: translateY(28px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes zgoda-out      { from { opacity: 1; transform: none; filter: none; } to { opacity: 0; transform: translateY(14px); filter: blur(4px); } }
@keyframes zgoda-veil-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes zgoda-veil-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes zgoda-panel    { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------- RWD */
/* Telefon: karta przy dolnej krawędzi, pod kciukiem. */
@media (max-width: 640px) {
  .zgoda {
    --z-r-card: 26px;
    align-items: flex-end;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }
}

/* ------------------------------------------------------- a11y i druk */
@media (prefers-reduced-motion: reduce) {
  .zgoda__veil, .zgoda__card, .zgoda__details,
  .zgoda.is-closing .zgoda__veil, .zgoda.is-closing .zgoda__card { animation: none; }
  .zgoda__more svg, .zgoda__cta, .zgoda__quiet { transition: none; }
}

@media print {
  .zgoda { display: none !important; }
}
