/* CareerCompass-style login modal — 辉京咨询 */
:root {
  --hjl-primary: hsl(231, 48%, 48%);
  --hjl-primary-fg: #fafafa;
  --hjl-bg: #ffffff;
  --hjl-fg: hsl(222.2, 84%, 4.9%);
  --hjl-muted: hsl(215.4, 16.3%, 46.9%);
  --hjl-border: hsl(214.3, 31.8%, 91.4%);
  --hjl-destructive: hsl(0, 84.2%, 60.2%);
  --hjl-radius: 0.5rem;
}

/* Header trigger button */
.header-login-container-v3 {
  width: 100%;
  background: transparent !important;
  padding: 8px 20px;
  border: none !important;
  box-shadow: none !important;
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
}

.header-login-bar-v3 {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.logout-btn-v3 {
  background: rgba(255, 255, 255, 0.2);
  color: #fff !important;
  padding: 3px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  transition: background 0.18s ease, transform 0.1s ease, box-shadow 0.12s ease, border-color 0.18s ease;
  border: 1px solid #fff;
  margin-left: 15px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.2;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  outline: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}

button.logout-btn-v3 {
  appearance: none;
  -webkit-appearance: none;
}

.header-login-bar-v3 .logout-btn-v3 {
  margin-left: 0;
}

.logout-btn-v3:hover {
  background: rgba(255, 255, 255, 0.32) !important;
  color: #fff !important;
  border-color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
}

.logout-btn-v3:active {
  background: rgba(0, 0, 0, 0.28) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.82) !important;
  transform: translateY(1px) scale(0.97);
  box-shadow:
    inset 0 3px 8px rgba(0, 0, 0, 0.45),
    inset 0 1px 2px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.logout-btn-v3:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85) !important;
  outline-offset: 2px;
}
.login-welcome-v3 {
  color: #fff !important;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-welcome-v3 i { color: #fff !important; font-size: 16px; }
.user-name-v3 { color: #fff !important; font-weight: 600; }
.sep { color: #fff !important; margin: 0 2px; }
.settings-link {
  color: #fff !important;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.settings-link:hover { text-decoration: underline; opacity: 0.9; }

/* Logged-in welcome */
.hjl-modal[hidden] { display: none !important; }

.hjl-modal {
  display: none;
  position: fixed;
  z-index: 999999;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  justify-content: center;
  align-items: center;
  padding: 16px;
  animation: hjlFadeIn 0.25s ease;
}

.hjl-modal.is-open {
  display: flex;
}

@keyframes hjlFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hjlSlideUp {
  from { transform: translateY(24px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.hjl-modal-panel {
  position: relative;
  width: 100%;
  max-width: 920px;
  max-height: min(580px, calc(100vh - 32px));
  background: var(--hjl-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-columns: 1fr 1fr;
  animation: hjlSlideUp 0.3s ease;
}

.hjl-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 30;
  width: 34px;
  height: 34px;
  padding: 0 !important;
  border: none !important;
  background: #f4f4f5 !important;
  border-radius: 50% !important;
  cursor: pointer;
  color: #71717a !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  outline: none !important;
  line-height: 1;
}

.hjl-modal-close svg {
  width: 16px;
  height: 16px;
  display: block;
}

.hjl-modal-close:hover {
  color: #ffffff !important;
  background: #ef4444 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35) !important;
}

.hjl-modal-close:active {
  background: #dc2626 !important;
  color: #ffffff !important;
}

.hjl-modal-close:focus-visible {
  outline: 2px solid hsla(231, 48%, 48%, 0.45) !important;
  outline-offset: 2px;
}

/* Left panel — animated characters */
.hjl-modal-left {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 50%, #4b5563 100%);
  color: #fff;
  overflow: hidden;
  min-height: 480px;
}

.hjl-modal-left::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.hjl-modal-left::after {
  content: "";
  position: absolute;
  top: 25%;
  right: 25%;
  width: 160px;
  height: 160px;
  background: rgba(156, 163, 175, 0.25);
  border-radius: 50%;
  filter: blur(48px);
  pointer-events: none;
}

.hjl-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.hjl-brand-icon {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.hjl-characters-wrap {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 280px;
  overflow: hidden;
}

.hjl-modal-footer-links {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.hjl-modal-footer-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.hjl-modal-footer-links a:hover {
  color: #fff;
}

/* Right panel — form */
.hjl-modal-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 36px;
  overflow-y: auto;
}

.hjl-form-wrap {
  width: 100%;
  max-width: 360px;
}

.hjl-form-header {
  text-align: center;
  margin-bottom: 28px;
}

.hjl-form-header h2 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hjl-fg);
}

.hjl-form-header p {
  margin: 0;
  font-size: 14px;
  color: var(--hjl-muted);
}

.hjl-field {
  margin-bottom: 22px;
}

.hjl-field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--hjl-fg);
}

.hjl-input {
  width: 100%;
  height: auto;
  min-height: 40px;
  padding: 6px 2px 10px !important;
  font-size: 15px;
  border: none !important;
  border-bottom: 1px solid #d1d5db !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--hjl-fg);
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  outline: none !important;
  box-shadow: none !important;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.hjl-input:hover:not(:focus) {
  border-bottom-color: #9ca3af !important;
}

.hjl-input:focus {
  border-bottom-color: #1a1a1a !important;
  box-shadow: none !important;
}

.hjl-input:-webkit-autofill,
.hjl-input:-webkit-autofill:hover,
.hjl-input:-webkit-autofill:focus,
.hjl-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #1a1a1a !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  border-bottom: 1px solid #1a1a1a !important;
  caret-color: #1a1a1a;
  transition: background-color 99999s ease-out 0s, color 99999s ease-out 0s;
}

@keyframes hjl-autofill-clear {
  to {
    background-color: transparent;
    background-image: none;
  }
}

.hjl-input:-webkit-autofill {
  animation-name: hjl-autofill-clear;
  animation-fill-mode: both;
}

.hjl-input::placeholder {
  color: #a1a1aa;
}

.hjl-password-wrap {
  position: relative;
}

@keyframes hjl-password-shake {
  0%, 100% { transform: translateX(0); }
  12% { transform: translateX(-9px); }
  24% { transform: translateX(9px); }
  36% { transform: translateX(-7px); }
  48% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  72% { transform: translateX(4px); }
  84% { transform: translateX(-2px); }
}

.hjl-field-user.is-shake,
.hjl-field-password.is-shake {
  animation: hjl-password-shake 0.48s ease-in-out;
}

.hjl-field-user.is-shake .hjl-input,
.hjl-field-password.is-shake .hjl-input {
  border-bottom-color: #ef4444 !important;
}

.hjl-password-wrap .hjl-input {
  padding-right: 40px !important;
}

.hjl-toggle-pwd {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer;
  color: #a1a1aa !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  appearance: none !important;
  -webkit-appearance: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.hjl-toggle-pwd:hover {
  color: #1a1a1a !important;
  background: transparent !important;
}

.hjl-toggle-pwd:active {
  color: #374151 !important;
  background: transparent !important;
}

.hjl-toggle-pwd:focus-visible {
  outline: none !important;
  color: #1a1a1a !important;
  background: transparent !important;
}

.hjl-toggle-pwd svg,
.hjl-toggle-pwd .hjl-icon-eye {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}

.hjl-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.hjl-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--hjl-fg);
  user-select: none;
}

.hjl-checkbox-label input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.hjl-checkbox-box {
  width: 16px;
  height: 16px;
  border: 1px solid var(--hjl-border);
  border-radius: 4px;
  background: #fff;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.hjl-checkbox-label input:checked + .hjl-checkbox-box {
  background: var(--hjl-primary);
  border-color: var(--hjl-primary);
}

.hjl-checkbox-label input:checked + .hjl-checkbox-box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.hjl-forgot-link {
  font-size: 14px;
  color: var(--hjl-primary);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.hjl-forgot-link:hover {
  text-decoration: underline;
}

.hjl-error-msg {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hjl-error-msg.is-visible {
  display: block !important;
}

/* Interactive hover button */
.hjl-submit-btn {
  position: relative;
  width: 100%;
  height: 48px;
  margin-top: 4px;
  padding: 0 !important;
  border: none !important;
  border-radius: 9999px !important;
  background: #1a1a1a !important;
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  outline: none !important;
}

.hjl-submit-btn:not(:disabled):hover {
  transform: translateY(-1px);
  background: #333333 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
}

.hjl-submit-btn:not(:disabled):active {
  transform: translateY(0);
  background: #000000 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.hjl-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.hjl-submit-btn-text {
  display: inline-block;
  color: #fff;
}

.hjl-submit-btn:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.35) !important;
  outline-offset: 3px;
}

/* Elementor / theme button reset inside modal */
#hjl-login-modal button,
.hjl-modal button {
  font-family: inherit;
  line-height: normal;
}

/* Error alert modal (legacy) */
.login-modal[hidden] { display: none !important; }

.login-modal {
  display: none;
  position: fixed;
  z-index: 1000000;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.login-modal-content {
  background: #fff;
  padding: 28px 24px 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  position: relative;
  animation: hjlSlideUp 0.3s ease;
}

.login-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  padding: 0 !important;
  border: none !important;
  background: #f4f4f5 !important;
  border-radius: 50% !important;
  cursor: pointer;
  color: #71717a !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  outline: none !important;
  line-height: 1;
}

.login-modal-close svg {
  width: 16px;
  height: 16px;
  display: block;
}

.login-modal-close:hover {
  color: #ffffff !important;
  background: #ef4444 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35) !important;
}

.login-modal-close:active {
  background: #dc2626 !important;
  color: #ffffff !important;
}

.login-modal-icon {
  font-size: 52px;
  color: #ef4444;
  margin: 8px 0 12px;
  line-height: 1;
}

.login-modal-message {
  font-size: 15px;
  color: #374151;
  margin: 0 0 22px;
  line-height: 1.6;
  padding: 0 8px;
}

.login-modal-btn {
  min-width: 120px;
  height: 42px;
  padding: 0 28px !important;
  border: none !important;
  border-radius: 9999px !important;
  background: #1a1a1a !important;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  outline: none !important;
}

.login-modal-btn:hover {
  background: #333333 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25) !important;
}

.login-modal-btn:active {
  background: #000000 !important;
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18) !important;
}

.login-modal-btn:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.35) !important;
  outline-offset: 2px;
}

