/* Password fields: show/hide toggle, animated strength meter, rule checklist, confirmation match. */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { padding-right: 2.6rem !important; }
.pw-toggle {
    position: absolute; top: 50%; right: .45rem; transform: translateY(-50%);
    width: 1.9rem; height: 1.9rem; border-radius: .6rem; border: 0; background: transparent;
    color: #64748b; cursor: pointer; display: grid; place-items: center;
    transition: background-color .2s ease, color .2s ease;
}
.pw-toggle:hover, .pw-toggle:focus-visible { background: #e2e8f0; color: #1e293b; outline: none; }
.pw-toggle svg { width: 1.05rem; height: 1.05rem; }

.pw-meter { margin-top: .5rem; overflow: hidden; max-height: 0; opacity: 0;
    transition: max-height .35s ease, opacity .25s ease; }
.pw-meter.is-visible { max-height: 12rem; opacity: 1; }
.pw-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; }
.pw-bar { height: .38rem; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.pw-bar > i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--pw-color, #e11d48);
    transform: scaleX(0); transform-origin: left center;
    transition: transform .45s cubic-bezier(.22, 1, .36, 1), background-color .35s ease; }
.pw-bar.is-on > i { transform: scaleX(1); }
.pw-bar:nth-child(2) > i { transition-delay: .06s; }
.pw-bar:nth-child(3) > i { transition-delay: .12s; }
.pw-bar:nth-child(4) > i { transition-delay: .18s; }
.pw-meter[data-level="0"], .pw-meter[data-level="1"] { --pw-color: #e11d48; }
.pw-meter[data-level="2"] { --pw-color: #f59e0b; }
.pw-meter[data-level="3"] { --pw-color: #10b981; }
.pw-meter[data-level="4"] { --pw-color: #059669; }
.pw-label { margin-top: .35rem; font-size: 11px; font-weight: 800; color: var(--pw-color, #e11d48);
    transition: color .3s ease; }
.pw-label.is-changing { animation: pw-label-in .3s ease; }
.pw-rules { margin: .35rem 0 0; padding: 0; list-style: none; display: grid; gap: .2rem; }
.pw-rule { display: flex; align-items: center; gap: .4rem; font-size: 11px; color: #64748b; transition: color .25s ease; }
.pw-rule::before {
    content: ""; flex: none; width: .95rem; height: .95rem; border-radius: 999px; border: 1.5px solid #cbd5e1;
    background: #fff center / .6rem no-repeat;
    transition: background-color .25s ease, border-color .25s ease;
}
.pw-rule.is-ok { color: #047857; }
.pw-rule.is-ok::before {
    border-color: #10b981; background-color: #10b981;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.5-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    animation: pw-pop .35s cubic-bezier(.34, 1.56, .64, 1);
}
.pw-match { margin-top: .35rem; font-size: 11px; font-weight: 700; min-height: 1em; transition: color .25s ease; }
.pw-match.is-ok { color: #047857; }
.pw-match.is-bad { color: #e11d48; }
input.pw-mismatch { border-color: #fda4af !important; animation: pw-shake .35s ease; }

@keyframes pw-pop { 0% { transform: scale(.4); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes pw-label-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@keyframes pw-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

@media (prefers-reduced-motion: reduce) {
    .pw-meter, .pw-bar > i, .pw-label, .pw-rule, .pw-rule::before, .pw-toggle { transition: none !important; }
    .pw-rule.is-ok::before, .pw-label.is-changing, input.pw-mismatch { animation: none !important; }
}

/* Standalone account pages (password reset, e-mail confirmation) */
.acct-card { max-width: 26rem; margin: 3rem auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 1.5rem;
    box-shadow: 0 20px 45px -25px rgba(15, 23, 42, .35); padding: 2rem; }
.acct-icon { width: 3.25rem; height: 3.25rem; border-radius: 1rem; display: grid; place-items: center; margin: 0 auto 1rem;
    font-size: 1.5rem; font-weight: 800; background: #eff6ff; color: #2563eb; }
.acct-icon.is-ok { background: #ecfdf5; color: #059669; animation: pw-pop .45s cubic-bezier(.34, 1.56, .64, 1); }
.acct-icon.is-bad { background: #fff1f2; color: #e11d48; }
