:root {
  --auth-label: #7cacf3;
  --auth-input: #8999b7;
  --auth-err: #c36868;
  --auth-field-bg: rgba(35, 56, 103, 0.71);
}
html.is-auth-open,
html.is-auth-open body {
  overflow: hidden !important;
  height: 100%;
  overscroll-behavior: none;
}
html.is-auth-open .envex-shell,
html.is-auth-open .envex-main,
html.is-auth-open .envex-content {
  overflow: hidden !important;
  scrollbar-gutter: auto !important;
}
.auth-root img,
.auth-root svg {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.auth-root {
  position: fixed;
  inset: 0;
  z-index: 400;
  overflow: hidden;
  overscroll-behavior: none;
}
.auth-veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  background: linear-gradient(180deg, rgba(18, 26, 39, 0.92) 9.58%, rgba(15, 69, 139, 0.97) 95.79%);
  pointer-events: none;
}
.auth-stage {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 16px;
  overflow: hidden;
}
.auth-scale {
  width: 609px;
  transform-origin: center center;
}
.auth-pop {
  width: 609px;
  opacity: 0;
}
.auth-flip {
  width: 609px;
  perspective: 1800px;
  transform-style: preserve-3d;
}
.auth-flip-inner {
  position: relative;
  display: grid;
  grid-template-columns: 609px;
  align-items: center;
  width: 609px;
  transform: rotateY(0deg);
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.4, 0.08, 0.22, 1);
}
.auth-root[data-mode="login"] .auth-flip-inner {
  transform: rotateY(180deg);
}
.auth-card {
  grid-area: 1 / 1;
  width: 609px;
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(38.42deg, rgba(9, 18, 39, 0.46) 13.189%, rgb(13, 20, 40) 77.991%);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}
.auth-card--login { transform: rotateY(180deg) translateZ(0); }
.auth-root[data-mode="login"] .auth-card--register,
.auth-root[data-mode="register"] .auth-card--login { pointer-events: none; }
.auth-root[data-mode="login"] .auth-card--login,
.auth-root[data-mode="register"] .auth-card--register { pointer-events: auto; }
.auth-card--single {
  transform: none;
  backface-visibility: visible;
  padding-bottom: 53px;
}
.auth-card--single .auth-form { padding-bottom: 0; }
.auth-card-glow {
  position: absolute;
  inset: 0;
  max-width: none;
  pointer-events: none;
  opacity: 0.55;
  background: url("../img/auth/card-glow.svg") no-repeat center top / 100% 100%;
}
.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: block;
  pointer-events: auto;
}
.auth-close img {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
}
.auth-close span {
  position: absolute;
  inset: 0;
}
.auth-close span::before,
.auth-close span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.38px;
  height: 16.82px;
  margin: -8.41px 0 0 -1.19px;
  border-radius: 74px;
  background: #fff;
}
.auth-close span::before { transform: rotate(45deg); }
.auth-close span::after { transform: rotate(-45deg); }
.auth-form {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 63px 78px 53px;
}
.auth-heading {
  margin: 0 auto;
  width: 409px;
  max-width: 100%;
  min-height: 44px;
  height: auto;
  font-family: "Montserrat Alternates", Montserrat, sans-serif;
  font-size: 40px;
  font-weight: 600;
  line-height: 1.05;
  text-align: center;
  background-image: linear-gradient(92.41deg, #3783f5 3.01%, #5a96f0 19.18%, #fafeff 55.86%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #d7e7ff;
}
.auth-intro {
  margin: 13px 0 0;
  color: var(--auth-label);
  font-size: 15px;
  font-weight: 700;
  line-height: normal;
  text-align: center;
}
.auth-fields {
  display: flex;
  flex-direction: column;
  gap: 33px;
  width: 453px;
  max-width: 100%;
  margin: 54px auto 0;
}
.auth-fields-row {
  display: flex;
  gap: 17px;
  width: 100%;
}
.auth-field { width: 100%; }
.auth-field--half { width: 218px; flex: 1 1 218px; }
.auth-field label {
  display: block;
  margin: 0 0 14px;
  color: var(--auth-label);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}
.auth-field-box { position: relative; }
.auth-field input {
  width: 100%;
  height: 58px;
  border: 2px solid transparent;
  border-radius: 13px;
  padding: 0 44px 0 19px;
  background: var(--auth-field-bg);
  color: var(--auth-input);
  font-size: 15px;
  font-weight: 600;
  outline: none;
}
.auth-field input::placeholder { color: var(--auth-input); opacity: 1; }
.auth-field input:focus {
  border-color: var(--auth-label);
  box-shadow: 0 0 15.1px rgba(46, 126, 244, 0.58);
}
.auth-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--auth-input);
  cursor: pointer;
  display: grid;
  place-items: center;
  pointer-events: auto;
}
.auth-eye:hover { color: #fff; }
.auth-eye svg { pointer-events: none; }
.auth-privacy-link {
  display: block;
  width: 453px;
  max-width: 100%;
  margin: 12px auto 0;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  text-decoration: underline;
  pointer-events: auto;
}
.auth-captcha {
  display: flex;
  justify-content: center;
  width: 453px;
  max-width: 100%;
  margin: 12px auto 0;
  overflow: hidden;
  pointer-events: auto;
}
.auth-captcha .g-recaptcha {
  transform: scale(0.92);
  transform-origin: center top;
}
.auth-msg {
  width: 453px;
  max-width: 100%;
  margin: 12px auto 0;
  min-height: 15px;
  color: var(--auth-err);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
.auth-msg.ok { color: #76f7f8; }
.auth-submit {
  display: block;
  width: 453px;
  max-width: 100%;
  height: 58px;
  margin: 22px auto 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: #000;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}
.auth-submit:hover { filter: brightness(0.94); }
.auth-switch {
  margin: 16px 0 0;
  text-align: center;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.auth-switch a {
  color: var(--auth-label);
  font-weight: 700;
  text-decoration: none;
  pointer-events: auto;
}
.auth-switch a:hover { text-decoration: underline; }
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 453px;
  max-width: 100%;
  margin: 24px auto 0;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 2px;
  border-radius: 46px;
  background: rgba(255, 255, 255, 0.15);
}
.auth-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  width: 364px;
  max-width: 100%;
  margin: 30px auto 0;
  flex-shrink: 0;
}
.auth-social a,
.auth-social button {
  display: block;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.75;
  cursor: pointer;
  pointer-events: auto;
}
.auth-social a:hover,
.auth-social button:hover { opacity: 1; }
.auth-social-vk {
  width: 60px;
  height: 38px;
  background-image: url("../img/auth/oauth-vk.svg");
}
.auth-social-tg {
  width: 45px;
  height: 46px;
  background-image: url("../img/auth/oauth-telegram.svg");
}
.auth-social-g {
  width: 45px;
  height: 45px;
  background-image: url("../img/auth/oauth-google.svg");
}
.auth-social-st {
  width: 42px;
  height: 43px;
  background-image: url("../img/auth/oauth-steam.svg");
}
.auth-social-fb {
  width: 44px;
  height: 43px;
  background-image: url("../img/auth/oauth-facebook.svg");
}
.auth-forgot {
  width: 453px;
  max-width: 100%;
  margin: 12px auto 0;
  text-align: center;
  font-size: 13px;
}
.auth-forgot a {
  color: rgba(255, 255, 255, 0.7);
  pointer-events: auto;
}
.auth-forgot a:hover { color: #fff; }
.auth-privacy-link[hidden],
.auth-captcha[hidden],
.auth-forgot[hidden],
.auth-fields[hidden],
.auth-submit[hidden],
.hidden { display: none !important; }
.auth-confirm {
  max-width: 480px;
  margin: 48px auto;
  padding: 24px;
  text-align: center;
}
.auth-confirm.is-ok { color: #86efac; }
.auth-confirm.is-err { color: #fca5a5; }
.auth-copyright {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  z-index: 5;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  pointer-events: auto;
}
.auth-copyright a {
  color: #76f7f8;
  text-decoration: none;
  font-weight: 700;
}
.auth-copyright a:hover { text-decoration: underline; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.auth-root::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  background-image:
    url("../img/auth/oauth-vk.svg"),
    url("../img/auth/oauth-telegram.svg"),
    url("../img/auth/oauth-google.svg"),
    url("../img/auth/oauth-steam.svg"),
    url("../img/auth/oauth-facebook.svg"),
    url("../img/auth/card-glow.svg");
}

@keyframes auth-veil-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes auth-pop-in {
  from { opacity: 0; translate: 0 36px; }
  to { opacity: 1; translate: 0 0; }
}
html.boot-ready .auth-veil {
  animation: auth-veil-in 0.55s ease both;
}
html.boot-ready .auth-pop {
  animation: auth-pop-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

@media (max-width: 700px) {
  .auth-stage {
    align-items: flex-start;
    padding: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .auth-scale,
  .auth-pop,
  .auth-flip,
  .auth-flip-inner,
  .auth-card {
    width: 100%;
  }
  .auth-flip-inner { grid-template-columns: minmax(0, 1fr); }
  .auth-card { border-radius: 24px; }
  .auth-form { padding: 44px 18px 28px; }
  .auth-card--single { padding-bottom: 28px; }
  .auth-heading { width: auto; min-height: 0; font-size: 28px; }
  .auth-intro { margin-top: 10px; font-size: 14px; }
  .auth-fields { gap: 20px; margin-top: 26px; }
  .auth-fields-row { flex-direction: column; gap: 20px; }
  .auth-field--half { width: 100%; flex: 1 1 auto; }
  .auth-field label { margin-bottom: 8px; }
  .auth-field input { height: 52px; font-size: 16px; }
  .auth-captcha .g-recaptcha { transform: scale(0.82); }
  .auth-submit { height: 52px; margin-top: 18px; }
  .auth-or { margin-top: 20px; }
  .auth-social { gap: 16px; margin-top: 22px; }
  .auth-close { top: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-veil,
  .auth-pop,
  html.boot-ready .auth-veil,
  html.boot-ready .auth-pop,
  .auth-flip-inner {
    animation: none;
    transition: none;
  }
  .auth-veil,
  .auth-pop { opacity: 1; }
}

.auth-root {
  scrollbar-width: thin;
  scrollbar-color: #4a8aee rgba(16, 27, 48, 0.63);
}
.auth-root::-webkit-scrollbar { width: 4px; height: 4px; }
.auth-root::-webkit-scrollbar-track { background: rgba(16, 27, 48, 0.63); }
.auth-root::-webkit-scrollbar-thumb {
  background: #4a8aee;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(74, 138, 238, 0.55);
}
