/* ================================================================
   login.css  –  NewPay 登录页（CareerCompass 角色动画 · 丝滑版）
   主题通过 body.theme-admin / body.theme-merchant 切换
================================================================ */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
  height: 100vh;
}

/* ── 主题变量 ── */
body.theme-admin {
  --primary: #5B21B6;
  --primary-hover: #4C1D95;
  --btn-bg: #1a1a2e;
  --btn-hover-bg: #5B21B6;
}
body.theme-merchant {
  --primary: #059669;
  --primary-hover: #047857;
  --btn-bg: #064e3b;
  --btn-hover-bg: #059669;
}

.login-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
}

/* ================================================================
   LEFT — 角色动画面板
================================================================ */
.left-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, #d4d0dc 0%, #c8c4d0 50%, #bbb7c5 100%);
  padding: 40px 48px;
  overflow: hidden;
}

.left-panel::after {
  content: '';
  position: absolute;
  top: 20%; right: 15%;
  width: 260px; height: 260px;
  background: rgba(180,170,200,.25);
  border-radius: 50%;
  filter: blur(80px);
}
.left-panel::before {
  content: '';
  position: absolute;
  bottom: 15%; left: 10%;
  width: 350px; height: 350px;
  background: rgba(200,195,210,.2);
  border-radius: 50%;
  filter: blur(100px);
}

.left-panel .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  z-index: 10;
  position: relative;
}
.left-panel .logo .logo-icon {
  width: 28px; height: 28px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff;
}

.characters-wrapper {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 420px;
}
.characters-scene {
  position: relative;
  width: 480px;
  height: 360px;
}

.left-panel .footer-links {
  display: flex;
  gap: 28px;
  font-size: 13px;
  color: rgba(80,70,90,.7);
  z-index: 10;
  position: relative;
}
.left-panel .footer-links span { color: inherit; }


/* ── 角色 ──
   默认用极快的 transition 响应鼠标跟踪
   状态切换时 JS 添加 .cinematic 类激活慢过渡
──────────────────────────────────────────── */
.character {
  position: absolute;
  bottom: 0;
  transform-origin: bottom center;
  will-change: transform, height;
  transition:
    transform .10s ease-out,
    height .10s ease-out;
}

.char-purple {
  left: 60px;
  width: 170px; height: 370px;
  background: #6C3FF5;
  border-radius: 10px 10px 0 0;
  z-index: 1;
}
.char-black {
  left: 220px;
  width: 115px; height: 290px;
  background: #2D2D2D;
  border-radius: 8px 8px 0 0;
  z-index: 2;
}
.char-orange {
  left: 0;
  width: 230px; height: 190px;
  background: #FF9B6B;
  border-radius: 115px 115px 0 0;
  z-index: 3;
}
.char-yellow {
  left: 290px;
  width: 135px; height: 215px;
  background: #E8D754;
  border-radius: 68px 68px 0 0;
  z-index: 4;
}

/* 眼睛容器 */
.eyes {
  position: absolute;
  display: flex;
  will-change: left, top;
  transition: left .10s ease-out, top .10s ease-out;
}

/* 白色眼球 */
.eyeball {
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: height .12s ease;
}

/* 瞳孔 — 最快，几乎无延迟 */
.pupil {
  border-radius: 50%;
  background: #2D2D2D;
  will-change: transform;
  transition: transform .05s linear;
}

/* 裸瞳孔 */
.bare-pupil {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #2D2D2D;
  will-change: transform;
  transition: transform .10s ease-out;
}

/* 黄色嘴巴 */
.yellow-mouth {
  position: absolute;
  width: 50px; height: 4px;
  background: #2D2D2D;
  border-radius: 2px;
  will-change: left, top, transform;
  transition:
    left .10s ease-out,
    top .10s ease-out,
    transform .20s ease;
}

/* 橙色悲伤嘴巴 */
.orange-mouth {
  position: absolute;
  width: 28px; height: 14px;
  border: 3px solid #2D2D2D;
  border-top: none;
  border-radius: 0 0 14px 14px;
  opacity: 0;
  transition:
    opacity .45s ease,
    left .10s ease-out,
    top .10s ease-out;
}
.orange-mouth.visible { opacity: 1; }