/* Animated characters */
.hjl-characters {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 300px;
  transform: scale(0.78);
  transform-origin: bottom center;
}

.hjl-char {
  position: absolute;
  bottom: 0;
  transition: transform 0.38s ease-out, height 0.7s ease-in-out;
  transform-origin: bottom center;
}

.hjl-char-purple {
  left: 50px;
  width: 140px;
  height: 320px;
  background: #6c3ff5;
  border-radius: 10px 10px 0 0;
  z-index: 1;
}

.hjl-char-black {
  left: 185px;
  width: 95px;
  height: 248px;
  background: #2d2d2d;
  border-radius: 8px 8px 0 0;
  z-index: 2;
}

.hjl-char-orange {
  left: 0;
  width: 190px;
  height: 160px;
  background: #ff9b6b;
  border-radius: 95px 95px 0 0;
  z-index: 3;
}

.hjl-char-yellow {
  left: 245px;
  width: 110px;
  height: 184px;
  background: #e8d754;
  border-radius: 55px 55px 0 0;
  z-index: 4;
}

.hjl-char-eyes {
  position: absolute;
  display: flex;
  left: 0;
  top: 0;
  transition: left 0.38s ease-out, top 0.38s ease-out;
}

.hjl-eye {
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: height 0.15s ease;
}

