:root {
  --login-brand: linear-gradient(90deg, #2c74ff 0%, #1a54e4 100%);
  --login-brand-solid: #1f66f2;
  --login-shadow: 0 18px 42px rgba(30, 87, 224, 0.08), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 24px;
  background: #ffffff;
}

.login-page-dialog {
  position: relative;
  width: min(720px, calc(100vw - 48px));
  height: 532px;
}

.login-page-dialog .login-card {
  width: 100%;
  min-height: 760px;
  transform: scale(0.7);
  transform-origin: center top;
}

.auth-window-mask {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 16, 28, 0.34);
  z-index: 120;
}

.auth-window-mask[hidden] {
  display: none !important;
}

.auth-window-dialog {
  position: relative;
  width: min(720px, calc(100vw - 48px));
}

.auth-window-mask .login-card {
  width: 100%;
  min-height: 760px;
  transform: scale(0.7);
  transform-origin: center top;
}

.auth-window-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: 1px solid #d8e0ec;
  border-radius: 999px;
  background: #fff;
  color: #526074;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(18, 32, 51, 0.08);
}

.auth-window-close svg {
  width: 18px;
  height: 18px;
}

.login-card {
  width: min(720px, calc(100vw - 96px));
  min-height: 760px;
  padding: 38px 42px 28px;
  border: 1px solid #e7edf6;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--login-shadow);
}

.login-brand {
  font-size: 50px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
  color: transparent;
  background: var(--login-brand);
  -webkit-background-clip: text;
  background-clip: text;
}

.login-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  margin-top: 28px;
  padding: 0 10px 16px;
}

.login-tab {
  border: 0;
  background: transparent;
  color: #7a8699;
  font-size: 24px;
  line-height: 1;
  font-weight: 500;
  padding: 0 0 4px;
  cursor: pointer;
}

.login-tab.is-active {
  color: var(--login-brand-solid);
}

.login-tab:first-child,
.login-tab:last-child {
  justify-self: center;
}

.login-tab-line,
.login-tab-indicator {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
}

.login-tab-line {
  background: #e2e8f2;
}

.login-tab-indicator {
  width: 128px;
  left: calc(25% - 64px);
  right: auto;
  background: var(--login-brand-solid);
  transition: left 180ms ease;
}

.login-card[data-mode="password"] .login-tab-indicator {
  left: calc(75% - 64px);
}

.login-card[data-mode="reset"] .login-tabs,
.login-card[data-mode="reset"] .policy-check {
  display: none;
}

.login-panel {
  display: none;
  margin-top: 22px;
}

.login-panel.is-active {
  display: block;
}

.login-panel--reset {
  margin-top: 18px;
}

.auth-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: #5f6b7d;
  font-size: 16px;
  line-height: 1.3;
}

.auth-status.is-visible[data-tone="info"] {
  color: #1760ef;
}

.auth-status.is-visible[data-tone="success"] {
  color: #0f9b58;
}

.auth-status.is-visible[data-tone="danger"] {
  color: #d92d20;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h1,
.section-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 500;
  color: #18222f;
}

.section-head--password {
  margin-top: 22px;
}

.section-icon {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  color: #2163ef;
  flex: 0 0 auto;
}

.section-icon svg,
.eye-btn svg {
  width: 100%;
  height: 100%;
}

.login-channel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px;
  border: 1px solid #d8e0ec;
  border-radius: 12px;
  background: #f7faff;
}

.login-channel-tab {
  height: 52px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #657184;
  font-size: 22px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.login-channel-tab svg {
  width: 28px;
  height: 28px;
}

.login-channel-tab.is-active {
  background: #fff;
  color: #1760ef;
  box-shadow: 0 8px 18px rgba(31, 99, 240, 0.12);
}

.login-channel-tab:disabled,
.login-channel-tab.is-disabled {
  background: #eef2f6;
  color: #a1abba;
  cursor: not-allowed;
  box-shadow: none;
}

.login-channel-tab-note {
  color: #98a4b3;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.login-field {
  display: block;
}

.login-field input {
  width: 100%;
  height: 64px;
  border: 1px solid #d8e0ec;
  border-radius: 12px;
  background: #fff;
  color: #18222f;
  padding: 0 18px;
  font-size: 19px;
  line-height: 1;
  outline: none;
  box-shadow: none;
}

.login-field input::placeholder {
  color: #a1abba;
}

.login-field input:focus {
  border-color: rgba(33, 99, 239, 0.48);
  box-shadow: 0 0 0 4px rgba(33, 99, 239, 0.08);
}

.login-card .field-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: #d92d20;
  font-size: 16px;
  line-height: 1.2;
}

.login-card .field-error.is-visible {
  min-height: 18px;
}

.sms-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 14px;
  margin-top: 16px;
}

.sms-row--reset {
  margin-top: 14px;
}

.login-field--code input {
  padding-right: 18px;
}

.code-btn {
  height: 64px;
  border: 1px solid #d8e0ec;
  border-radius: 12px;
  background: #fff;
  color: #1760ef;
  font-size: 17px;
  line-height: 1;
  font-weight: 500;
  cursor: pointer;
}

.submit-btn {
  width: 100%;
  height: 62px;
  margin-top: 22px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #2f76ff 0%, #1f63f0 100%);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: 0 12px 30px rgba(31, 99, 240, 0.24);
  cursor: pointer;
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  color: #9aa5b6;
  font-size: 18px;
}

.divider span {
  flex: 1;
  height: 1px;
  background: #d8e0ec;
}

.divider em {
  font-style: normal;
  white-space: nowrap;
}

.bottom-links,
.password-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  gap: 14px;
}

.text-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #1760ef;
  font-size: 18px;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
}

.password-row {
  margin-top: 12px;
  justify-content: flex-end;
}

