/* =========================================================
   RetroBlysk — Galeria klienta
   Kolory: #ad8864 (złoty), #e22658 (accent), #fff, #111
   Fonty: Playfair Display, Lora, Inter
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Lora:ital,wght@0,400;1,400&family=Playfair+Display:wght@400;600&family=Questrial&display=swap');

:root {
  --rb-gold:    #ad8864;
  --rb-red:     #e22658;
  --rb-text:    #161616;
  --rb-muted:   #6d6d6d;
  --rb-border:  #e4ddd6;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; font-family: Inter, Arial, sans-serif; background: #111; color: #fff; }

/* HTML [hidden] attribute must always win over display:flex/grid/block */
[hidden] { display: none !important; }

/* ══════════════════════════════════════════════════════════════════
   LOGIN — mobile-first, identyczny z retroblysk.pl/strefa-klienta
   ══════════════════════════════════════════════════════════════════ */

/* ── Pełnoekranowe tło ze zdjęciem ── */
.login-view {
  /* 100dvh = dynamic viewport height — poprawne na iOS (chowa/pokazuje pasek) */
  min-height: 100dvh;
  min-height: 100vh; /* fallback */
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  /* Mobile: mniej padingu bocznego */
  padding: 80px 16px 32px;

  background-image: url("https://retroblysk.pl/wp-content/uploads/2024/09/IMG_4573-scaled.jpg");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  background-color: #1c150f;
}

/* Delikatna ciemna warstwa — jak w oryginale */
.login-view::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .10);
  pointer-events: none;
  z-index: 0;
}

/* ── LOGO — wyśrodkowane u góry, linki do retroblysk.pl ── */
.login-logo-link {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: block;
  transition: opacity .2s;
  /* Zapobiega migotaniu kliknięcia na mobile */
  -webkit-tap-highlight-color: transparent;
}
.login-logo-link:hover { opacity: .75; }

.login-logo {
  /* Mobile: mniejsze logo */
  height: 44px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 10px rgba(0,0,0,.45));
}

/* ── FORMULARZ LOGOWANIA ── */
.login-box {
  position: relative;
  z-index: 2;
  width: 100%;
  /* Mobile: pełna szerokość z marginesem */
  max-width: 420px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #CCCCCC;
  padding: 28px 24px 24px;
  text-align: center;
  /* iOS: eliminuje domyślny border-radius na inputach */
  -webkit-appearance: none;
}

.login-box h1 {
  font-family: "Playfair Display", serif;
  font-weight: 400;
  /* Mobile: mniejszy font */
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 3px;
  line-height: 1.6;
  color: #494949;
  margin: 0;
}

.login-box p {
  font-family: "Questrial", "Inter", sans-serif;
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #494949;
  margin: 4px 0 20px;
}

.login-box form { display: grid; gap: 0; }

/* ── Wrapper pola (unifikuje zwykłe pole i pass-wrap) ── */
.login-box .field-wrap {
  position: relative;
  margin-bottom: 10px;
}

/* ── WSPÓLNY STYL dla obu pól — identyczne ── */
.login-box .field-wrap input,
.login-box input[type="text"]:not(.field-wrap input),
.login-box input[type="password"]:not(.field-wrap input),
.login-box input[type="email"]:not(.field-wrap input) {
  display: block;
  width: 100%;
  padding: 13px 16px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(180,160,140,.45);
  border-radius: 0;
  -webkit-border-radius: 0;
  font-family: "Questrial", "Inter", sans-serif;
  font-size: 14px;
  letter-spacing: .5px;
  color: #3a3a3a;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-shadow: none;
  transition: border-color .2s, background .2s;
  box-sizing: border-box;
}

/* Pole z przyciskiem oka — padding-right by nie nachodziło */
.login-box .field-wrap input[type="password"] { padding-right: 46px; }

/* Focus — subtelna złota linia na dole (elegancka, nie neonowa) */
.login-box .field-wrap input:focus,
.login-box input:focus {
  outline: none !important;
  border-color: rgba(173,136,100,.7);
  background: rgba(255,255,255,0.96);
  box-shadow: 0 1px 0 0 rgba(173,136,100,.5);
}

/* Placeholder — spójny */
.login-box .field-wrap input::placeholder,
.login-box input::placeholder {
  color: #b0a090;
  font-size: 13px;
  letter-spacing: .5px;
}

/* Przycisk oka — absolutnie wyśrodkowany, zawsze taki sam */
.login-box .eye-btn {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 44px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: #b0a090;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  transition: color .15s;
}
.login-box .eye-btn:hover { color: var(--rb-gold); }

