/* ─── Login (cinematic split · photographic bg) ─── */
#login-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; overflow: auto; font-family: 'Inter', var(--font);
  background-color: #EBE8F2;
  background-image:
    linear-gradient(104deg, rgba(247,245,251,0.88) 0%, rgba(247,245,251,0.55) 30%, rgba(247,245,251,0.18) 50%, rgba(247,245,251,0) 72%),
    url('/login-bg.jpg');
  background-size: cover; background-position: center; background-repeat: no-repeat;
  animation: spRise 0.6s ease both;
}
#login-overlay.hidden { display: none; }
@keyframes spRise { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #login-overlay { animation: none; } }

/* left brand column overlaid on background */
.sp-left {
  flex: 1 1 auto; min-width: 0; position: relative; z-index: 1;
  padding: clamp(40px, 5vw, 88px) clamp(40px, 5vw, 92px);
  display: flex; flex-direction: column; justify-content: space-between;
}
.sp-logo-row { display: flex; align-items: center; gap: 13px; }
.sp-logo-mark { width: 52px; height: auto; flex-shrink: 0; display: block; }
.sp-logo-text { display: flex; flex-direction: column; line-height: 1.18; }
.sp-logo-text b {
  font-family: 'Playfair Display', serif; font-weight: 600; font-size: 20px;
  letter-spacing: 0.16em; color: #20243F;
}
.sp-logo-text small {
  font-weight: 500; font-size: 10px; letter-spacing: 0.32em;
  color: #A8946A; text-transform: uppercase;
}

.sp-hero { margin: auto 0; max-width: 560px; }
.sp-headline {
  font-family: 'Playfair Display', 'Noto Serif SC', serif; font-weight: 600;
  font-size: clamp(46px, 5vw, 80px); line-height: 1.03; letter-spacing: -0.01em; margin: 0;
}
.sp-headline .l1 { display: block; color: #20243F; }
.sp-headline .l2 {
  display: block;
  background: linear-gradient(92deg, #CFBA82, #B0944F 75%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sp-rule { width: 62px; height: 3px; border-radius: 2px; margin: 26px 0 22px;
  background: linear-gradient(90deg, #D6C496, #ECE0BE); }
.sp-lead { font-size: clamp(17px, 1.4vw, 20px); font-weight: 500; color: #2B2F4E;
  line-height: 1.5; max-width: 26ch; margin: 0 0 16px; }
.sp-desc { font-size: 13.5px; color: #5A6076; line-height: 1.85; max-width: 42ch; }

.sp-features { display: flex; margin: 34px 0 28px; }
.sp-feat { display: flex; flex-direction: column; gap: 9px; padding: 0 clamp(20px, 2.4vw, 40px); }
.sp-feat:first-child { padding-left: 0; }
.sp-feat + .sp-feat { border-left: 1px solid rgba(108,98,148,0.22); }
.sp-feat-ico { width: 46px; height: 46px; color: #6B5BD6; }
.sp-feat-ico svg { width: 100%; height: 100%; }
.sp-feat b { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; color: #20243F; text-transform: uppercase; }
.sp-feat span { font-size: 12px; color: #666C82; }
.sp-copy { font-size: 11.5px; color: #98899C; }

/* right floating glass card */
.sp-right {
  flex: 0 0 auto; width: clamp(420px, 40%, 600px); position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(28px, 4vw, 64px) clamp(24px, 4vw, 72px);
}
.sp-card {
  width: 100%; max-width: 460px;
  background: rgba(255,255,255,0.80);
  -webkit-backdrop-filter: blur(26px) saturate(1.5); backdrop-filter: blur(26px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: 26px; padding: clamp(34px, 3vw, 52px) clamp(28px, 2.6vw, 46px);
  box-shadow: 0 44px 100px -34px rgba(56,46,104,0.5), 0 6px 22px -12px rgba(56,46,104,0.22);
}
.sp-shield { width: 52px; height: 52px; color: #C4AC7C; margin-bottom: 22px; }
.sp-card-title {
  font-family: 'Playfair Display', 'Noto Serif SC', serif;
  font-size: clamp(30px, 2.4vw, 38px); font-weight: 600; color: #20243F; margin: 0 0 6px; line-height: 1.1;
}
.sp-card-sub { font-size: 13px; color: #9097AC; margin: 0 0 30px; }
.sp-label { display: block; font-size: 12px; font-weight: 600; color: #4B5068; margin-bottom: 9px; letter-spacing: 0.03em; }
.sp-field { margin-bottom: 19px; }
.sp-input-wrap { position: relative; }
.sp-ico-l { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #A9A2C4; width: 18px; height: 18px; pointer-events: none; }
.sp-input {
  width: 100%; box-sizing: border-box; background: rgba(255,255,255,0.7);
  border: 1.5px solid #E2DFEC; border-radius: 12px;
  padding: 14px 44px; font-family: 'Inter', var(--font); font-size: 14px; color: #20243F;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; appearance: none; -webkit-appearance: none;
}
.sp-input::placeholder { color: #B4B1C4; }
.sp-input:focus { border-color: #8B7FE8; background: #fff; box-shadow: 0 0 0 4px rgba(139,127,232,0.16); }
.sp-input:-webkit-autofill {
  -webkit-text-fill-color: #20243F; -webkit-box-shadow: 0 0 0 1000px #fff inset; caret-color: #20243F;
}
.sp-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: #A9A2C4; padding: 4px; display: flex; line-height: 0;
}
.sp-eye svg { width: 18px; height: 18px; }
.sp-eye:hover { color: #6B5BD6; }
.sp-row { display: flex; justify-content: flex-end; margin: -2px 0 22px; }
.sp-forgot {
  font-size: 12.5px; color: #6B5BD6; background: none; border: none; padding: 0;
  cursor: pointer; font-family: 'Inter', var(--font);
}
.sp-forgot:hover { text-decoration: underline; }
.login-err { font-size: 12px; color: #D8542E; min-height: 16px; margin: 0 0 14px; line-height: 1.45; }
.sp-btn {
  width: 100%; padding: 16px; border: none; border-radius: 13px; cursor: pointer;
  background: linear-gradient(96deg, #8B7FE8 0%, #6B5BD6 100%);
  color: #fff; font-family: 'Inter', var(--font); font-size: 14px; font-weight: 600; letter-spacing: 0.04em;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 16px 30px -12px rgba(107,91,214,0.65);
  transition: filter 0.15s, transform 0.12s, box-shadow 0.2s;
}
.sp-btn svg { width: 17px; height: 17px; transition: transform 0.2s; }
.sp-btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 20px 36px -12px rgba(107,91,214,0.8); }
.sp-btn:hover svg { transform: translateX(3px); }
.sp-btn:active { transform: translateY(0); }
.sp-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; filter: none; }
.sp-secure {
  margin-top: 26px; padding-top: 22px; border-top: 1px solid rgba(108,98,148,0.16);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.sp-secure-ico { color: #C4AC7C; width: 16px; height: 16px; }
.sp-secure p { font-size: 11.5px; color: #9097AC; line-height: 1.7; margin: 0; max-width: 34ch; }

@media (max-width: 900px) {
  #login-overlay { background-position: 32% center; }
  .sp-left { display: none; }
  .sp-right { width: 100%; }
}
@media (max-width: 480px) {
  .sp-card { padding: 30px 22px; border-radius: 20px; }
  .sp-input { font-size: 16px; }
}
#chpwd-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(18,16,26,0.40);
  backdrop-filter: blur(8px) saturate(1.15);
  -webkit-backdrop-filter: blur(8px) saturate(1.15);
  display: flex; align-items: center; justify-content: center;
  animation: modalOverlayIn 0.18s ease;
}
#chpwd-overlay.hidden { display: none; }
.chpwd-box {
  background: #fff; border-radius: 18px; padding: 24px 26px 22px;
  width: min(400px, 92vw); display: flex; flex-direction: column; gap: 0;
  box-shadow: 0 32px 80px -16px rgba(18,14,36,0.35), 0 4px 18px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.06);
  animation: modalIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.chpwd-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.chpwd-title { display: flex; align-items: center; gap: 12px; }
.chpwd-modal-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #F4F4F6; border: 1px solid rgba(0,0,0,0.05);
  color: #52525B; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.chpwd-header h3 {
  font-size: 17px; font-weight: 600; letter-spacing: 0.01em; color: var(--text);
  margin: 0; font-family: var(--font);
}
.chpwd-close {
  width: 30px; height: 30px; border-radius: 8px; border: none;
  background: none; cursor: pointer; color: var(--text-3); display: flex;
  align-items: center; justify-content: center; font-size: 15px; line-height: 1;
  margin: -4px -6px 0 0;
  transition: background 0.15s, color 0.15s;
}
.chpwd-close:hover { background: rgba(0,0,0,0.06); color: var(--text); }
.chpwd-field {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px;
}
.chpwd-field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.chpwd-field-wrap { position: relative; }
.chpwd-input {
  width: 100%; box-sizing: border-box;
  border: 1px solid rgba(0,0,0,0.10); border-radius: 10px;
  padding: 11px 38px 11px 13px; font-size: 14px; font-family: var(--font);
  color: var(--text); background: #FAFAFA; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.chpwd-input::placeholder { color: var(--text-3); }
.chpwd-input:hover { border-color: rgba(0,0,0,0.18); }
.chpwd-input:focus {
  background: #fff; border-color: rgba(26,26,24,0.50);
  box-shadow: 0 0 0 3.5px rgba(26,26,24,0.07);
}
.chpwd-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-3); padding: 2px;
  line-height: 1; transition: color 0.15s;
}
.chpwd-eye:hover { color: var(--text-2); }
.chpwd-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 4px 0 16px; }
.chpwd-err { font-size: 12px; color: #c0392b; min-height: 16px; margin-bottom: 12px; }
.chpwd-actions { display: flex; gap: 10px; }
.chpwd-btn {
  flex: 1; padding: 10px 0; border-radius: 10px; border: none; font-size: 13.5px;
  font-weight: 500; font-family: var(--font); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.06s;
}
.chpwd-btn.cancel {
  background: #fff; border: 1px solid rgba(0,0,0,0.12); color: var(--text-2);
}
.chpwd-btn.cancel:hover { background: #F5F5F6; border-color: rgba(0,0,0,0.16); }
.chpwd-btn.confirm {
  background: #7C3AED; color: #fff; font-weight: 600;
  box-shadow: 0 1px 3px rgba(124,58,237,0.35), inset 0 1px 0 rgba(255,255,255,0.14);
}
.chpwd-btn.confirm:hover:not(:disabled) { background: #6D28D9; }
.chpwd-btn.confirm:active:not(:disabled) { transform: scale(0.975); }
.chpwd-btn:disabled { opacity: 0.55; cursor: not-allowed; }
/* (legacy dark login-box styles removed — replaced by split-light .sp-* above) */

/* user badge */
.user-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(139,92,246,0.07); margin-bottom: 6px;
}
.user-badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  box-shadow: 0 0 5px rgba(139,92,246,0.5);
}
.user-badge-name { font-size: 12px; color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-logout-btn {
  background: none; border: none; color: var(--text-3);
  font-size: 11px; cursor: pointer; padding: 2px 6px;
  border-radius: 4px; transition: color 0.15s; font-family: var(--font);
}
.user-logout-btn:hover { color: #d97060; }