.hjl-eye-pupil {
  border-radius: 50%;
  background: #2d2d2d;
  transition: transform 0.1s ease-out;
}

.hjl-pupil-only {
  border-radius: 50%;
  background: #2d2d2d;
  transition: transform 0.1s ease-out;
}

.hjl-characters.is-entering .hjl-char {
  transition: none;
  will-change: transform, opacity;
}

.hjl-characters.is-entering .hjl-char-eyes,
.hjl-characters.is-entering .hjl-char-mouth,
.hjl-characters.is-entering .hjl-eye-pupil,
.hjl-characters.is-entering .hjl-pupil-only {
  transition: none;
}

/* legacy keyframes kept for reference; entrance now uses JS rAF */
.hjl-characters.is-entering .hjl-char-black,
.hjl-characters.is-entering .hjl-char-purple,
.hjl-characters.is-entering .hjl-char-orange,
.hjl-characters.is-entering .hjl-char-yellow {
  animation: none;
}

@keyframes hjl-char-enter-black {
  0% {
    transform: translate3d(0, -360px, 0) skewX(-22deg);
    opacity: 0;
  }
  68% {
    transform: translate3d(0, 14px, 0) skewX(6deg);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 0, 0) skewX(0deg);
    opacity: 1;
  }
}

@keyframes hjl-char-enter-purple {
  0% {
    transform: translate3d(-70px, -420px, 0) skewX(-18deg);
    opacity: 0;
  }
  68% {
    transform: translate3d(0, 12px, 0) skewX(4deg);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 0, 0) skewX(0deg);
    opacity: 1;
  }
}

