/* =====================================================================
   WOAIL Note — Login Page
   Fully reuses the home hero structure; login card placed on the left
   ===================================================================== */

/* ---------- 1a. Background fills full screen ---------- */
.login-page .hero-bg-img {
  right: auto; left: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: right center;
}

/* ---------- 1. Login page title area ---------- */
.login-page .hero-eyebrow { margin-bottom: 16px; }
.login-page .hero-title { font-size: clamp(28px, 3vw, 40px); margin-bottom: 10px; }
.login-page .hero-subtitle-cn { font-size: clamp(15px, 1.4vw, 18px); color: var(--ink-mute); margin-bottom: 22px; line-height: 1.5; }

/* ---------- 2. Login card ---------- */
.login-card {
  max-width: 360px;
  padding: 24px 22px;
  border-radius: 20px;
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 20px 60px rgba(99,90,180,0.16), 0 6px 18px rgba(99,90,180,0.1);
  animation: cardIn 0.8s var(--ease) both;
}

/* ---------- 3. Form fields ---------- */
.login-form { display: flex; flex-direction: column; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-soft); letter-spacing: -0.01em; }
.field input {
  width: 100%; padding: 10px 13px; font-size: 14px; font-family: inherit;
  color: var(--ink); background: rgba(255,255,255,0.6);
  border: 1.5px solid rgba(0,0,0,0.08); border-radius: 11px;
  transition: 0.25s var(--ease); outline: none;
}
.field input::placeholder { color: var(--ink-mute); }
.field input:focus {
  border-color: var(--ai-purple);
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 0 3px rgba(184,167,255,0.15);
}
.field input.invalid { border-color: #FF6B6B; box-shadow: 0 0 0 3px rgba(255,107,107,0.12); }
.field-pwd { position: relative; }
.field-pwd input { padding-right: 42px; }
.pwd-toggle {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; padding: 6px; border-radius: 8px;
  color: var(--ink-mute); transition: 0.2s var(--ease);
}
.pwd-toggle:hover { color: var(--ink); background: rgba(184,167,255,0.12); }
.eye-closed { display: none; }
.pwd-toggle.show .eye-open { display: none; }
.pwd-toggle.show .eye-closed { display: block; }

/* ---------- 3b. Pane switch ---------- */
.login-pane { display: none; }
.login-pane.active { display: block; margin-top: 16px; animation: paneIn 0.4s var(--ease) both; }
@keyframes paneIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 3c. Back button ---------- */
.login-pane .reg-back { margin-top: 8px; }

/* ---------- 3d. TOTP verification code ---------- */
.totp-hint { font-size: 11px; color: var(--ink-mute); margin: -2px 0 8px; line-height: 1.5; }
.otp-wrap { display: flex; gap: 7px; }
.otp-input {
  flex: 1; aspect-ratio: 1; min-width: 0; padding: 0;
  text-align: center; font-size: 18px; font-weight: 700; font-family: var(--font-mono);
  color: var(--ink); background: rgba(255,255,255,0.6);
  border: 1.5px solid rgba(0,0,0,0.08); border-radius: 11px;
  transition: 0.25s var(--ease); outline: none;
}
.otp-input:focus {
  border-color: var(--ai-purple);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 0 0 3px rgba(184,167,255,0.15);
  transform: translateY(-2px);
}
.otp-input.filled { border-color: rgba(184,167,255,0.5); background: rgba(184,167,255,0.08); color: var(--ai-purple-deep); }
.otp-input.invalid { border-color: #FF6B6B; box-shadow: 0 0 0 3px rgba(255,107,107,0.12); animation: otpShake 0.4s; }
@keyframes otpShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- 4. Login row / buttons / divider ---------- */
.login-row { display: flex; align-items: center; justify-content: space-between; }
.checkbox { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); cursor: pointer; user-select: none; }
.checkbox input { width: 14px; height: 14px; accent-color: var(--ai-purple-deep); cursor: pointer; }
.link { font-size: 12px; color: var(--ai-purple-deep); font-weight: 500; transition: 0.2s var(--ease); }
.link:hover { color: var(--ink); text-decoration: underline; }
.link-em { font-weight: 700; }

.login-submit { width: 100%; justify-content: center; margin-top: 2px; padding: 11px 22px; font-size: 14px; }
.login-submit.loading .login-submit-text, .login-submit.loading svg { opacity: 0.4; }
.login-submit.loading .login-submit-loading { display: inline-flex; }
.login-submit-loading[hidden] { display: none; }
.spinner { width: 16px; height: 16px; border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }

.login-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.login-divider span { font-size: 11px; color: var(--ink-mute); font-weight: 500; }
.login-sso { width: 100%; justify-content: center; padding: 10px 22px; font-size: 14px; }
.login-sso svg { opacity: 0.9; }

.login-msg { font-size: 12px; text-align: center; min-height: 15px; margin-top: 2px; transition: 0.25s var(--ease); }
.login-msg.error { color: #FF6B6B; }
.login-msg.success { color: var(--green); }
.login-foot { text-align: center; font-size: 12px; color: var(--ink-mute); margin-top: 5px; }

/* ---------- 5. Animations ---------- */
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }

/* ---------- 5b. Footer bar ---------- */
.login-foot-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; align-items: center;
  padding: 14px 24px 10px;
  font-size: 12px; color: var(--ink-mute); letter-spacing: 0.01em;
  pointer-events: none;
  background: linear-gradient(to top, rgba(248,249,255,0.72), rgba(248,249,255,0));
}

/* ---------- 6. Responsive ---------- */
@media (max-width: 900px) {
  .login-page .hero-content { grid-template-columns: 1fr; gap: 30px; }
  .login-page .hero-visual { display: none; }
  .login-page .hero-text { max-width: 100%; }
  .login-page .hero { min-height: 100vh; min-height: 100svh; }
}
@media (max-width: 480px) {
  .login-card { padding: 20px 16px; border-radius: 18px; }
  .login-page .hero-title { font-size: clamp(34px, 9vw, 44px); }
}

/* ---------- 7. Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  .login-page .hero-bg-img { filter: brightness(0.5) saturate(0.9); }
  .login-foot-bar { background: linear-gradient(to top, rgba(8,8,18,0.72), rgba(8,8,18,0)); }
  .login-card { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
  .field input { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); color: var(--ink); }
  .field input:focus { background: rgba(255,255,255,0.08); border-color: var(--ai-purple); }
  .login-divider::before, .login-divider::after { background: rgba(255,255,255,0.1); }
  .login-pane .reg-back { color: var(--ink-mute); }
  .otp-input { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
  .otp-input:focus { background: rgba(255,255,255,0.08); }
  .otp-input.filled { background: rgba(184,167,255,0.1); }
}
