/* Okno przy wyjściu - park79.pl/halloween.
   Okno powstaje w DOM dopiero przy pierwszym pokazaniu i leży w warstwie <dialog>,
   więc nie przesuwa niczego na stronie (CLS bez zmian). Kolory i krój biorą zmienne strony.
   wartosc-lokalna: wartości po przecinku w var() to zapas kopiowany z :root strony Halloween,
   działa tylko gdy zmienna strony zniknie; źródłem koloru jest :root strony. */

.okno-wyjscia {
  position: fixed; inset: 0; margin: auto;   /* reset strony zeruje margin - bez tego okno ląduje w rogu */
  height: fit-content;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--color-border, rgba(242, 242, 242, 0.14));
  border-top: 6px solid var(--color-accent, #e20436);
  border-radius: 0;
  background: var(--color-bg-alt, #16181d);
  color: var(--color-text, #f2f2f2);
  font-family: var(--font-body, 'Barlow Condensed', system-ui, sans-serif);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.okno-wyjscia::backdrop { background: rgba(8, 9, 11, 0.78); }
.okno-wyjscia[open] { animation: okno-wyjscia-in 0.22s ease-out; }
@keyframes okno-wyjscia-in {
  from { transform: translateY(12px); }   /* bez opacity: w karcie w tle animacja stoi i okno zostawało przezroczyste */
  to { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .okno-wyjscia[open] { animation: none; }
}

.okno-wyjscia__in { position: relative; padding: 32px 28px 24px; }

.okno-wyjscia__x {
  position: absolute; top: 8px; right: 8px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: transparent; border: 0; color: var(--color-text-soft, rgba(242, 242, 242, 0.72));
  font-size: 26px; line-height: 1; cursor: pointer;
}
.okno-wyjscia__x:hover { color: var(--color-text, #f2f2f2); }

.okno-wyjscia__t {
  margin: 0 36px 12px 0;
  font-size: 30px; line-height: 1.05; font-weight: 700; font-style: italic;
  text-transform: uppercase; letter-spacing: 0.01em;
}
.okno-wyjscia__d {
  margin: 0 0 20px;
  font-size: 17px; line-height: 1.45; color: var(--color-text-soft, rgba(242, 242, 242, 0.72));
}

.okno-wyjscia__lab { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.okno-wyjscia__pole {
  display: block; width: 100%; box-sizing: border-box;
  min-height: 48px; padding: 10px 14px;
  border: 1px solid rgba(242, 242, 242, 0.4); border-radius: 0;
  background: var(--color-bg, #0d0f11); color: var(--color-text, #f2f2f2);
  font: inherit; font-size: 18px;
}
.okno-wyjscia__pole:focus-visible { outline: 3px solid var(--color-accent, #e20436); outline-offset: 1px; }
.okno-wyjscia__pole[aria-invalid="true"] { border-color: #ff6b6b; }

/* pułapka na automaty: pole poza ekranem, niewidoczne dla ludzi i czytników */
.okno-wyjscia__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.okno-wyjscia__go {
  display: block; width: 100%; min-height: 52px; margin-top: 14px;
  border: 0; border-radius: 0; cursor: pointer;
  background: var(--color-accent, #e20436); color: #ffffff;
  font: inherit; font-size: 19px; font-weight: 700; font-style: italic; text-transform: uppercase; letter-spacing: 0.02em;
}
.okno-wyjscia__go:hover { filter: brightness(1.15); }
.okno-wyjscia__go:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
.okno-wyjscia__go[disabled] { opacity: 0.6; cursor: progress; }

.okno-wyjscia__zgoda { margin: 10px 0 0; font-size: 13px; line-height: 1.4; color: var(--color-text-soft, rgba(242, 242, 242, 0.72)); }
.okno-wyjscia__link { color: var(--color-text, #f2f2f2); text-decoration: underline; text-underline-offset: 2px; }
.okno-wyjscia__link:hover { color: #ffffff; }
.okno-wyjscia__link:focus-visible { outline: 3px solid var(--color-accent, #e20436); outline-offset: 2px; }
/* tekst tylko dla czytnika ekranu */
.okno-wyjscia__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.okno-wyjscia__blad { margin: 10px 0 0; font-size: 15px; line-height: 1.4; color: #ff8a8a; }
.okno-wyjscia__blad:empty { display: none; }
.okno-wyjscia__blad a { color: inherit; }
.okno-wyjscia__ok { margin: 4px 0 0; font-size: 20px; line-height: 1.4; font-weight: 700; }

.okno-wyjscia__nie {
  display: inline-block; margin-top: 16px; padding: 10px 0; min-height: 44px;
  background: none; border: 0; cursor: pointer;
  color: var(--color-text-soft, rgba(242, 242, 242, 0.72)); font: inherit; font-size: 15px;
  text-decoration: underline; text-underline-offset: 3px;
}
.okno-wyjscia__nie:hover { color: var(--color-text, #f2f2f2); }
.okno-wyjscia__podpis { margin: 12px 0 0; font-size: 14px; color: var(--color-text-soft, rgba(242, 242, 242, 0.72)); text-align: right; }

/* ---------- Telefon: arkusz od dołu w miejscu paska „Kup bilety" ----------
   Jedno wezwanie naraz: przy otwartym arkuszu pasek znika. !important wygrywa z przełączaniem
   paska przez skrypt strony (data-widoczny), więc pasek nie wróci, dopóki arkusz jest otwarty. */
html.okno-wyjscia-arkusz-otwarty .sticky-cta {
  transform: translateY(102%) !important;
  visibility: hidden !important;
  transition: none !important;
}

.okno-wyjscia--arkusz {
  inset: auto 0 var(--okno-wyjscia-klawiatura, 0px) 0;   /* nad klawiaturą ekranową, gdy jest */
  margin: 0 auto;
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 16px - var(--okno-wyjscia-klawiatura, 0px));
  max-height: calc(100dvh - 16px - var(--okno-wyjscia-klawiatura, 0px));
  border-left: 0; border-right: 0; border-bottom: 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
  overscroll-behavior: contain;
}
.okno-wyjscia--arkusz::backdrop { background: rgba(8, 9, 11, 0.55); }
/* dół arkusza nad strefą gestów iPhone'a */
.okno-wyjscia--arkusz .okno-wyjscia__in { padding: 22px 18px calc(12px + env(safe-area-inset-bottom)); }
.okno-wyjscia--arkusz .okno-wyjscia__x { top: 4px; right: 4px; }
.okno-wyjscia--arkusz .okno-wyjscia__t { margin: 0 44px 6px 0; font-size: 26px; }
.okno-wyjscia--arkusz .okno-wyjscia__d { margin-bottom: 14px; font-size: 16px; }
.okno-wyjscia--arkusz .okno-wyjscia__go { margin-top: 10px; }
.okno-wyjscia--arkusz .okno-wyjscia__nie { margin-top: 6px; }
.okno-wyjscia--arkusz .okno-wyjscia__podpis { margin-top: 0; }
