/* ============================================================
   MoniTrading — Вход / Регистрация (slide-панель как в референсе)
   Светло-серо-голубая палитра дашборда. Без бежевых полей по краям.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700;800;900&display=swap');

/* Полностью перекрываем бежевый фон page-shell/body на этих страницах.
   Картинка-дашборд за карточкой входа — затемняем градиентом сверху, чтобы
   сама форма (белая) не терялась на светлом фоне. */
.page-shell--auth {
  display: block;
  padding: 0;
  place-items: unset;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(234, 243, 251, 0.32) 0%, rgba(221, 233, 243, 0.4) 100%),
    url("/static/auth-bg.jpg") center center / cover no-repeat;
}
body:has(.page-shell--auth) {
  background:
    linear-gradient(180deg, rgba(234, 243, 251, 0.32) 0%, rgba(221, 233, 243, 0.4) 100%),
    url("/static/auth-bg.jpg") center center / cover no-repeat;
}

.auth2-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  font-family: "Fira Sans", system-ui, sans-serif;
}

.auth2-card {
  position: relative;
  width: min(880px, 96vw);
  min-height: 540px;
  border-radius: 26px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 34px 80px rgba(20, 45, 80, 0.16);
}

/* ── Формы: две абсолютные половины, активная сверху ── */
.auth2-pane {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 44px;
  transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

.auth2-pane--login {
  left: 0;
  z-index: 2;
}

.auth2-pane--register {
  left: 0;
  z-index: 1;
  opacity: 0;
}

/* Переключение в режим регистрации */
.auth2-card.is-register .auth2-pane--login {
  transform: translateX(100%);
  opacity: 0;
  z-index: 1;
}
.auth2-card.is-register .auth2-pane--register {
  transform: translateX(100%);
  opacity: 1;
  z-index: 5;
  animation: auth2-show 0.6s;
}

@keyframes auth2-show {
  0%, 49.99% { opacity: 0; z-index: 1; }
  50%, 100% { opacity: 1; z-index: 5; }
}

.auth2-form-inner {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth2-form-inner h1 {
  margin: 0 0 4px;
  font-size: 27px;
  font-weight: 700;
  color: #1f2a3a;
}

.auth2-form {
  display: grid;
  gap: 14px;
}

.auth2-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #67727d;
}

.auth2-form input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(186, 198, 211, 0.7);
  background: #f5f9fc;
  padding: 13px 15px;
  font: inherit;
  font-size: 14px;
  color: #1f2a3a;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.auth2-form input:focus {
  outline: none;
  border-color: #2b6cb0;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.12);
}

/* Поле пароля с глазиком-переключателем видимости */
.auth2-pwd-wrap {
  position: relative;
}
.auth2-pwd-wrap input {
  padding-right: 44px;
}
.auth2-pwd-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: #8a96a4;
  transition: background 0.15s, color 0.15s;
}
.auth2-pwd-eye:hover {
  background: rgba(43, 108, 176, 0.08);
  color: #2b6cb0;
}
.auth2-pwd-eye svg {
  width: 19px;
  height: 19px;
}
.auth2-pwd-eye .eye-off {
  display: none;
}
.auth2-pwd-eye.is-visible .eye-on {
  display: none;
}
.auth2-pwd-eye.is-visible .eye-off {
  display: block;
}