.login-field--password {
  position: relative;
}

.login-field--password input {
  padding-right: 56px;
}

.login-card .login-field--password .field-error {
  margin-right: 64px;
}

.eye-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #8691a5;
  padding: 0;
  cursor: pointer;
}

.eye-icon--close {
  display: none;
}

.login-card.is-password .eye-icon--open {
  display: none;
}

.login-card.is-password .eye-icon--close {
  display: block;
}

.login-tip {
  margin: 14px 0 0;
  color: #5f6b7d;
  font-size: 18px;
  line-height: 1.5;
}

.reset-lead {
  margin: 2px 0 0;
  color: #5f6b7d;
  font-size: 18px;
  line-height: 1.5;
}

.reset-flow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.reset-flow-step {
  color: #8a96a8;
  font-size: 16px;
  line-height: 1;
  font-weight: 500;
}

.reset-flow-step.is-active {
  color: #1f63f0;
}

.reset-flow-line {
  flex: 1;
  height: 1px;
  background: #d8e0ec;
}

.reset-stage {
  margin-top: 18px;
}

.reset-stage.is-active {
  display: block;
}

.reset-stage:not(.is-active) {
  display: none;
}

.reset-phone-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  color: #5f6b7d;
  font-size: 16px;
  line-height: 1.4;
}

.reset-phone-summary strong {
  color: #1f63f0;
  font-size: 16px;
  font-weight: 600;
}

.policy-check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px 14px 48px;
  border: 1px solid #d8e0ec;
  border-radius: 14px;
  background: #f8fbff;
}

.policy-check input {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: 0;
  opacity: 0;
  transform: translateY(-50%);
  z-index: 2;
}

.policy-check-box {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 2px solid #9fb4dc;
  border-radius: 6px;
  background: #fff;
  display: grid;
  place-items: center;
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.policy-check input:checked + .policy-check-box {
  border-color: #1f63f0;
  background: linear-gradient(180deg, #2f76ff 0%, #1f63f0 100%);
}

.policy-check input:checked + .policy-check-box::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.policy-note {
  color: #18222f;
  font-size: 18px;
  line-height: 1.5;
}

.policy-note a {
  color: #1f63f0;
  font-weight: 700;
  text-decoration: none;
}

.policy-note a:hover {
  color: #164ec9;
  text-decoration: underline;
}

.policy-check.is-flash {
  animation: policyFlash 1s ease-in-out 0s 2;
  border-color: #1f63f0;
  box-shadow: 0 0 0 4px rgba(31, 99, 240, 0.18);
}

@keyframes policyFlash {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(31, 99, 240, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(31, 99, 240, 0.22);
  }
}

.login-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

@media (max-width: 980px) {
  .login-page {
    padding: 18px;
  }

  .login-card {
    width: 100%;
    min-height: auto;
    padding: 28px 18px 20px;
    border-radius: 22px;
  }

  .login-page-dialog {
    width: 100%;
    height: auto;
  }

  .login-page-dialog .login-card {
    transform: none;
    min-height: auto;
  }

  .login-brand {
    font-size: 34px;
  }

  .login-tabs {
    margin-top: 20px;
    padding: 0 2px 12px;
  }

  .login-tab {
    font-size: 15px;
  }

  .login-tab-line,
  .login-tab-indicator {
    left: 2px;
    right: 2px;
  }

  .login-tab-indicator {
    width: 96px;
    left: calc(25% - 48px);
  }

  .login-card[data-mode="password"] .login-tab-indicator {
    left: calc(75% - 48px);
  }

  .login-panel--reset {
    margin-top: 14px;
  }

  .login-panel {
    margin-top: 16px;
  }

  .auth-status {
    margin-top: 10px;
    font-size: 13px;
  }

  .section-head h1,
  .section-head h2 {
    font-size: 18px;
  }

  .login-channel-tabs {
    margin-bottom: 12px;
    padding: 5px;
  }

  .login-channel-tab {
    height: 44px;
    font-size: 16px;
    gap: 8px;
  }

  .login-channel-tab svg {
    width: 22px;
    height: 22px;
  }

  .login-channel-tab-note {
    font-size: 11px;
  }

  .reset-lead {
    font-size: 13px;
  }

  .reset-flow {
    margin-top: 14px;
    gap: 8px;
  }

  .reset-flow-step {
    font-size: 12px;
  }

  .reset-stage {
    margin-top: 14px;
  }

  .reset-phone-summary {
    margin-bottom: 12px;
    font-size: 13px;
  }

  .reset-phone-summary strong {
    font-size: 13px;
  }

  .login-field input,
  .code-btn {
    height: 54px;
    font-size: 16px;
    border-radius: 12px;
    padding-left: 16px;
  }

  .login-card .field-error {
    font-size: 14px;
    margin-top: 6px;
  }

  .sms-row {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 10px;
    margin-top: 12px;
  }

  .sms-row--reset {
    margin-top: 12px;
  }

  .section-head--password {
    margin-top: 16px;
  }

  .submit-btn {
    height: 56px;
    margin-top: 16px;
    font-size: 18px;
    border-radius: 12px;
  }

  .divider {
    margin-top: 16px;
    font-size: 12px;
  }

  .bottom-links,
  .password-row {
    margin-top: 14px;
  }

  .text-link {
    font-size: 12px;
  }

  .login-tip {
    margin-top: 12px;
    font-size: 12px;
  }

  .policy-check {
    margin-top: 14px;
    padding: 12px 14px;
  }

  .policy-note {
    font-size: 12px;
  }

  .auth-window-mask {
    padding: 12px;
  }

  .auth-window-mask .login-card {
    transform: none;
    min-height: auto;
  }

  .auth-window-dialog {
    width: 100%;
  }
}