/* ── PRZYCISK ZALOGUJ ── */
.login-box button[type="submit"] {
  margin-top: 14px;
  width: 100%;
  padding: 14px 16px;
  background: rgba(255,255,255,0.88);
  color: #4A4A4A;
  border: 1px solid rgba(180,160,140,.45);
  border-radius: 0;
  -webkit-border-radius: 0;
  cursor: pointer;
  font-family: "Trajan Pro", "Playfair Display", "Times New Roman", serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 5.9px;
  text-transform: uppercase;
  transition: background .2s, color .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
}
.login-box button[type="submit"]:hover { background: #ede8e3; border-color: rgba(173,136,100,.6); color: #333; }
.login-box button[type="submit"]:active { background: #DAD3CF; }
.login-box button[type="submit"]:disabled { opacity: .5; cursor: default; }

/* ── GDPR MODAL ── */
.gdpr-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 16px;
}
.gdpr-box {
  background: #fff;
  color: var(--rb-text);
  max-width: 520px;
  width: 100%;
  padding: 28px 24px;
  border-radius: 2px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.gdpr-box h2 {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  margin: 0 0 12px;
}
.gdpr-box p  { font-size: 14px; line-height: 1.6; color: #444; margin: 0 0 16px; }
.gdpr-box a  { color: var(--rb-gold); }
.gdpr-checkbox-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: #333; line-height: 1.5; margin-bottom: 20px;
}
.gdpr-checkbox-row input[type="checkbox"] {
  margin-top: 2px; flex-shrink: 0; width: 16px; height: 16px;
  accent-color: var(--rb-gold);
}
.gdpr-btn {
  width: 100%;
  padding: 12px;
  background: var(--rb-gold);
  color: #fff;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: background .2s;
}
.gdpr-btn:hover { background: var(--rb-red); }
.gdpr-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════════
   WIDOK GALERII — nowy layout (hero + meta-bar + grid)
   ══════════════════════════════════════════════════════════════════ */
#galleryView { background: #fff; color: var(--rb-text); min-height: 100vh; }

/* ── HERO — pełna szerokość ── */
.gallery-hero {
  position: relative;
  width: 100%;
  /* Mobile: 55vw, desktop: 70vh */
  height: 55vw;
  max-height: 75vh;
  min-height: 220px;
  overflow: hidden;
  background: #e8e0d8;
}
.hero-img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  transition: opacity .4s;
}
.hero-img[src=""] { opacity: 0; }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.12) 0%, transparent 45%, rgba(0,0,0,.2) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Placeholder gdy brak okładki */
.gallery-hero:not(:has(.hero-img[src]:not([src=""]))) {
  background: linear-gradient(135deg, #f0ebe4 0%, #e8ddd4 100%);
}

/* ── META BAR — nazwa pary + akcje ── */
.gallery-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 12px;
  border-bottom: 1px solid #ebebeb;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.gallery-meta-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gallery-couple-name {
  font-family: "Playfair Display", serif;
  font-size: clamp(15px, 3.5vw, 22px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: .5px;
  color: #1a1a1a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-event-date {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--rb-muted);
  text-transform: uppercase;
}

/* ── Akcje po prawej ── */
.gallery-meta-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.meta-action-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #555;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s, color .18s;
  -webkit-tap-highlight-color: transparent;
}
.meta-action-btn svg { width: 20px; height: 20px; }
.meta-action-btn:hover { background: #f0f0f0; color: #111; }

/* Dropdown menu */
.meta-menu-wrap { position: relative; }
.meta-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  min-width: 160px;
  z-index: 50;
  overflow: hidden;
}
.meta-menu-dropdown button {
  display: block;
  width: 100%;
  padding: 11px 18px;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  font-family: Inter, sans-serif;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: background .15s;
}
.meta-menu-dropdown button:last-child { border-bottom: none; }
.meta-menu-dropdown button:hover { background: #f7f7f7; }

/* ── STUDIO INFO ── */
.gallery-studio-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 24px 14px;
  text-align: center;
}
.studio-name {
  font-family: "Playfair Display", serif;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #333;
}
.studio-tagline {
  font-family: "Questrial", "Inter", sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--rb-muted);
}
.studio-links {
  display: flex; gap: 12px; margin-top: 4px;
}
.studio-links a {
  color: var(--rb-muted);
  transition: color .18s;
  display: flex; align-items: center;
}
.studio-links a:hover { color: var(--rb-gold); }