.auth2-btn {
  width: 100%;
  margin-top: 4px;
  padding: 13px 16px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(135deg, #2b6cb0 0%, #0a98ef 100%);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth2-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(43, 108, 176, 0.32);
}

.auth2-foot {
  margin: 2px 0 0;
  font-size: 13px;
}
.auth2-foot a { color: #2b6cb0; text-decoration: none; }
.auth2-foot a:hover { text-decoration: underline; }

.auth2-hint {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #8a96a4;
}

.auth2-inviter-status {
  margin: -8px 0 0;
  font-size: 12.5px;
  line-height: 1.4;
}
.auth2-inviter-status.is-found { color: #1f7a4f; }
.auth2-inviter-status.is-missing { color: #8a96a4; }

/* ── Обложка ── */
.auth2-cover-container {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  overflow: hidden;
  z-index: 100;
  transition: transform 0.6s ease-in-out;
  border-radius: 0 26px 26px 0;
}

.auth2-card.is-register .auth2-cover-container {
  transform: translateX(-100%);
  border-radius: 26px 0 0 26px;
}

.auth2-cover {
  position: relative;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(135deg, #2b6cb0 0%, #0a98ef 100%);
  color: #fff;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
}

.auth2-card.is-register .auth2-cover {
  transform: translateX(50%);
}

.auth2-cover__panel {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 0 42px;
  transition: transform 0.6s ease-in-out;
}

.auth2-cover__panel--left {
  left: 0;
  transform: translateX(-18%);
}
.auth2-card.is-register .auth2-cover__panel--left {
  transform: translateX(0);
}

.auth2-cover__panel--right {
  right: 0;
  transform: translateX(0);
}
.auth2-card.is-register .auth2-cover__panel--right {
  transform: translateX(18%);
}

.auth2-cover__logo {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: #fff;
}
/* На синем градиенте тёмно-синий «Moni» из лого не виден — оставляем белым,
   а «Trading» делаем светло-зелёным, сохраняя фирменную двухцветность. */
.auth2-cover__logo span { font-weight: 800; opacity: 1; color: #9af0b8; }

.auth2-cover__panel h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
}

.auth2-cover__panel p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.auth2-ghost {
  appearance: none;
  margin-top: 8px;
  padding: 11px 32px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth2-ghost:hover { background: #fff; color: #2b6cb0; }

.alert {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.alert-success { background: #e6f6ec; color: #1f7a4f; }
.alert-error { background: #fdeaea; color: #b3261e; }

.auth2-tabs { display: none; }

/* ── Одиночная карточка для шагов «код» и «пароль» ── */
.auth2-single {
  width: min(420px, 96vw);
  background: #fff;
  border-radius: 22px;
  padding: 36px 32px;
  box-shadow: 0 30px 70px rgba(20, 45, 80, 0.14);
  animation: auth2-single-in 0.45s ease;
}
@keyframes auth2-single-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth2-single__logo {
  font-size: 20px;
  font-weight: 800;
  color: #1c3f6e;
  margin-bottom: 14px;
}
.auth2-single__logo span { font-weight: 800; color: #3fae57; opacity: 1; }
.auth2-single h1 {
  margin: 0 0 6px;
  font-size: 23px;
  font-weight: 700;
  color: #1f2a3a;
}
.auth2-single .auth2-sub {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #8a96a4;
}
.auth2-single .auth2-form { margin-top: 4px; }
.auth2-single .auth2-foot { margin-top: 14px; font-size: 13px; color: #8a96a4; }
.auth2-single .auth2-foot a { color: #2b6cb0; text-decoration: none; }
.auth2-single input:disabled { background: #eef2f6; color: #8a96a4; }

/* ============================================================
   Мобильная версия (<768px): та же анимация-слайд, но компактно —
   обложка становится верхним баннером, формы скользят по горизонтали.
   ============================================================ */
@media (max-width: 767px) {
  .auth2-card {
    width: min(420px, 100%);
    min-height: 0;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
  }

  /* Табы сверху */
  .auth2-tabs {
    display: flex;
    order: -2;
  }
  .auth2-tab {
    flex: 1 1 50%;
    appearance: none;
    border: 0;
    background: #eef3f8;
    color: #67727d;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 15px 0;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
  }
  .auth2-card:not(.is-register) .auth2-tab[data-auth-switch="login"],
  .auth2-card.is-register .auth2-tab[data-auth-switch="register"] {
    background: #fff;
    color: #2b6cb0;
    box-shadow: inset 0 -2px 0 #2b6cb0;
  }

  /* Компактный градиентный баннер вместо большой обложки */
  .auth2-cover-container {
    position: relative;
    left: auto;
    top: auto;
    order: -1;
    width: 100%;
    height: 116px;
    transform: none !important;
    border-radius: 0;
  }
  .auth2-cover {
    position: relative;
    left: 0;
    width: 100%;
    transform: none !important;
  }
  .auth2-cover__panel {
    width: 100%;
    padding: 0 24px;
    gap: 6px;
    opacity: 0;
    transform: none !important;
    transition: opacity 0.4s ease;
  }
  .auth2-cover__panel p,
  .auth2-cover__panel .auth2-ghost { display: none; }
  .auth2-cover__panel h2 { font-size: 20px; }
  .auth2-card:not(.is-register) .auth2-cover__panel--left { opacity: 1; }
  .auth2-card.is-register .auth2-cover__panel--right { opacity: 1; }

  /* Формы: видна только активная, входящая плавно въезжает с фейдом */
  .auth2-pane {
    position: relative;
    top: auto;
    left: auto !important;
    width: 100%;
    height: auto;
    padding: 26px 22px 30px;
    transform: none !important;
    opacity: 1;
    display: none;
  }
  .auth2-card:not(.is-register) .auth2-pane--login,
  .auth2-card.is-register .auth2-pane--register {
    display: flex;
    animation: auth2-slide-in 0.4s ease;
  }
  @keyframes auth2-slide-in {
    from { opacity: 0; transform: translateX(26px); }
    to   { opacity: 1; transform: translateX(0); }
  }
  .auth2-form-inner { max-width: none; }
}

.auth2-btn[disabled] {
  opacity: 0.6;
  cursor: default;
}
