/* CRM 登录页 — 品牌优先、浅色氛围、表单为唯一交互区 */
:root {
  --crm-login-ink: #0c2a2e;
  --crm-login-muted: #5b6f74;
  --crm-login-line: #d5e0e3;
  --crm-login-panel: #fbfcfc;
  --crm-login-accent: #0f766e;
  --crm-login-accent-deep: #0a5c56;
  --crm-login-glow: rgba(15, 118, 110, 0.18);
  --crm-login-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html,
body.crm-login-body {
  height: 100%;
  margin: 0;
}

body.crm-login-body {
  font-family: var(--crm-login-font);
  color: var(--crm-login-ink);
  background: #e8f1f0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.crm-login {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  position: relative;
}

/* 左侧氛围面：全出血视觉锚点（静态渐变，避免持续滤镜动画卡顿） */
.crm-login__visual {
  position: relative;
  min-height: 100vh;
  padding: clamp(32px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(255, 255, 255, 0.55), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 75%, rgba(15, 118, 110, 0.22), transparent 50%),
    linear-gradient(145deg, #c5ddd8 0%, #a8cfc8 38%, #7eb5ad 72%, #5a9a92 100%);
}

.crm-login__visual::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  background:
    radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.35) 0 12%, transparent 13%),
    radial-gradient(circle at 70% 60%, rgba(12, 42, 46, 0.08) 0 18%, transparent 19%);
  opacity: 0.9;
  pointer-events: none;
}

.crm-login__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(12, 42, 46, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 42, 46, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 85%);
  pointer-events: none;
}

.crm-login__brand-block {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.crm-login__brand {
  margin: 0;
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--crm-login-ink);
  text-wrap: balance;
}

.crm-login__tagline {
  margin: 18px 0 0;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--crm-login-muted);
  max-width: 28em;
}

.crm-login__visual-foot {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  color: rgba(12, 42, 46, 0.55);
}

/* 右侧表单交互区 */
.crm-login__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px) clamp(24px, 4vw, 64px);
  background: var(--crm-login-panel);
  box-shadow: -24px 0 60px rgba(12, 42, 46, 0.06);
}

.crm-login__panel-inner {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.crm-login__panel-title {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--crm-login-ink);
}

.crm-login__panel-desc {
  margin: 0 0 28px;
  font-size: 0.95rem;
  color: var(--crm-login-muted);
}

.crm-login__form {
  margin: 0;
}

.crm-login__field {
  position: relative;
  margin-bottom: 18px;
}

.crm-login__icon {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7a9096;
  pointer-events: none;
}

.crm-login__field input {
  width: 100%;
  height: 48px;
  padding: 0 42px;
  border-radius: 12px;
  border: 1px solid var(--crm-login-line);
  background: #f4f8f8;
  font-size: 15px;
  font-family: inherit;
  color: var(--crm-login-ink);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.crm-login__field input:hover {
  border-color: #b7cbcf;
}

.crm-login__field input:focus {
  background: #fff;
  border-color: var(--crm-login-accent);
  box-shadow: 0 0 0 4px var(--crm-login-glow);
}

.crm-login__eye {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 42px;
  border: 0;
  background: transparent;
  color: #7a9096;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.crm-login__eye:hover {
  color: var(--crm-login-accent);
}

.crm-login__submit {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--crm-login-accent);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.crm-login__submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(15, 118, 110, 0.34);
}

.crm-login__submit:active {
  transform: translateY(0);
}

.crm-login-code {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.crm-login-code__input {
  flex: 1;
  min-width: 0;
}

.crm-login-code__img {
  flex: 0 0 136px;
  width: 136px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--crm-login-line);
  cursor: pointer;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.crm-login-code__img:hover {
  opacity: 0.9;
  border-color: var(--crm-login-accent);
}

.crm-login__panel-foot {
  margin-top: 28px;
  font-size: 0.8rem;
  color: #8a9ea3;
  text-align: center;
}

.crm-login-toast[hidden],
.crm-login-mask[hidden],
.crm-login-alert[hidden] {
  display: none !important;
}

.crm-login-toast {
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  z-index: 40;
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(12, 42, 46, 0.88);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(12, 42, 46, 0.22);
}

.crm-login-toast.is-ok {
  background: rgba(15, 118, 110, 0.94);
}

.crm-login-mask {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(12, 42, 46, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.crm-login-mask__box {
  min-width: 140px;
  padding: 16px 22px;
  border-radius: 12px;
  background: #fff;
  color: var(--crm-login-ink);
  font-size: 15px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(12, 42, 46, 0.16);
}

.crm-login-alert {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(12, 42, 46, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.crm-login-alert__box {
  width: min(360px, 100%);
  padding: 22px 20px 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(12, 42, 46, 0.18);
}

.crm-login-alert__box p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--crm-login-ink);
}

.crm-login-alert__box button {
  display: block;
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--crm-login-accent);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}

@media screen and (max-width: 900px) {
  .crm-login {
    grid-template-columns: 1fr;
  }

  .crm-login__visual {
    min-height: auto;
    padding: 36px 24px 28px;
  }

  .crm-login__brand {
    font-size: clamp(1.9rem, 8vw, 2.4rem);
  }

  .crm-login__tagline {
    margin-top: 12px;
    font-size: 0.95rem;
  }

  .crm-login__visual-foot {
    display: none;
  }

  .crm-login__panel {
    box-shadow: none;
    padding-top: 24px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .crm-login__panel-inner {
    max-width: 420px;
  }
}