/* ── SEPARATOR ── */
.gallery-divider {
  height: 1px;
  background: #ebebeb;
  margin: 0 24px 8px;
}

/* ── Stopka galerii ── */
.gallery-footer {
  margin-top: 32px;
  padding: 16px 24px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: "Questrial", "Inter", sans-serif;
  font-size: 11px;
  color: rgba(80,70,60,.45);
  letter-spacing: .5px;
  border-top: 1px solid #ebebeb;
}
.gallery-footer .footer-sep { opacity: .4; }
.gallery-footer .footer-credit {
  color: rgba(80,70,60,.35);
  text-decoration: none;
  border-bottom: 1px dotted rgba(80,70,60,.25);
  transition: color .15s;
}
.gallery-footer .footer-credit:hover { color: var(--rb-gold); }

/* ── PHOTO GRID — masonry: liczba kolumn z szerokości ekranu (wypełnia całą szerokość) ── */
.grid {
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  /* dynamiczna liczba kolumn — lepsze niż sztywne 2/3/4 na breakpointach */
  column-width: clamp(148px, 22vw, 272px);
  /* Wąskie szczeliny między zdjęciami (jak ciasny układ referencyjny) */
  column-gap: clamp(2px, 0.45vw, 6px);
  column-fill: balance;
  padding: clamp(8px, 1.6vw, 18px) clamp(10px, 2.2vw, 24px);
  /* Odsunięcie od góry viewport przy scrollIntoView (sticky pasek / safe area) */
  scroll-margin-top: max(16px, env(safe-area-inset-top, 0px));
}
body:has(#adminBar) .grid {
  scroll-margin-top: max(100px, env(safe-area-inset-top));
}

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
.grid-item {
  break-inside: avoid;
  margin-bottom: clamp(3px, 0.5vw, 6px);
  position: relative;
  cursor: pointer;
  /* overflow:visible — poprzednio hidden przycinało przycisk 🗑 przy zepsutych miniaturach */
  overflow: visible;
}
.grid-item img {
  width: 100%;
  display: block;
  border-radius: 1px;
  transition: transform .25s ease, filter .25s ease;
  vertical-align: middle;
}
/* Zaokrąglenie „kadru” bez obcinania przycisków admina */
.grid-item .grid-item-media {
  overflow: hidden;
  border-radius: 1px;
}
.grid-item.admin-photo-selected .grid-item-media {
  outline: 3px solid var(--rb-gold);
  outline-offset: -3px;
}
.grid-item:hover .grid-item-media img {
  transform: scale(1.022);
  filter: contrast(1.04);
}

/* ── LIGHTBOX ── */
/* ══════════════════════════════════════════════════════════════════
   LIGHTBOX — elegancki, animowany, responsywny
   ══════════════════════════════════════════════════════════════════ */

.lightbox {
  position: fixed; inset: 0;
  background: rgba(8,8,8,.96);
  display: flex;
  flex-direction: column;
  z-index: 100;
  opacity: 0;
  transition: opacity .22s ease;
}
.lightbox.lb-visible { opacity: 1; }

/* ── Górny pasek ── */
.lb-topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: linear-gradient(to bottom, rgba(0,0,0,.55) 0%, transparent 100%);
  z-index: 10;
  flex-shrink: 0;
}

.lb-counter {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.55);
  font-family: "Questrial", "Inter", sans-serif;
  font-size: 12px;
  letter-spacing: 2px;
  pointer-events: none;
  white-space: nowrap;
}

/* ── Przyciski ikony (zamknij / pobierz) ── */
.lb-icon-btn {
  width: 42px; height: 42px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s, transform .15s;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  flex-shrink: 0;
}
.lb-icon-btn:hover  { background: rgba(255,255,255,.22); }
.lb-icon-btn:active { transform: scale(.92); }

/* ── Obszar zdjęcia ── */
.lb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* ── Kontener zdjęcia — animacja ── */
.lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  padding: 0 64px;          /* miejsce na strzałki desktop */
  box-sizing: border-box;
}

.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 16px 60px rgba(0,0,0,.7);
  transition: opacity .18s ease, transform .18s ease;
  display: block;
}
.lb-img.lb-fade {
  opacity: 0;
  transform: scale(.97);
}

