/* ==========================================================================
   Konta: logowanie (magic link), Konto, zachęty (arkusz pod playerem, nudge)
   ========================================================================== */

/* --- Wejście „Zaloguj się / Konto” w górnej nawigacji --- */
.nav__account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px 0 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.nav__account .icon { width: 18px; height: 18px; }
.nav__account:active { transform: scale(0.97); }
.nav__account.is-active { color: var(--accent-hi); }
.nav__account--login { background: rgba(245, 165, 36, .12); box-shadow: inset 0 0 0 1px rgba(245, 165, 36, .35); color: var(--accent-hi); }
.nav__avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .8125rem;
  font-weight: 700;
}
@media (hover: hover) and (pointer: fine) {
  .nav__account:hover { background: rgba(255, 255, 255, .08); }
  .nav__account--login:hover { background: rgba(245, 165, 36, .2); }
}
@media (max-width: 767px) {
  .nav__account { display: none; } /* na telefonie: zakładka w dolnym pasku */
  .tabbar { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .nav__account-label { display: none; }
  .nav__account { padding: 0 6px; }
}

/* --- Strona logowania --- */
.auth {
  display: grid;
  gap: clamp(20px, 4vw, 48px);
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 72px) var(--gutter) 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 900px) {
  .auth:not(.auth--single) { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
}
.auth--single { max-width: 560px; }
.auth__card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: clamp(22px, 4vw, 36px);
  border-radius: var(--radius-lg);
  background: linear-gradient(to bottom, rgba(28, 32, 51, .7), rgba(21, 24, 38, .7));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  isolation: isolate;
}
.auth__card::before { /* snop projektora — motyw marki */
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40% -20% auto auto;
  width: 120%;
  height: 160%;
  pointer-events: none;
  background: conic-gradient(from 200deg at 100% 0%, transparent 0deg, rgba(255, 207, 112, .07) 14deg, transparent 34deg);
}
.auth__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(245, 165, 36, .12);
  color: var(--accent-hi);
  box-shadow: inset 0 0 0 1px rgba(245, 165, 36, .3);
}
.auth__icon .icon { width: 24px; height: 24px; }
.auth__icon--sent { background: rgba(95, 211, 154, .12); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(95, 211, 154, .3); }
.auth__icon--warn { background: rgba(255, 107, 91, .1); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(255, 107, 91, .3); }
.auth__title { font-size: var(--fs-2xl); letter-spacing: -0.03em; }
.auth__email { color: var(--accent-hi); overflow-wrap: anywhere; }
.auth__lead { color: var(--text-muted); font-size: var(--fs-lg); max-width: 46ch; }
.auth__form { gap: 18px; margin-top: 6px; }
.auth__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.auth__actions--stack { display: grid; }
.auth__tips { display: grid; gap: 8px; padding-left: 1.1em; color: var(--text-muted); font-size: var(--fs-sm); }
.auth__tips li::marker { color: var(--accent); }
.auth__perks { display: grid; gap: 16px; padding-top: 8px; }
.input--lg { padding: 14px 16px; font-size: var(--fs-lg); }
.dev-callout { border-style: dashed; border-color: rgba(245, 165, 36, .45); display: grid; gap: 6px; }
.dev-callout a { color: var(--accent-hi); text-decoration: underline; font-weight: 600; }

.perks { display: grid; gap: 18px; }
.perks li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.perks strong { display: block; font-size: var(--fs-md); color: var(--text); }
.perks p { color: var(--text-muted); font-size: var(--fs-sm); }
.perks__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent);
}
.perks__icon .icon { width: 20px; height: 20px; }

