.auth-page {
  max-width: 400px;
  margin: 0 auto;
  padding: 40px 0;
}
.auth-page__inner {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  position: relative;
}
.auth-page .h1 {
  text-align: center;
  margin-bottom: 10px;
}
.auth-page__desc {
  text-align: center;
  color: #5a536b;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* --- Social buttons --- */

.auth-page__social {
  margin-bottom: 25px;
}

.socserv-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.socserv-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: #f5f3fa;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #100030;
  transition:
    background-color 0.2s,
    transform 0.1s;
}
.socserv-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}
.socserv-btn:hover:not(:disabled) {
  background: #ebe6f7;
}
.socserv-btn:active:not(:disabled) {
  transform: scale(0.98);
}
.socserv-btn__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.socserv-btn__icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

/* --- Divider --- */

.auth-page__divider {
  position: relative;
  text-align: center;
  margin: 25px 0;
}
.auth-page__divider:before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: #eee;
}
.auth-page__divider span {
  position: relative;
  background: #fff;
  padding: 0 15px;
  color: #aaa;
  font-size: 14px;
}

/* --- Forms --- */

.auth-form__field {
  margin-bottom: 0;
}
.auth-form__error {
  color: #e03030;
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  display: none;
}
.auth-form__error:not(:empty) {
  display: block;
}
.auth-form__resend {
  text-align: center;
  margin-top: 15px;
}
.auth-resend-btn {
  border: none;
  border-bottom: 1px solid;
  background: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--theme-color-base, #4c00c9);
  text-decoration: none;
  line-height: 1;
}
.auth-form__resend .h7 {
  margin: 0;
  font-size: 13px;
  color: #5a536b;
  font-weight: 500;
}

/* --- Screens --- */

.auth-page--pending {
  visibility: hidden;
}

.auth-screen {
  width: 100%;
}
.auth-screen--hidden {
  display: none;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes screen-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}
@keyframes screen-in-back {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes screen-out-back {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* --- Back button (inside code screen) --- */

.auth-screen__back {
  margin-top: 20px;
  text-align: center;
}
.auth-screen__back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #5a536b;
  cursor: pointer;
  transition: color 0.15s;
}
.auth-screen__back-btn:hover {
  color: #100030;
}
.auth-step__hint {
  font-size: 13px;
  color: #5a536b;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* --- Identifier input with inline submit --- */

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input-wrap input {
  width: 100%;
  height: 47px;
  padding: 0 52px;
  box-sizing: border-box;
  border: 1.5px solid #e0dcea;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  text-align: center;
  background: #fff;
  color: #100030;
  transition: border-color 0.15s;
  outline: none;
}
.auth-input-wrap input::placeholder {
  color: #aaa5b8;
}
.auth-input-wrap input:focus {
  border-color: var(--theme-color-base, #4c00c9);
}
.auth-input-submit {
  position: absolute;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 7px;
  background: var(--theme-color-base, #4c00c9);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 0.15s,
    transform 0.15s,
    background-color 0.15s;
  pointer-events: none;
}
.auth-input-wrap.has-value .auth-input-submit {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.auth-input-submit:disabled {
  background: #c3a8ee;
  cursor: default;
}
.auth-input-submit:not(:disabled):hover {
  background: var(--theme-color-base-light, #7733e4);
}
.auth-input-submit:not(:disabled):active {
  transform: scale(0.95);
}

.auth-submit-spinner {
  display: none;
}
.auth-input-submit.is-loading .auth-submit-arrow {
  display: none;
}
.auth-input-submit.is-loading .auth-submit-spinner {
  display: block;
  animation: auth-spin 0.7s linear infinite;
}
@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- OTP input --- */

.otp-input {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.otp-input__cell {
  width: 60px;
  height: 60px;
  border: 1.5px solid #e0dcea;
  border-radius: 12px;
  font-size: 24px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  color: #100030;
  background: #fff;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
  caret-color: transparent;
}
.otp-input__cell:focus {
  border-color: var(--theme-color-base, #4c00c9);
  box-shadow: 0 0 0 3px rgba(76, 0, 201, 0.08);
}
.otp-input__cell.filled {
  border-color: var(--theme-color-base, #4c00c9);
  background: #f5f3fa;
}
.otp-input__cell.error {
  border-color: #e03030;
  background: #fff5f5;
  color: #e03030;
}
@keyframes otp-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}
.otp-input.shake .otp-input__cell {
  animation: otp-shake 0.4s ease;
}

/* --- Loading overlay --- */

.auth-page--loading {
  position: relative;
  pointer-events: none;
  user-select: none;
}
.auth-page--loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  z-index: 10;
  cursor: wait;
}

@media (max-width: 767px) {
  .auth-page__inner {
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .auth-page--loading::after {
    border-radius: 0;
  }
}