/* ── Strzałki nawigacji — po bokach (desktop) ── */
.lb-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s, opacity .18s, transform .15s;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 5;
  opacity: 0;
}
.lb-stage:hover .lb-arrow { opacity: 1; }
.lb-arrow-l { left: 12px; }
.lb-arrow-r { right: 12px; }
.lb-arrow:hover  { background: rgba(255,255,255,.22); }
.lb-arrow:active { transform: translateY(-50%) scale(.9); }

/* Disabled — gdy nie ma poprzedniego/następnego */
.lb-arrow:disabled { opacity: 0 !important; pointer-events: none; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Na mobile: strzałki zawsze widoczne, mniejsze ── */
@media (max-width: 768px) {
  .lb-img-wrap { padding: 0 8px; }

  .lb-arrow {
    opacity: 1;
    width: 40px; height: 40px;
    background: rgba(0,0,0,.35);
    border-color: rgba(255,255,255,.12);
  }
  .lb-arrow-l { left: 6px; }
  .lb-arrow-r { right: 6px; }
  .lb-arrow:active { transform: translateY(-50%) scale(.88); }

  .lb-counter { font-size: 11px; letter-spacing: 1.5px; }
}

/* ── TOAST / STATUS ── */
.toast {
  position: fixed;
  bottom: 20px; right: 20px;
  background: #222;
  color: #fff;
  padding: 12px 18px;
  border-radius: 3px;
  font-size: 13px;
  z-index: 200;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.gold  { border-left: 3px solid var(--rb-gold); }
.toast.red   { border-left: 3px solid var(--rb-red); }

/* ── LIGHTBOX INFO (legacy — zastąpione przez .lb-counter) ── */
.lightbox-info {
  color: rgba(255,255,255,.5);
  font-size: 12px;
  letter-spacing: 2px;
  margin-top: 8px;
}

/* ── BŁĘDY / KOMUNIKATY FORMULARZY (jasne tło w login-box) ── */
.form-error {
  background: rgba(226,38,88,.08);
  border: 1px solid #d9534f;
  color: #c0392b;
  padding: 8px 12px;
  font-size: 12px;
  margin-top: 8px;
  letter-spacing: .5px;
  text-align: center;
}
.form-msg {
  padding: 8px 12px;
  font-size: 12px;
  margin-top: 8px;
  text-align: center;
  letter-spacing: .5px;
}
.form-msg.ok  { background: rgba(39,174,96,.1); border: 1px solid #27ae60; color: #1e7e34; }
.form-msg.err { background: rgba(226,38,88,.08); border: 1px solid #d9534f; color: #c0392b; }

/* ── LINK BUTTON (Zapomniałem hasła / Powrót) ── */
.link-btn {
  background: none; border: none;
  color: var(--rb-gold);
  font-family: "Playfair Display", serif;
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 8px 0;
  margin-top: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: block;
  width: 100%;
  text-align: center;
}
.link-btn:hover { color: #8a6640; }

/* ── PRZYCISK GHOST (w nagłówku) ── */
.btn-ghost {
  background: none;
  border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.7);
  padding: 8px 14px;
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all .2s;
}
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ── ZAKŁADKI FOTO / VIDEO ── */
.gallery-tabs {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0 24px;
  background: #111;
  border-bottom: 1px solid #222;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,.5);
  padding: 12px 20px;
  font-size: 12px;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all .2s;
}
.tab-btn.active { color: var(--rb-gold); border-bottom-color: var(--rb-gold); }
.tab-btn:hover  { color: #fff; }

/* ══════════════════════════════════════════════════════════════════
   VIDEO SECTION — siatka responsywna (wiele kolumn na szerokim ekranie)
   ══════════════════════════════════════════════════════════════════ */

#videoSection {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.video-list {
  display: grid;
  /* Większe „okienka”: mniej kolumn na desktopie (ok. 1–2 na laptopie, 2–3 na szerokim). */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, clamp(300px, 52vw, 620px)), 1fr));
  gap: clamp(20px, 2.8vw, 36px);
  padding: clamp(18px, 2.8vw, 40px) clamp(14px, 3.2vw, 40px);
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  align-items: start;
}

.video-card {
  position: relative;
  min-width: 0;
  width: 100%;
  background: #111;
  border-radius: 6px;
  /* visible — menu „Jakość” (fixed) nie może być przycinane; zaokrąglenia robią .video-wrap + .video-meta */
  overflow: visible;
  box-shadow: 0 4px 24px rgba(0,0,0,.35);
}

/* Kontener wideo — utrzymuje proporcje 16:9 */
.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

/* HLS: pasek .video-chrome jest pod <video> — proporcje tylko na wideo, nie na całym wrap */
.video-wrap--hls {
  display: flex;
  flex-direction: column;
  aspect-ratio: unset;
  min-height: 0;
}
/* Oryginał MP4 + natywne controls: stały prostokąt 16:9 (bez „kurczenia” do rozmiaru klatki) */
.video-wrap--hls.video-wrap--native-mp4 {
  display: block;
  aspect-ratio: 16 / 9;
  position: relative;
}
.video-wrap--hls.video-wrap--native-mp4 .video-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  max-height: none;
  object-fit: contain;
}
.video-player {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

.video-wrap--hls .video-player {
  flex-shrink: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

/* Własny pasek zamiast natywnych controls (HLS + hls.js + CSP blob:) */
.video-chrome {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.82) 35%, rgba(0,0,0,.94) 100%);
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.video-chrome[hidden] {
  display: none !important;
}
.vcc-play,
.vcc-fs {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s;
}
.vcc-play:hover,
.vcc-fs:hover {
  background: rgba(173,136,100,.35);
}
.vcc-seek {
  flex: 1;
  min-width: 60px;
  height: 6px;
  cursor: pointer;
  accent-color: var(--rb-gold, #ad8864);
}
.vcc-time {
  flex-shrink: 0;
  font-size: 12px;
  color: rgba(255,255,255,.78);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-family: Inter, system-ui, sans-serif;
}
.vcc-sep { opacity: .45; }

/* Menu ⋮ jakości — poza .video-chrome, żeby było widoczne przy MP4 (chrome jest ukryty) */
.video-wrap--hls .video-hls-ui.video-hls-ui--overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  pointer-events: none;
}
.video-wrap--hls .video-hls-ui.video-hls-ui--overlay > * {
  pointer-events: auto;
}
.video-quality-gear.vcc-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255,255,255,.92);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}
.video-hls-ui--overlay .video-quality-gear.vcc-menu-btn {
  backdrop-filter: blur(6px);
}
.video-quality-gear.vcc-menu-btn:hover {
  background: rgba(173,136,100,.25);
  border-color: rgba(173,136,100,.45);
}
.vcc-dots {
  display: block;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
  transform: translateY(-1px);
}
/* Otwarte menu: pozycja ustawiana w JS (fixed), żeby mieściło się w viewport (mobile / wąski panel) */
.video-quality-popover.video-quality-popover--fixed {
  margin-top: 0 !important;
}

