/**
 * 登录页：全屏青蓝渐变 + 轻量几何纹理，表单绝对居中、无卡片无阴影
 * 记住账号密码：login-portal.js
 */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.page-login {
  position: relative;
  margin: 0;
  min-height: 100vh;
  /* 与渐变尾部接近，避免下拉露出 mobile-minimal 的灰底 */
  background-color: #1e4d96;
  font-family: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
}

@media (max-width: 768px) {
  body.page-login {
    background-color: #1e4d96 !important;
  }
}

/* 背景层：渐变 + 低多边形感纹理 */
.login-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    118deg,
    #7dd4e8 0%,
    #4a9fe3 38%,
    #2d6cbd 72%,
    #1e4d96 100%
  );
  overflow: hidden;
}

.login-atmosphere::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(115deg, rgba(255, 255, 255, 0.07) 24%, transparent 24.5%),
    linear-gradient(245deg, rgba(255, 255, 255, 0.06) 22%, transparent 22.5%);
  background-size: 56px 96px, 64px 110px;
}

.login-atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 55% at 18% 28%, rgba(255, 255, 255, 0.18) 0%, transparent 52%),
    radial-gradient(ellipse 70% 45% at 88% 72%, rgba(0, 40, 90, 0.22) 0%, transparent 48%);
  pointer-events: none;
}

/* 居中内容 */
.login-stack {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  min-height: 100vh;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 40px 28px 48px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

/* 可选 Logo：仅图片本身，无底板 */
.login-stack__logo {
  display: block;
  margin: 0 auto 22px;
  max-height: 52px;
  width: auto;
  max-width: 90%;
  object-fit: contain;
}

.login-stack__welcome {
  margin: 0 0 10px;
  text-align: center;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.95);
}

.login-stack__title {
  margin: 0 0 36px;
  text-align: center;
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
}

.login-stack__form {
  width: 100%;
}

.login-field {
  margin-bottom: 26px;
}

.login-field__label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
}

.login-field__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 0;
  background: transparent;
  padding: 10px 0 12px;
  font-size: 15px;
  color: #ffffff;
}

.login-field__input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.login-field__input:focus {
  outline: none;
  border-bottom-color: #ffffff;
}

.login-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin-top: 10px;
}

.login-remember {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  user-select: none;
}

.login-remember input {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: #ffffff;
}

/* 胶囊登录按钮：与上方输入区同宽 */
.login-btn-pill {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.14) !important;
  border: 1px solid rgba(255, 255, 255, 0.88) !important;
  border-radius: 999px;
  cursor: pointer;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.login-btn-pill:hover {
  background: rgba(255, 255, 255, 0.22) !important;
}

.login-btn-pill:active {
  opacity: 0.92;
}

.login-stack__links {
  margin-top: 36px;
  text-align: center;
}

.login-stack__links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 2px;
}

.login-stack__links a:hover {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.75);
}

.login-stack__copy {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.38);
}

/* 员工登录页无底部「切换入口」链接时，版权区略下移 */
.login-stack--employee-login .login-stack__copy {
  margin-top: 28px;
}

/* ========== 进入页：加载层 + 表单渐入（login-portal.js 移除遮罩并加上 page-login--ready）========== */
.login-boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background: linear-gradient(118deg, #7dd4e8 0%, #4a9fe3 42%, #2d6cbd 78%, #1e4d96 100%);
  transition: opacity 0.48s ease, visibility 0.48s ease;
}

.login-boot-overlay--out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-boot-overlay__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.login-boot-spinner {
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  animation: login-boot-spin 0.7s linear infinite;
}

@keyframes login-boot-spin {
  to {
    transform: rotate(360deg);
  }
}

.login-boot-overlay__text {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.92);
}

body.page-login .login-stack {
  opacity: 0;
  transform: translateY(14px);
}

body.page-login.page-login--ready .login-stack {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.06s,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.06s;
}

@media (prefers-reduced-motion: reduce) {
  .login-boot-spinner {
    animation: none;
    opacity: 0.85;
  }

  .login-boot-overlay {
    transition-duration: 0.16s;
  }

  body.page-login.page-login--ready .login-stack {
    transition-duration: 0.22s;
  }
}

/* 点击「登录」提交表单时：遮罩 + 旋转（整页跳转前保持显示） */
.login-submit-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(15, 45, 95, 0.42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.login-submit-overlay.login-submit-overlay--visible {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.login-submit-overlay__text {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.95);
}

body.page-login.login-submit-active {
  cursor: progress;
}

body.page-login.login-submit-active .login-btn-pill:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

