/* 职途智航 · 登录页 */

:root {
  --color-primary: #1b4eff;
  --color-theme: #1677ff;
  --text-primary: #303133;
  --text-secondary: #606266;
  --text-muted: #909399;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --leading-sm: 1.375rem;
  --duration: 180ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: "Source Han Sans SC", "Source Han Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 无 site.css 时的兜底（正常线上会由 site.css 提供全局 reset） */
.login-page,
.login-page *,
.login-page *::before,
.login-page *::after {
  box-sizing: border-box;
}

.login-page {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  background: #f4f8fc;
  overflow-x: hidden;
}

.login-session-banner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(27, 78, 255, 0.18);
  background: rgba(27, 78, 255, 0.06);
}

.login-session-banner__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #1d2129;
}

.login-session-banner__btn {
  align-self: flex-start;
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #1b4eff 0%, #1677ff 100%);
  cursor: pointer;
}

.login-session-banner__btn:hover {
  filter: brightness(1.05);
}

.login-page__sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: #eef4fa;
}

.login-page__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 38% center;
  transform: translateZ(0);
}

/* —— 顶栏 —— */
.login-header {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 20px clamp(1.25rem, 4vw, 3rem);
}

.login-header__brand {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
}

.login-header__logo {
  display: block;
  width: 44px;
  height: auto;
}

.login-header__name {
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* —— 主体 —— */
.login-body {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1.5rem, 4vw, 3rem);
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 2rem;
  box-sizing: border-box;
}

/* —— 右侧登录面板 —— */
.login-aside {
  flex: 0 0 auto;
  width: 100%;
  max-width: 520px;
  margin-left: auto;
}

.login-panel {
  display: flex;
  flex-direction: column;
}

.login-panel__card {
  position: relative;
  overflow: hidden;
  padding: 0 2.5rem 2rem;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 1px 2px rgba(32, 56, 100, 0.04),
    0 24px 56px rgba(27, 78, 255, 0.12),
    0 4px 16px rgba(32, 56, 100, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.login-panel__top {
  position: relative;
  height: 84px;
  margin: 0 -2.5rem 0;
  background: linear-gradient(180deg, rgba(240, 247, 255, 0.85) 0%, rgba(255, 255, 255, 0.35) 100%);
  border-bottom: 1px solid rgba(241, 245, 249, 0.9);
}

.login-panel__top-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  width: 200px;
  height: 100px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(22, 119, 255, 0.2), transparent 70%);
  pointer-events: none;
}

.login-panel__brand {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin-top: -40px;
  margin-bottom: 10px;
}

.login-panel__brand img {
  display: block;
  width: 64px;
  height: 64px;
  padding: 7px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #e8eef5;
  box-shadow: 0 8px 24px rgba(27, 78, 255, 0.12);
}

.login-panel__head {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-panel__title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text-primary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.375rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-field__row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.login-field__label {
  font-size: var(--text-md);
  line-height: var(--leading-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.login-field__box {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  min-height: 56px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
  transition:
    border-color var(--duration) var(--ease-out),
    background-color var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out);
}

.login-field__box:focus-within {
  border-color: var(--color-theme);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.login-field__box:has(.is-invalid) {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

.login-field__prefix {
  flex-shrink: 0;
  padding-left: 16px;
  font-size: var(--text-md);
  font-weight: 500;
  color: #64748b;
  border-right: 1px solid #e2e8f0;
  padding-right: 12px;
  margin-right: 4px;
}

.login-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: none;
  border-radius: 16px;
  font-size: var(--text-md);
  line-height: var(--leading-sm);
  color: var(--text-primary);
  background: transparent;
}

.login-input::placeholder {
  color: #94a3b8;
}

.login-input:focus {
  outline: none;
}

.login-input--pwd {
  padding-right: 44px;
}

.login-field__toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--text-muted);
}

.login-field__toggle:hover {
  color: var(--color-theme);
  background: rgba(22, 119, 255, 0.06);
}

.login-field__eye[hidden] {
  display: none !important;
}

.login-check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.login-check__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.login-check__box {
  width: 16px;
  height: 16px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  background: #fff;
}

.login-check__input:checked + .login-check__box {
  border-color: var(--color-theme);
  background: var(--color-theme)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M6.2 11.2 3.4 8.4l1.1-1.1 1.7 1.7 4.3-4.3 1.1 1.1z'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}

.login-check__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.login-link {
  color: var(--color-theme);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-sm);
}

.login-link:hover {
  text-decoration: underline;
}

.login-form__error {
  margin: 0;
  font-size: var(--text-sm);
  color: #ef4444;
}

.login-form__error[hidden] {
  display: none !important;
}

.login-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  margin-top: 6px;
  border-radius: 16px;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #4096ff 0%, var(--color-theme) 100%);
  box-shadow: 0 10px 28px rgba(22, 119, 255, 0.35);
  transition:
    transform var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out),
    filter var(--duration) var(--ease-out);
}

.login-submit:hover:not(:disabled) {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(22, 119, 255, 0.4);
}

.login-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.login-submit__loading {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin 0.7s linear infinite;
}

.login-submit__loading[hidden] {
  display: none !important;
}

.login-submit.is-loading .login-submit__text {
  visibility: hidden;
  position: absolute;
}

.login-submit.is-loading .login-submit__loading {
  display: block !important;
}

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

.login-panel__demo {
  margin: 0.75rem 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: var(--text-xs);
  line-height: 1.5;
  text-align: center;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
}

.login-panel__legal {
  margin: 1rem 0 0;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
  color: var(--text-muted);
}

.login-panel__legal .login-link {
  font-size: inherit;
  font-weight: 500;
}

/* —— 页脚 —— */
.login-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem) 2rem;
}

.login-footer__copy {
  margin: 0;
  font-size: var(--text-xs);
  color: #94a3b8;
  text-align: center;
}

@media (max-width: 900px) {
  .login-page__sky {
    background-position: center 30%;
  }

  .login-body {
    justify-content: center;
    padding-top: 0.5rem;
  }

  .login-aside {
    flex: 1 1 auto;
    max-width: none;
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .login-panel__card {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .login-panel__top {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }

  .login-header__name {
    font-size: 1.125rem;
  }
}