.video-mp4-fallback-hint {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,200,100,.85);
  background: rgba(255,160,0,.08);
  border: 1px solid rgba(255,180,60,.2);
  border-radius: 8px;
  max-width: 100%;
}
.video-mp4-fallback-title {
  font-weight: 600;
  color: rgba(255,220,160,.95);
}
.video-mp4-fallback-body {
  color: rgba(255,255,255,.65);
  font-size: 11px;
}

/* Overlay "trwa przetwarzanie" */
.video-processing-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.vpo-inner {
  text-align: center;
  color: rgba(255,255,255,.8);
  font-family: "Questrial", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}
.vpo-inner small { opacity: .6; font-size: 12px; }

/* Dolny pasek z info i przyciskami */
.video-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  gap: 12px;
  flex-wrap: wrap;
  background: #1a1a1a;
  border-radius: 0 0 6px 6px;
}

.video-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.video-name {
  color: rgba(255,255,255,.8);
  font-size: 14px;
  font-family: "Questrial", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}

/* Badge jakości HLS */
.hls-badge {
  font-size: 11px;
  letter-spacing: .5px;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
  width: fit-content;
}
.hls-badge.ready   { background: rgba(173,136,100,.15); color: var(--rb-gold); border: 1px solid rgba(173,136,100,.3); }
.hls-badge.pending { background: rgba(255,200,0,.08); color: rgba(255,200,0,.7); border: 1px solid rgba(255,200,0,.2); }

