.password-strength {
    margin-top: 0.55rem;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, max-height 0.25s ease;
}

.password-strength.show {
    opacity: 1;
    max-height: 5.5rem;
    overflow: visible;
    pointer-events: auto;
}

.password-strength__meter {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.password-strength__seg {
    height: 6px;
    border-radius: 2px;
    background: #e8edf5;
    overflow: hidden;
}

.password-strength__seg i {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: 2px;
    background: #ef4444;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.38s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.2s ease;
}

.password-strength.is-caution .password-strength__seg i { background: #f59e0b; }
.password-strength.is-safe .password-strength__seg i { background: #10b981; }

.password-strength__seg.is-on i { transform: scaleX(1); }
.password-strength__seg:nth-child(2).is-on i { transition-delay: 0.03s; }
.password-strength__seg:nth-child(3).is-on i { transition-delay: 0.06s; }
.password-strength__seg:nth-child(4).is-on i { transition-delay: 0.09s; }

.password-strength__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 20px;
    margin-top: 8px;
}

.password-strength__label {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 20px;
    color: #64748b;
}

.password-strength.is-danger .password-strength__label { color: #dc2626; }
.password-strength.is-caution .password-strength__label { color: #d97706; }
.password-strength.is-safe .password-strength__label { color: #059669; }

.password-strength__label.is-swap {
    animation: pwLabelIn 0.28s cubic-bezier(0.23, 1, 0.32, 1);
}

.password-strength__guess {
    font-size: 11.5px;
    font-weight: 500;
    line-height: 20px;
    color: #d97706;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.password-strength.is-guess .password-strength__guess { opacity: 1; }

.password-requirements {
    list-style: none;
    margin: 0.7rem 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    line-height: 20px;
    color: #94a3b8;
}

.password-requirements li.met { color: #334155; }
.password-requirements li.fail { color: #dc2626; }

.pw-check {
    position: relative;
    display: grid;
    place-items: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
}

.pw-check::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 3px;
    background: #10b981;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.pw-check svg {
    position: relative;
    width: 9px;
    height: 9px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.23, 1, 0.32, 1);
}

.password-requirements li.met .pw-check::before { opacity: 1; }
.password-requirements li.met .pw-check svg { opacity: 1; transform: scale(1); }
.password-requirements li.fail .pw-check { border-color: #ef4444; }

.password-strength__live {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes pwLabelIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .password-strength__seg i,
    .pw-check::before,
    .pw-check svg,
    .password-strength__guess,
    .password-strength {
        transition: none;
    }

    .password-strength__label.is-swap { animation: none; }
}
