/* =========================================================================
   KHUNG ĐỔI MẬT KHẨU — dùng chung cho trang Công việc (index.html) và KMS (kms.html) — v1.0.0
   Giữ nguyên id: changePassOverlay, cpAccount, cpOldPassword, cpNewPassword, cpConfirmPassword,
   changePassError, changePassSuccess, btnChangePass.
   ========================================================================= */
.pw-overlay {
  --pw-surface: #fff; --pw-ink: #0F172A; --pw-ink2: #334155; --pw-muted: #64748B; --pw-faint: #94A3B8;
  --pw-line: #E2E8F0; --pw-line2: #F1F5F9; --pw-soft: #F8FAFC; --pw-btn-soft: #F1F5F9; --pw-btn-soft-h: #E2E8F0;
  position: fixed; inset: 0; z-index: 1000002; display: none; align-items: center; justify-content: center; padding: 16px;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  font-family: 'Plus Jakarta Sans', 'Be Vietnam Pro', system-ui, 'Segoe UI', Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased;
  overflow-y: auto;
}
.pw-overlay.open { display: flex; }
[data-theme="dark"] .pw-overlay {
  --pw-surface: #111A2E; --pw-ink: #E2E8F0; --pw-ink2: #CBD5E1; --pw-muted: #94A3B8; --pw-faint: #64748B;
  --pw-line: #1E293B; --pw-line2: #162036; --pw-soft: #0F172A; --pw-btn-soft: rgba(255,255,255,.08); --pw-btn-soft-h: rgba(255,255,255,.16);
}
.pw-card {
  width: min(440px, 100%); margin: auto; background: var(--pw-surface); color: var(--pw-ink); border: 1px solid var(--pw-line); border-radius: 18px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, .35); overflow: hidden; animation: pwIn .22s ease both; text-align: left;
}
@keyframes pwIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.pw-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 20px 60px 16px 22px; border-bottom: 1px solid var(--pw-line2); }
.pw-hic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #FEF2F2; border: 1px solid #FECACA; color: #DC2626; }
[data-theme="dark"] .pw-hic { background: rgba(220,38,38,.14); border-color: rgba(220,38,38,.35); color: #F87171; }
.pw-hic svg, .pw-eye svg, .pw-close svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pw-head h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: var(--pw-ink); line-height: 1.25; }
.pw-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--pw-muted); line-height: 1.35; }
.pw-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 999px; background: var(--pw-btn-soft); color: var(--pw-muted); cursor: pointer; transition: background .15s ease, color .15s ease; }
.pw-close:hover { background: var(--pw-btn-soft-h); color: var(--pw-ink); }
.pw-close svg { width: 17px; height: 17px; }

.pw-body { padding: 20px 22px 22px; display: grid; gap: 14px; }
.pw-f label { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--pw-ink2); }
.pw-input {
  display: block; width: 100%; box-sizing: border-box; padding: 11px 14px; font: inherit; font-size: 14px; color: var(--pw-ink);
  background: var(--pw-soft); border: 1px solid var(--pw-line); border-radius: 12px; outline: none; transition: all .15s ease; height: auto;
}
.pw-input::placeholder { color: var(--pw-faint); }
.pw-input:focus { background: var(--pw-surface); border-color: #EF4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .10); }
.pw-pw { position: relative; }
.pw-pw .pw-input { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--pw-faint); cursor: pointer; transition: all .15s ease; }
.pw-eye:hover { color: var(--pw-ink); background: var(--pw-btn-soft); }
.pw-eye svg { width: 18px; height: 18px; }
.pw-eye .off { display: none; }
.pw-eye.is-showing .on { display: none; }
.pw-eye.is-showing .off { display: block; }

/* Thanh đo độ mạnh mật khẩu */
.pw-meter { display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.pw-meter i { flex: 1; height: 4px; border-radius: 99px; background: var(--pw-line); transition: background .2s ease; }
.pw-meter .pw-meter-t { flex: none; margin-left: 6px; min-width: 84px; text-align: right; font-size: 11.5px; font-weight: 700; color: var(--pw-faint); }
.pw-meter[data-level="1"] i:nth-child(-n+1) { background: #EF4444; } .pw-meter[data-level="1"] .pw-meter-t { color: #DC2626; }
.pw-meter[data-level="2"] i:nth-child(-n+2) { background: #F59E0B; } .pw-meter[data-level="2"] .pw-meter-t { color: #D97706; }
.pw-meter[data-level="3"] i:nth-child(-n+3) { background: #84CC16; } .pw-meter[data-level="3"] .pw-meter-t { color: #65A30D; }
.pw-meter[data-level="4"] i:nth-child(-n+4) { background: #10B981; } .pw-meter[data-level="4"] .pw-meter-t { color: #059669; }
.pw-match { margin: 7px 0 0; font-size: 11.5px; font-weight: 700; min-height: 16px; color: var(--pw-faint); }
.pw-match.ok { color: #059669; } .pw-match.bad { color: #DC2626; }
.pw-hint { margin: 0; font-size: 11.5px; color: var(--pw-muted); line-height: 1.5; padding: 10px 12px; border-radius: 10px; background: var(--pw-soft); border: 1px dashed var(--pw-line); }

.pw-card .login-gate-error, .pw-card .login-gate-success { margin: 0; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 600; line-height: 1.4; display: block; }
.pw-card .login-gate-error { background: #FEF2F2; color: #B91C1C; border: 1px solid #FEE2E2; }
.pw-card .login-gate-success { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.pw-card .d-none { display: none !important; }

.pw-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 2px; }
.pw-btn, .pw-btn-ghost { font: inherit; font-size: 14px; border: 0; border-radius: 12px; cursor: pointer; transition: all .2s ease; padding: 13px 18px; }
.pw-btn-ghost { background: var(--pw-btn-soft); color: var(--pw-ink2); font-weight: 700; }
.pw-btn-ghost:hover { background: var(--pw-btn-soft-h); }
.pw-btn { color: #fff; font-weight: 800; letter-spacing: .02em; background: linear-gradient(90deg, #DC2626, #B91C1C); box-shadow: 0 10px 20px -6px rgba(220, 38, 38, .30); }
.pw-btn:hover { background: linear-gradient(90deg, #B91C1C, #991B1B); transform: scale(1.01); }
.pw-btn:active { transform: scale(.99); }
.pw-btn:disabled { opacity: .7; cursor: progress; transform: none; }
@media (max-width: 420px) { .pw-head { padding: 18px 56px 14px 18px; } .pw-body { padding: 18px; } }
@media (prefers-reduced-motion: reduce) { .pw-card { animation: none; } .pw-btn:hover, .pw-btn:active { transform: none; } }