/* Pasek „Jakość” pod odtwarzaczem — poza warstwą natywnych kontrolek <video> */
.video-hls-ui {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 14px;
  background: #141414;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-wrap: wrap;
  gap: 8px;
}
.video-quality-gear {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border: 1px solid rgba(173,136,100,.45);
  border-radius: 8px;
  background: rgba(173,136,100,.12);
  color: var(--rb-gold);
  cursor: pointer;
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .03em;
  transition: background .15s, border-color .15s, color .15s;
}
.video-quality-gear:hover {
  background: rgba(173,136,100,.22);
  border-color: var(--rb-gold);
  color: #fff;
}
.video-quality-gear:active {
  transform: scale(0.98);
}
.video-quality-gear-svg {
  display: block;
  flex-shrink: 0;
  opacity: .95;
}
.video-quality-gear-label {
  line-height: 1;
}
.video-quality-popover {
  position: absolute;
  top: 100%;
  bottom: auto;
  right: 14px;
  margin-top: 8px;
  margin-bottom: 0;
  min-width: min(232px, calc(100vw - 24px));
  max-width: min(92vw, 300px);
  max-height: min(55vh, 320px);
  background: rgba(22,22,22,.98);
  border: 1px solid rgba(173,136,100,.28);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0,0,0,.65);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 40;
}
.video-quality-popover-head {
  padding: 11px 16px 7px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.48);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: Inter, sans-serif;
}
.video-quality-options {
  list-style: none;
  margin: 0;
  padding: 2px 0 10px;
}
.video-quality-options li {
  margin: 0;
}
.video-quality-opt {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  padding: 11px 16px;
  margin: 0 6px;
  width: calc(100% - 12px);
  box-sizing: border-box;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,.92);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  font-family: Inter, sans-serif;
}
.video-quality-opt:hover:not(.is-disabled) {
  background: rgba(255,255,255,.1);
}
.video-quality-opt.is-selected {
  color: var(--rb-gold);
}
.video-quality-opt.is-disabled {
  opacity: .8;
  cursor: default;
}
.video-quality-opt .vq-check {
  width: 1.35em;
  flex-shrink: 0;
  text-align: center;
  font-size: 13px;
}
.video-quality-opt .vq-label {
  flex: 1;
  line-height: 1.35;
}

.video-quality-li-msg {
  list-style: none;
  margin: 0;
  padding: 0 12px 12px;
}
.video-quality-mp4-msg {
  margin: 0;
  padding: 8px 4px 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,.78);
  font-family: Inter, sans-serif;
}
.video-quality-mp4-msg p {
  margin: 0 0 12px;
}
.video-quality-mp4-msg p:last-child {
  margin-bottom: 0;
}
.video-quality-code {
  font-size: 12px;
  background: rgba(0,0,0,.35);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}

.video-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.btn-download-video {
  background: rgba(173,136,100,.15);
  color: var(--rb-gold);
  border: 1px solid rgba(173,136,100,.35);
  padding: 8px 16px;
  border-radius: 2px;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s, border-color .18s;
  min-height: 38px;
}
.btn-download-video:hover  { background: rgba(173,136,100,.3); border-color: rgba(173,136,100,.6); }
.btn-download-video:active { background: rgba(173,136,100,.45); }

/* ── MODAL ZMIANA HASŁA ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: linear-gradient(165deg, #252019 0%, #1a1714 48%, #161310 100%);
  border: 1px solid rgba(173, 136, 100, 0.22);
  border-radius: 8px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
  color-scheme: dark;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 28px 90px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.modal-box--wide { max-width: 480px; }
.modal-lead {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 22px;
}
.modal-box .modal-lead strong { color: rgba(255,255,255,.92); }
#shareGalleryModal .modal-box {
  padding: 40px 36px 34px;
}
#shareGalleryModal .btn-primary {
  margin-top: 28px;
}
.share-result-block {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(173, 136, 100, 0.2);
}
.share-url-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 10px;
}
.share-url-field {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.92);
}
.btn-secondary-inline {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(173, 136, 100, 0.35);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.btn-secondary-inline:hover {
  background: rgba(173, 136, 100, 0.18);
  border-color: rgba(173, 136, 100, 0.55);
}

.share-guest-box { max-width: 440px; }
.share-guest-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
}
.share-guest-footer a { color: var(--rb-gold); }

.modal-box h2 {
  font-family: "Playfair Display", serif;
  font-weight: 400;
  color: var(--rb-gold);
  font-size: 22px;
  margin: 0 0 20px;
  padding-right: 36px;
  line-height: 1.25;
}
.modal-box label {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 8px;
  margin-top: 18px;
}
.modal-box form > label:first-of-type {
  margin-top: 4px;
}
/* Pola w modalach — ten sam klimat co .share-url-field (nie białe „systemowe”) */
.modal-box .field-wrap {
  margin: 0;
}
.modal-box .field-wrap input[type="text"],
.modal-box .field-wrap input[type="password"],
.modal-box .field-wrap input[type="email"],
.modal-box .field-wrap input[type="date"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: Inter, system-ui, sans-serif;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.modal-box .field-wrap input[type="password"] {
  padding-right: 46px;
}
.modal-box .field-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.32);
  letter-spacing: 0.02em;
}
.modal-box .field-wrap input:focus {
  border-color: rgba(173, 136, 100, 0.55);
  background: rgba(0, 0, 0, 0.48);
  box-shadow: 0 0 0 3px rgba(173, 136, 100, 0.14);
}
.modal-box .field-wrap input[type="date"] {
  font-variant-numeric: tabular-nums;
  min-height: 46px;
  color-scheme: dark;
}
.modal-box .field-wrap input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.88) opacity(0.65);
  cursor: pointer;
  padding: 4px;
  margin-left: 4px;
}
.modal-box .field-wrap input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0.95;
}
.modal-box .form-msg {
  border-radius: 4px;
  margin-top: 14px;
}
.modal-box .form-msg.err {
  background: rgba(226, 38, 88, 0.14);
  border: 1px solid rgba(255, 120, 140, 0.35);
  color: #ffc9d0;
}
.modal-box .form-msg.ok {
  background: rgba(72, 180, 120, 0.12);
  border: 1px solid rgba(100, 200, 150, 0.35);
  color: #b8f5d4;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(173, 136, 100, 0.35);
}
.btn-primary {
  width: 100%;
  background: linear-gradient(180deg, #c4a17a 0%, var(--rb-gold) 55%, #8f6f4f 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 18px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 24px;
  transition: filter 0.2s, box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 20px rgba(173, 136, 100, 0.25);
}
.btn-primary:active {
  transform: translateY(1px);
}

/* ── GDPR LOGO ── */
.gdpr-logo {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--rb-gold);
  margin-bottom: 12px;
  text-align: center;
}

