.login-modal,
.captcha-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 34, 63, 0.58);
  box-sizing: border-box;
}

.captcha-modal {
  z-index: 10030;
}

.login-modal button,
.captcha-modal button {
  position: static;
  top: auto;
  right: auto;
  width: auto;
  margin: 0;
  border-radius: 0;
  background: transparent;
}

.login-modal-content,
.captcha-modal-content {
  position: relative;
  width: min(420px, 100%);
  padding: 36px 40px 40px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 39, 84, 0.24);
  box-sizing: border-box;
}

.login-modal-content h2,
.captcha-modal-content h2 {
  margin: 0 0 28px;
  color: #1e293b;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
}

.login-modal .login-modal-close,
.captcha-modal .captcha-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 28px;
  line-height: 32px;
  cursor: pointer;
}

.login-modal .login-modal-close:hover,
.captcha-modal .captcha-modal-close:hover {
  color: #006ce9;
}

.login-modal--access-gate .login-modal-close {
  display: none;
}

#loginForm,
#captchaForm {
  margin: 0;
}

.login-form-row {
  display: block;
  margin-bottom: 20px;
  color: #334155;
  font-size: 15px;
}

.login-form-row > span {
  display: block;
  margin-bottom: 8px;
}

#loginForm input,
#captchaForm input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #d7e2ef;
  border-radius: 6px;
  outline: none;
  color: #1e293b;
  font-size: 15px;
  box-sizing: border-box;
}

#loginForm input:focus,
#captchaForm input:focus {
  border-color: #006ce9;
  box-shadow: 0 0 0 3px rgba(0, 108, 233, 0.1);
}

.login-form-code-line,
.captcha-form-line {
  display: flex;
  gap: 10px;
}

#getVerificationCode {
  flex: 0 0 118px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #006ce9;
  border-radius: 6px;
  background: #fff;
  color: #006ce9;
  font-size: 14px;
  cursor: pointer;
}

#getVerificationCode:disabled {
  border-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
}

#submit-login,
#submit-captchaForm {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 6px;
  background: #006ce9;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

#submit-login:hover,
#submit-captchaForm:hover {
  background: #005ecb;
}

#submit-login:disabled,
#submit-captchaForm:disabled {
  background: #93bde9;
  cursor: not-allowed;
}

.login-modal-access-hint {
  display: none;
  margin: -4px 0 18px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.captcha-form-line {
  align-items: center;
  margin-bottom: 22px;
}

#captchaImage {
  flex: 0 0 116px;
  width: 116px;
  height: 46px;
  border: 1px solid #d7e2ef;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  box-sizing: border-box;
}

.message-container {
  position: fixed;
  top: 32px;
  left: 50%;
  z-index: 10050;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 260px;
  max-width: calc(100vw - 40px);
  padding: 13px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
  transform: translateX(-50%);
  box-sizing: border-box;
}

.message-container.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.message-container.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.message-text {
  flex: 1;
  font-size: 14px;
}

.message-close {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: currentColor;
  font-size: 20px;
  cursor: pointer;
}

@media screen and (max-width: 639px) {
  .login-modal-content,
  .captcha-modal-content {
    padding: 32px 22px 28px;
  }

  .login-form-code-line,
  .captcha-form-line {
    gap: 8px;
  }

  #getVerificationCode,
  #captchaImage {
    flex-basis: 105px;
    width: 105px;
  }
}