/* --- Zgody (checkboxy — osobne, niezaznaczone) --- */
.consents { display: grid; gap: 10px; }
.check {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: #d9d6d0;
  cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.check a { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 2px; }
.check--sub { margin-left: 30px; }
.check__req, .check__opt { color: var(--text-dim); font-size: var(--fs-xs); white-space: nowrap; }
.consents--compact .check { font-size: var(--fs-xs); color: var(--text-muted); }

/* --- Piątkowy seans: aktywny wybór dwoma przyciskami (bez checkboxa) --- */
.nl-choice { display: grid; gap: 12px; }
.nl-choice__perk {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(245, 165, 36, .28);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 165, 36, .12), rgba(245, 165, 36, .03));
}
.nl-choice__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
}
.nl-choice__icon .icon { width: 18px; height: 18px; }
.nl-choice__name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); color: var(--text); }
.nl-choice__pitch { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.45; }
.nl-choice__buttons { display: grid; gap: 8px; }
.nl-choice__legal { font-size: var(--fs-xs); line-height: 1.45; color: var(--text-dim); }
.nl-choice--compact .nl-choice__buttons { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.nl-choice--compact .btn { padding-inline: 12px; }
.signup-dock.is-sent .nl-choice { display: none !important; }

/* --- Konto --- */
.account { display: grid; gap: 16px; max-width: 760px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) var(--gutter) 0; }
.account__head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.account__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 750;
  box-shadow: 0 10px 30px -10px var(--accent-glow);
}
.account__who { min-width: 0; flex: 1; }
.account__title { font-size: var(--fs-2xl); letter-spacing: -0.03em; }
.account__email { color: var(--text-muted); overflow-wrap: anywhere; }
.account__logout { flex: none; }
.account__card {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 26px);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.account__card > .btn { justify-self: start; }
.account__card--danger { border-color: rgba(255, 107, 91, .25); }
.account__h { display: flex; align-items: center; gap: 10px; font-size: var(--fs-lg); letter-spacing: -0.01em; }
.account__h .icon { width: 20px; height: 20px; color: var(--accent); }
.account__card--danger .account__h .icon { color: var(--danger); }
.account__intro { font-size: var(--fs-sm); }
.account__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.account__stats div { padding: 12px 14px; border-radius: var(--radius); background: var(--surface); }
.account__stats dt { font-size: var(--fs-xs); color: var(--text-muted); }
.account__stats dd { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 700; }
.account__consents { display: grid; gap: 4px; }
.account__consents > .btn { justify-self: start; margin-top: 10px; }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.switch-row__text { display: grid; gap: 4px; font-size: var(--fs-sm); color: var(--text-muted); }
.switch-row__text strong { color: var(--text); font-size: var(--fs-md); }
.switch-row__meta { font-size: var(--fs-xs); color: var(--ok); }
.switch-row .switch { flex: none; }
.account__delete { display: grid; gap: 8px; }
.account__delete-row { display: flex; flex-wrap: wrap; gap: 10px; }
.account__delete-row .input { flex: 1 1 240px; }
.btn--danger { background: rgba(255, 107, 91, .14); color: #ffb4aa; border: 1px solid rgba(255, 107, 91, .45); }
@media (hover: hover) and (pointer: fine) {
  .btn--danger:hover { background: rgba(255, 107, 91, .24); }
}
@media (max-width: 520px) {
  .account__stats { grid-template-columns: 1fr 1fr; }
  .account__head { flex-wrap: wrap; }
}

/* --- Arkusz „Zapisz postęp” (pod playerem — w przepływie strony, nigdy na playerze) --- */
.signup-dock {
  width: 100%;
  max-width: 920px;
  margin-top: clamp(10px, 1.6vw, 18px);
  overflow: clip; /* arkusz wjeżdża od dołu własnej szuflady */
  border-radius: var(--radius-lg);
}
.signup-sheet {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 16px 52px 16px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(to bottom, rgba(28, 32, 51, .96), rgba(21, 24, 38, .96));
  border: 1px solid var(--line-strong);
  border-top-color: rgba(245, 165, 36, .45);
  opacity: 0;
  transform: translateY(100%);
  transition: transform 160ms var(--ease-out), opacity 160ms var(--ease-out); /* wyjście: szybciej */
}
.signup-dock.is-open .signup-sheet {
  opacity: 1;
  transform: none;
  transition: transform 260ms var(--ease-drawer), opacity 200ms var(--ease-out); /* wejście */
}
.signup-sheet__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.signup-sheet__close .icon { width: 18px; height: 18px; }
.signup-sheet__close:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) {
  .signup-sheet__close:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
}
.signup-sheet__intro { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.signup-sheet__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(245, 165, 36, .12);
  color: var(--accent-hi);
}
.signup-sheet__icon .icon { width: 20px; height: 20px; }
.signup-sheet__title { font-size: var(--fs-lg); letter-spacing: -0.01em; }
.signup-sheet__text { font-size: var(--fs-sm); color: var(--text-muted); }
.signup-sheet__form { display: grid; gap: 10px; }
.signup-sheet__row { display: flex; gap: 8px; }
.signup-sheet__row .input { flex: 1; min-width: 0; padding: 10px 14px; }
/* Zgody pokazujemy, gdy ktoś zaczyna wpisywać e-mail — arkusz zostaje niski, dopóki nie chcesz. */
.signup-sheet .consents { display: none; }
.signup-dock.is-expanded .signup-sheet .consents { display: grid; }
.no-js .signup-sheet .consents, .legacy-js .signup-sheet .consents { display: grid; }
.signup-sheet__status:empty { display: none; }
.signup-sheet__status { font-size: var(--fs-sm); color: var(--accent-hi); }
.signup-dock.is-sent .signup-sheet__row, .signup-dock.is-sent .consents { display: none !important; }
.signup-dock.is-sent .signup-sheet__status { color: var(--ok); font-weight: 600; }
@media (min-width: 900px) {
  .signup-sheet { grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); align-items: center; column-gap: 20px; }
  .signup-sheet__form .consents, .signup-sheet__status { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .signup-dock.is-expanded .signup-sheet { align-items: start; }
}

/* --- Toast-zachęta (po dodaniu do listy) --- */
.toast--nudge {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  padding: 10px 8px 10px 16px;
}
.toast__action { flex: none; color: var(--accent-hi); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.toast__close { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--text-muted); }
@media (hover: hover) and (pointer: fine) {
  .toast__close:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
}

/* --- Ograniczony ruch: bez wjazdu od dołu, zostaje przenikanie --- */
@media (prefers-reduced-motion: reduce) {
  .signup-sheet, .signup-dock.is-open .signup-sheet { transform: none; }
  .nav__account:active, .signup-sheet__close:active { transform: none; }
}
.page-head__link { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }

/* Arkusz otwarty: player kinowy oddaje mu miejsce (mniejszy o wysokość arkusza), więc całość mieści się
   na ekranie, a nic nie leży na playerze. Jednorazowa zmiana rozmiaru — krótka, ease-out. */
.theatre.has-dock .player--theatre {
  width: min(100%, calc((100dvh - 190px - var(--dock-h, 0px)) * 16 / 9));
  min-width: min(100%, 320px);
  transition: width 240ms var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  .theatre.has-dock .player--theatre { transition: none; }
}
.auth__as { margin-top: -6px; color: var(--text-muted); overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .signup-sheet__row { flex-wrap: wrap; }
  .signup-sheet__row .input { flex: 1 1 100%; }
  .signup-sheet__row .btn { flex: 1 1 100%; }
}
