/* ===== Modal Auth Window ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  width: min(90%, 380px);
  box-shadow: 0 6px 25px rgba(0,0,0,0.25);
  position: relative;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

.tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
  gap: 10px;
}

.tab {
  background: #eee;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}
.tab.active {
  background: #3478f6;
  color: #fff;
}

.form {
  display: none;
  flex-direction: column;
  gap: 12px;
}
.form.active {
  display: flex;
}

input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.btn {
  background: #3478f6;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}
.btn:hover {
  background: #2a5ccf;
}

.forgot {
  font-size: 0.9rem;
  text-align: right;
  color: #555;
  text-decoration: none;
}

.cf-turnstile {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

/* ===== Modal Image Window ===== */

.gallery {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}
.gallery__hero {
  position: relative;
  background: rgba(15,23,42,.6);
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 14px;
  padding: 8px;
}
.gallery__stage {
  min-height: 240px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
}
.gallery__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(148,163,184,.35);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gallery__img {
  max-width: 100%;
  max-height: 62vh;
  border-radius: 10px;
  display: block;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.fade-in { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 40px; width: 40px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.3);
  background: rgba(2,6,23,.6);
  color: #e5e7eb;
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .18s ease;
}
.gallery__nav:hover { background: rgba(2,6,23,.85); transform: translateY(-50%) scale(1.06); }
.gallery__nav[disabled] { opacity: .35; pointer-events: none; }
.gallery__nav--prev { left: 10px; }
.gallery__nav--next { right: 10px; }

.gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}
.gallery__thumb {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 2px;
  background: rgba(15,23,42,.6);
  transition: all .18s ease;
  cursor: pointer;
}
.gallery__thumb:hover { border-color: rgba(148,163,184,.35); transform: translateY(-1px); }
.gallery__thumb.is-active { border-color: #60a5fa; box-shadow: 0 0 0 2px rgba(96,165,250,.25) inset; }
.gallery__thumb img {
  width: 100%; height: 64px; object-fit: cover;
  border-radius: 8px;
  display: block;
}

.gallery__fallback {
  color: #94a3b8;
  padding: 28px 0;
}

/* адаптив */
@media (min-width: 1024px) {
  .gallery__img { max-height: 68vh; }



