/**
 * Password validation feedback styles
 * Shows visual feedback for password requirements
 */

/* Password requirements list styling */
#password-requirements {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

#password-requirements li {
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
    line-height: 1.6;
}

/* Icon/checkmark before each requirement */
#password-requirements li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.15rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 2px solid #8d8b9f;
    background-color: transparent;
    transition: all 0.3s ease;
}

/* Invalid state (red X) */
#password-requirements li.invalid {
    color: #ff5757;
}

#password-requirements li.invalid::before {
    border-color: #ff5757;
    background-color: #ff5757;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="white"><path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/></svg>');
    background-size: 0.875rem;
    background-repeat: no-repeat;
    background-position: center;
}

/* Valid state (green checkmark) */
#password-requirements li.valid {
    color: #28a745;
}

#password-requirements li.valid::before {
    border-color: #28a745;
    background-color: #28a745;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="white"><path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/></svg>');
    background-size: 1rem;
    background-repeat: no-repeat;
    background-position: center;
}

/* Smooth animations */
@media (prefers-reduced-motion: no-preference) {
    #password-requirements li::before {
        animation-duration: 0.3s;
        animation-timing-function: ease-out;
        animation-fill-mode: both;
    }

    #password-requirements li.valid::before {
        animation-name: checkmark-pop;
    }

    #password-requirements li.invalid::before {
        animation-name: x-shake;
    }
}

@keyframes checkmark-pop {
    0% {
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes x-shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
}
