/* Попап входа и регистрации — по макету Figma «Login popup» (1066×717) */

.AuthModal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.AuthModal[hidden] { display: none !important; }

.AuthModal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
}

.AuthModal__box {
  position: relative;
  display: flex;
  width: 1066px;
  max-width: 100%;
  /* 717px — высота макета; с полем никнейма форма регистрации выше,
     поэтому бокс растёт до высоты экрана, а не режет поля */
  min-height: 717px;
  height: auto;
  max-height: calc(100vh - 40px);
  border-radius: 20px;
  overflow: hidden;
  background: #131519;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

/* ── Арт-панель ───────────────────────────────────────────── */
.AuthArt {
  position: relative;
  flex: 0 0 394px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 28px 26px;
  overflow: hidden;
  background: #af6dff;
}
.AuthArt__media {
  position: absolute;
  inset: 0;
  background: url("/img/ui/auth-bg.png") center / cover no-repeat;
  mix-blend-mode: luminosity;
  opacity: 0.5;
}
.AuthArt__particles {
  position: absolute;
  inset: 0;
  background: url("/img/ui/auth-particles.png") center / cover no-repeat;
  mix-blend-mode: screen;
  opacity: 0.53;
}
.AuthArt::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  mix-blend-mode: multiply;
  z-index: 1;
}
.AuthArt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(29, 23, 36, 0) 0%, rgba(152, 67, 255, 0.5) 100%);
  z-index: 1;
}
.AuthArt__logo,
.AuthArt__slogan,
.AuthArt__legal { position: relative; z-index: 2; }

.AuthArt__logo { width: 190px; height: auto; }
.AuthArt__slogan {
  margin-top: auto;
  font-size: 35px;
  font-weight: 800;
  line-height: 1.45;
  color: #fff;
  text-align: center;
  text-shadow: 0 0 65px rgba(255, 255, 255, 0.55);
}
.AuthArt__legal {
  margin-top: auto;
  padding-top: 24px;
  font-size: 10px;
  line-height: 15px;
  color: #d9cfe8;
  text-align: center;
}

/* ── Правая часть ─────────────────────────────────────────── */
.AuthPane {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.AuthPane__close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #717171;
  font-size: 15px;
  cursor: pointer;
  transition: 0.15s;
}
.AuthPane__close:hover { background: #1e1a39; color: #fff; }

.AuthPane__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 40px 64px;
  overflow-y: auto;
}
/* Центрирование auto-отступами, а не justify-content: center — тот при
   переполнении обрезает верх (заголовок уезжал за край бокса) */
.AuthPane__body > :first-child { margin-top: auto; }
.AuthPane__body > :last-child { margin-bottom: auto; }
.AuthPane__title { font-size: 22px; font-weight: 600; color: #fff; letter-spacing: 0.4px; }
.AuthPane__subtitle { font-size: 13px; line-height: 20px; color: #717171; }

.AuthPane__alert {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 90, 90, 0.12);
  border: 1px solid rgba(255, 90, 90, 0.35);
  color: #ff8b8b;
  font-size: 13px;
}
.AuthPane__alert.is-visible { display: flex; }

/* ── Форма ────────────────────────────────────────────────── */
.AuthForm { display: flex; flex-direction: column; gap: 8px; }
.AuthForm__label { font-size: 15px; font-weight: 600; color: #fff; margin-top: 6px; }
.AuthForm__input {
  height: 49px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid #2a2450;
  outline: none;
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  background: linear-gradient(180deg, #19182d 0%, #1e1733 100%);
  transition: 0.15s;
}
.AuthForm__input::placeholder { color: #717171; }
.AuthForm__input:focus { border-color: rgba(134, 58, 255, 0.55); box-shadow: 0 0 0 3px rgba(134, 58, 255, 0.12); }
.AuthForm__input.is-error { border-color: #ff5a5a; }
.AuthForm__error { min-height: 14px; font-size: 12px; color: #ff5a5a; }
.AuthForm__confirm { display: flex; flex-direction: column; gap: 8px; }
.AuthForm__confirm[hidden] { display: none; }

.AuthForm__submit {
  height: 49px;
  margin-top: 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 500;
  background: linear-gradient(180deg, #a448ff 0%, #873aff 100%);
  box-shadow: 0 0 24.7px 0 rgba(134, 58, 255, 0.2);
  transition: 0.1s;
}
.AuthForm__submit:hover { transform: scale(0.995); opacity: 0.92; }
.AuthForm__submit:disabled { opacity: 0.6; cursor: default; }

.AuthForm__switch {
  margin-top: 4px;
  font-size: 13px;
  color: #717171;
  text-align: center;
}
.AuthForm__switch button {
  margin-left: 6px;
  border: none;
  background: none;
  color: #9742ff;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.AuthForm__switch button:hover { opacity: 0.8; }

/* ── Футер попапа ─────────────────────────────────────────── */
.AuthPane__footer {
  padding: 26px 64px 28px;
  background: #19172c;
  border-bottom-right-radius: 20px;
}
.AuthPane__footer-text { font-size: 13px; line-height: 20px; color: #717171; }
.AuthPane__links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; }
.AuthPane__link_terms { color: #0057ff; }
.AuthPane__link_support { color: #9742ff; }
.AuthPane__link:hover { opacity: 0.8; }

/* ── Адаптив ──────────────────────────────────────────────── */
@media screen and (max-width: 1000px) {
  .AuthModal__box { min-height: 0; height: auto; max-height: calc(100vh - 40px); }
  .AuthArt { display: none; }
  .AuthPane__body { padding: 48px 32px 24px; }
  /* Юридический текст в футере дублирует подзаголовок и на телефоне съедал
     полэкрана — форма регистрации уезжала под него. Оставляем только ссылки. */
  .AuthPane__footer { padding: 14px 32px 18px; }
  .AuthPane__footer-text { display: none; }
  .AuthPane__links { margin-top: 0; }
}