/* .pass-wrap — zastąpiony przez .field-wrap (patrz blok formularza logowania) */

/* ══════════════════════════════════════════════════════════════════
   TRYB ADMINA — floating toolbar + delete buttons
   ══════════════════════════════════════════════════════════════════ */

/* Sticky admin toolbar u góry ekranu */
.admin-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 10px 16px;
  background: #1a1a2e;
  border-bottom: 2px solid var(--rb-gold);
  box-shadow: 0 2px 16px rgba(0,0,0,.4);
  font-family: Inter, sans-serif;
}

.admin-bar-left   { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }
.admin-bar-center {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 280px;
  min-width: 0;
}
.admin-bar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.admin-bar-btn-danger:not(:disabled) {
  background: rgba(160, 40, 40, .45);
  border-color: rgba(255, 120, 120, .45);
}
.admin-bar-btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-bar-badge {
  background: var(--rb-gold);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  white-space: nowrap;
}

.admin-bar-gallery {
  color: rgba(255,255,255,.7);
  font-size: 13px;
  letter-spacing: .5px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 2px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 12px;
  letter-spacing: .5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, border-color .18s;
  -webkit-tap-highlight-color: transparent;
}
.admin-bar-btn:hover, .admin-bar-btn:active {
  background: rgba(173,136,100,.3);
  border-color: var(--rb-gold);
}

.admin-bar-upload {
  position: relative;
  overflow: hidden;
}

