/* ========================================
   智能水样采集管理系统 · 登录页样式
   ======================================== */

:root {
  --primary: #0070cc;
  --primary-hover: #005fae;
  --primary-active: #004e90;
  --text-main: #1a1f2e;
  --text-sub: #5a6472;
  --text-muted: #8a93a0;
  --border: #e2e6ec;
  --input-bg: #f7f9fc;
  --card-bg: rgba(255, 255, 255, 0.88);
  --error: #d93025;
  --status-ok: #22c55e;
  --shadow-card: 0 12px 40px rgba(15, 40, 80, 0.18);
  --radius-card: 14px;
  --radius-input: 10px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- 页面容器 ---------- */
.login-page {
  position: relative;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 40px 20px 72px;
}

/* ---------- 背景 ---------- */
.login-bg {
  position: absolute;
  inset: 0;
  /* 100% 100%：宽高都铺满屏幕，不裁切、不留白 */
  background: url("../assets/loginBack.jpg") center / 100% 100% no-repeat;
  z-index: 0;
}

.login-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(230, 240, 250, 0.45) 0%,
    rgba(200, 220, 240, 0.32) 40%,
    rgba(180, 205, 230, 0.38) 100%
  );
  /* 不加 blur，避免背景发糊 */
}

/* ---------- 主内容 ---------- */
.login-main {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- 品牌区 ---------- */
.brand {
  text-align: center;
  margin-bottom: 28px;
}

.brand-logo {
  display: inline-flex;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(0, 112, 204, 0.35));
}

.brand-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-subtitle {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-sub);
  letter-spacing: 0.12em;
  font-weight: 400;
}

/* ---------- 登录卡片 ---------- */
.login-card {
  width: 100%;
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 36px 32px 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-input.has-suffix {
  padding-right: 44px;
}

.form-input::placeholder {
  color: #a8b0bc;
}

.form-input:hover {
  border-color: #c5ced9;
}

.form-input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 112, 204, 0.15);
}

.form-input:focus + .input-suffix,
.input-wrap:focus-within .input-icon {
  color: var(--primary);
}

.input-suffix {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

/* 默认只显示“睁眼”，隐藏“斜杠眼” */
.input-suffix .icon-eye-off {
  display: none;
}

.input-suffix.is-visible .icon-eye {
  display: none;
}

.input-suffix.is-visible .icon-eye-off {
  display: block;
}

.input-suffix:hover {
  color: var(--primary);
  background: rgba(0, 112, 204, 0.08);
}

.form-error {
  margin-top: -8px;
  font-size: 13px;
  color: var(--error);
  line-height: 1.4;
}

/* ---------- 登录按钮 ---------- */
.login-btn {
  margin-top: 4px;
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-input);
  cursor: pointer;
  letter-spacing: 0.06em;
  box-shadow: 0 6px 16px rgba(0, 112, 204, 0.35);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.login-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 8px 20px rgba(0, 112, 204, 0.4);
}

.login-btn:active:not(:disabled) {
  background: var(--primary-active);
  transform: translateY(1px);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-btn-arrow {
  font-size: 18px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.login-btn:hover:not(:disabled) .login-btn-arrow {
  transform: translateX(3px);
}

.login-btn.is-loading .login-btn-arrow {
  display: none;
}

.login-btn.is-loading::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---------- 页脚 ---------- */
.login-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px 28px 20px;
  font-size: 12px;
  color: var(--text-sub);
  pointer-events: none;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-sub);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-ok);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
  flex-shrink: 0;
}

.footer-version {
  color: var(--text-muted);
  margin-left: 4px;
}

.footer-right {
  text-align: right;
  line-height: 1.6;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.footer-deco {
  position: absolute;
  right: 40px;
  bottom: 10px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(0, 112, 204, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.footer-deco::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(0, 112, 204, 0.1);
  border-radius: 50%;
}

.footer-deco::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border: 1px solid rgba(0, 112, 204, 0.2);
  border-radius: 50%;
}

/* ---------- 响应式 ---------- */
@media (max-width: 560px) {
  .login-page {
    padding: 28px 16px 100px;
    justify-content: flex-start;
    padding-top: 48px;
  }

  .brand-title {
    font-size: 26px;
  }

  .brand-subtitle {
    font-size: 13px;
    letter-spacing: 0.06em;
  }

  .login-card {
    padding: 28px 20px 24px;
  }

  .login-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px 16px;
  }

  .footer-right {
    text-align: left;
  }

  .footer-deco {
    display: none;
  }
}