/* ── 电影感过渡（状态切换时由 JS 切换此类） ── */
.cinematic .character {
  transition:
    transform .55s cubic-bezier(.4, 0, .2, 1),
    height    .50s cubic-bezier(.4, 0, .2, 1);
}
.cinematic .eyes {
  transition:
    left .45s cubic-bezier(.4, 0, .2, 1),
    top  .45s cubic-bezier(.4, 0, .2, 1);
}
.cinematic .bare-pupil {
  transition: transform .45s cubic-bezier(.4, 0, .2, 1);
}
.cinematic .pupil {
  transition: transform .30s cubic-bezier(.4, 0, .2, 1);
}
.cinematic .yellow-mouth {
  transition: all .45s cubic-bezier(.4, 0, .2, 1);
}
.cinematic .orange-mouth {
  transition: all .45s cubic-bezier(.4, 0, .2, 1);
}


/* 摇头动画 */
@keyframes shakeHead {
  0%, 100% { translate: 0 0; }
  10%  { translate: -9px 0; }
  20%  { translate: 7px 0; }
  30%  { translate: -6px 0; }
  40%  { translate: 5px 0; }
  50%  { translate: -4px 0; }
  60%  { translate: 3px 0; }
  70%  { translate: -2px 0; }
  80%  { translate: 1px 0; }
  90%  { translate: -0.5px 0; }
}
.eyes.shake-head,
.yellow-mouth.shake-head,
.orange-mouth.shake-head {
  animation: shakeHead .8s cubic-bezier(.36,.07,.19,.97) both;
}


/* ================================================================
   RIGHT — 登录表单
================================================================ */
.right-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 40px;
}

.form-container {
  width: 100%;
  max-width: 400px;
}

.mobile-logo {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}
.mobile-logo .logo-icon {
  width: 28px; height: 28px;
  background: var(--primary);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff;
}
.mobile-logo span {
  font-size: 16px; font-weight: 600; color: #1a1a2e;
}

.form-header {
  text-align: center;
  margin-bottom: 36px;
}
.form-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -.5px;
  margin-bottom: 6px;
}
.form-header p {
  font-size: 14px;
  color: #888;
}

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}
.form-group .input-wrapper { position: relative; }

.form-group input {
  width: 100%;
  height: 48px;
  border: none;
  border-bottom: 1.5px solid #e0e0e0;
  padding: 0 40px 0 0;
  font-size: 15px;
  font-family: inherit;
  color: #1a1a2e;
  background: transparent;
  outline: none;
  transition: border-color .3s;
}
.form-group input:focus { border-bottom-color: var(--primary); }
.form-group input::placeholder { color: #ccc; }
.form-group input.error { border-bottom-color: #dc2626; }
.form-group label.error-label { color: #dc2626; }

.toggle-password {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer;
  color: #666;
  padding: 6px;
  transition: color .2s;
}
.toggle-password:hover { color: #333; }

.error-msg {
  display: none;
  padding: 10px 14px;
  font-size: 13px;
  color: #dc2626;
  background: rgba(220,38,38,.08);
  border: 1px solid rgba(220,38,38,.2);
  border-radius: 10px;
  margin-bottom: 16px;
}

/* 验证码行 */
.captcha-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.captcha-input-wrap { flex: 1; }
.captcha-img {
  height: 44px;
  width: 130px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .2s;
  object-fit: cover;
}
.captcha-img:hover { opacity: .75; }
.captcha-img:active { opacity: .5; }

/* 登录按钮 */
.btn-login {
  position: relative;
  width: 100%;
  height: 50px;
  border-radius: 25px;
  border: 1.5px solid var(--btn-bg);
  background: var(--btn-bg);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  margin-bottom: 14px;
  transition: all .3s;
}
.btn-login .btn-text {
  display: inline-block;
  transition: all .3s;
}
.btn-login .btn-hover-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--btn-hover-bg);
  color: #fff;
  opacity: 0;
  transition: all .3s;
  border-radius: 25px;
}
.btn-login:hover .btn-text {
  transform: translateX(40px);
  opacity: 0;
}
.btn-login:hover .btn-hover-content { opacity: 1; }
.btn-login:disabled { opacity: .6; cursor: default; }

.spinner {
  width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.info-box {
  margin-top: 16px;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.65;
}
.info-box i { color: var(--primary); font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.info-box strong { color: #374151; }

.form-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 13px;
  color: #888;
}
.form-footer a {
  color: #1a1a2e;
  font-weight: 600;
  text-decoration: none;
}
.form-footer a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .left-panel { display: none; }
  .mobile-logo { display: flex; }
}