/* Kiedy admin bar jest widoczny — przesuń całą stronę w dół (więcej miejsca — przyciski zbiorcze) */
body:has(#adminBar) #galleryView { padding-top: 108px; }
body:has(#adminBar) .gallery-header { top: 108px; }
@media (max-width: 900px) {
  body:has(#adminBar) #galleryView { padding-top: 128px; }
  body:has(#adminBar) .gallery-header { top: 128px; }
}

/* Pasek meta pod sticky admin barem */
body:has(#adminBar) .gallery-meta-bar { top: 108px; }
@media (max-width: 900px) {
  body:has(#adminBar) .gallery-meta-bar { top: 128px; }
}

/* Checkbox zaznaczania (tryb admin) — lewy górny róg */
.admin-select-wrap {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 4;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.92);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.admin-select-wrap input {
  width: 18px;
  height: 18px;
  accent-color: var(--rb-gold);
  cursor: pointer;
  margin: 0;
}

/* ── Przycisk delete na zdjęciu (pojawia się przy hover) ── */
.grid-item .admin-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(220, 50, 50, .85);
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .18s, transform .18s;
  z-index: 3;
  backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
}
.grid-item:hover .admin-delete-btn,
.grid-item:focus-within .admin-delete-btn { opacity: 1; }
.admin-delete-btn:hover { transform: scale(1.12); background: rgba(200,30,30,.95); }

/* Na mobile: zawsze widoczny (no hover) */
@media (pointer: coarse) {
  .grid-item .admin-delete-btn { opacity: .75; }
}

/* ── Przycisk delete dla video ── */
.btn-delete-video {
  padding: 6px 12px;
  background: rgba(220,50,50,.9);
  color: #fff;
  border: none;
  border-radius: 2px;
  font-size: 12px;
  cursor: pointer;
  transition: background .18s;
  margin-left: 8px;
}
.btn-delete-video:hover { background: rgb(200,30,30); }

/* Checkbox na karcie video (tryb admin) */
.video-wrap .admin-select-wrap {
  top: 10px;
  left: 10px;
  z-index: 6;
}
.video-card.admin-video-selected .video-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid var(--rb-gold);
  border-radius: 0;
  pointer-events: none;
  z-index: 2;
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — mobile first (od najmniejszego do największego)
   ══════════════════════════════════════════════════════════════════ */

/* ─ Małe mobile (<360px) — ciasno ale schludnie ─ */
@media (max-width: 360px) {
  .login-view    { padding: 70px 12px 24px; }
  .login-box     { padding: 22px 16px 18px; }
  .login-box h1  { font-size: 19px; letter-spacing: 2px; }
  .login-logo    { height: 38px; }
}

/* ─ Landscape na mobile — mniej wysokości, kompaktowy formularz ─ */
@media (max-height: 520px) and (orientation: landscape) {
  .login-view { padding: 60px 16px 16px; justify-content: flex-start; overflow-y: auto; }
  .login-logo  { height: 34px; }
  .login-logo-link { position: absolute; }
  .login-box   { max-width: 340px; padding: 16px 20px 14px; }
  .login-box h1 { font-size: 16px; line-height: 1.4; }
  .login-box p  { margin-bottom: 10px; }
  .login-box form { gap: 0; }
  .login-box .field-wrap { margin-bottom: 6px; }
  .login-box .field-wrap input { padding: 9px 12px; }
  .login-box button[type="submit"] { padding: 10px; margin-top: 8px; min-height: 42px; }
}

/* ─ Tablet (≥600px) — formularz nieco szerszy ─ */
@media (min-width: 600px) {
  .login-view { padding: 90px 24px 40px; }
  .login-logo  { height: 52px; }
  .login-box   { max-width: 380px; padding: 32px 32px 28px; }
  .login-box h1 { font-size: 26px; }
  .login-box p  { font-size: 10px; }
  .login-box label { font-size: 15px; }
}

/* ─ Desktop (≥1024px) — jak oryginał: max 360px, duże logo ─ */
@media (min-width: 1024px) {
  .login-view  { padding: 100px 5% 60px; }
  .login-logo  { height: 60px; }
  .login-logo-link { top: 16px; }
  .login-box   { max-width: 360px; padding: 40px 36px 32px; }
  .login-box h1 { font-size: 30px; line-height: 2em; }
  .login-box p  { font-size: 11px; margin-bottom: 24px; }
  .login-box label { font-size: 16px; letter-spacing: 2px; }
  .login-box .field-wrap input { padding: 11px 14px; font-size: 15px; letter-spacing: 1px; }
  .login-box button[type="submit"] { padding: 13px; }
}

/* ─ Duże desktop (≥1440px) ─ */
@media (min-width: 1440px) {
  .login-box { max-width: 380px; }
}

/* ══ VIDEO — mobile responsive ════════════════════════════════════ */
@media (max-width: 600px) {
  .video-list {
    grid-template-columns: 1fr;
    padding: 12px 10px;
    gap: 18px;
  }
  .video-card { border-radius: 0; }
  .video-meta { padding: 10px 14px; flex-direction: column; align-items: flex-start; }
  .video-name { max-width: 90vw; }
  .video-actions { width: 100%; justify-content: flex-end; }
}

/* ══ GALERIA — wąski telefon: jedna kolumna zdjęć ═══════════════════ */
@media (max-width: 400px) {
  .grid {
    column-count: 1;
    column-width: auto;
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (max-width: 760px) {
  .gallery-header { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .gallery-actions button { font-size: 10px; padding: 8px 10px; }
  .gallery-tabs { padding: 0 12px; }
}

@media (max-width: 480px) {
  .modal-box { padding: 24px 18px; width: 95vw; }
  #shareGalleryModal .modal-box { padding: 28px 18px 22px; }
}