@keyframes hjl-char-enter-orange {
  0% {
    transform: translate3d(-260px, 140px, 0) skewX(14deg);
    opacity: 0;
  }
  68% {
    transform: translate3d(0, -10px, 0) skewX(-3deg);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 0, 0) skewX(0deg);
    opacity: 1;
  }
}

@keyframes hjl-char-enter-yellow {
  0% {
    transform: translate3d(220px, 120px, 0) skewX(-12deg);
    opacity: 0;
  }
  68% {
    transform: translate3d(0, -8px, 0) skewX(3deg);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 0, 0) skewX(0deg);
    opacity: 1;
  }
}

.hjl-characters.is-entering .hjl-char-eyes,
.hjl-characters.is-entering .hjl-char-mouth,
.hjl-characters.is-entering .hjl-eye-pupil,
.hjl-characters.is-entering .hjl-pupil-only {
  transition: none;
}

.hjl-characters.is-sad-enter {
  animation: hjl-sad-drop 0.55s ease;
}

@keyframes hjl-sad-drop {
  0% { transform: scale(0.78) translateY(0); }
  35% { transform: scale(0.78) translateY(6px); }
  100% { transform: scale(0.78) translateY(0); }
}

.hjl-char-mouth {
  position: absolute;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.hjl-char-mouth.is-visible {
  opacity: 1;
}

.hjl-char-mouth.is-neutral {
  opacity: 1;
  width: 64px;
  height: 4px;
  background: #2d2d2d;
  border-radius: 9999px;
}

.hjl-char-mouth--sad,
.hjl-char-mouth--sad-small {
  width: 22px;
  height: 8px;
  background: transparent;
  border: none;
  border-top: 3px solid #2d2d2d;
  border-radius: 22px 22px 0 0;
}

.hjl-char-mouth--sad-small {
  width: 16px;
  height: 6px;
  border-top-width: 2px;
  border-radius: 16px 16px 0 0;
}

.hjl-char-mouth--sad-wavy {
  width: 30px;
  height: 6px;
  background: transparent;
  border: none;
  border-top: 3px solid #2d2d2d;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transform: rotate(-6deg) scaleX(1.1);
}

.hjl-characters.is-sad .hjl-char {
  transition: transform 0.45s ease-out, height 0.55s ease-out;
}

.hjl-characters.is-sad .hjl-char-eyes,
.hjl-characters.is-sad .hjl-char-mouth {
  transition: left 0.45s ease-out, top 0.45s ease-out, opacity 0.35s ease-out, transform 0.45s ease-out;
}

.hjl-characters.is-sad .hjl-eye {
  transition: height 0.35s ease-out;
}

.hjl-characters.is-sad .hjl-eye-pupil,
.hjl-characters.is-sad .hjl-pupil-only {
  transition: transform 0.35s ease-out;
}

.hjl-char-purple.hjl-typing,
.hjl-char-purple.hjl-hiding-pwd {
  height: 352px;
}

@media (max-width: 768px) {
  .hjl-modal-panel {
    grid-template-columns: 1fr;
    max-width: 420px;
    max-height: calc(100vh - 24px);
  }

  .hjl-modal-left {
    display: none;
  }

  .hjl-modal-right {
    padding: 32px 24px 28px;
  }

  .header-login-bar-v3 {
    justify-content: center;
  }
}
