/* Parsley Custom Validation Styles */

/* Error state for inputs */
input.parsley-error,
textarea.parsley-error,
select.parsley-error {
    border: 2px solid #dc3545 !important;
    background-color: #fff5f5 !important;
}

/* Success state for inputs */
input.parsley-success,
textarea.parsley-success,
select.parsley-success {
    border: 2px solid #28a745 !important;
    background-color: #f0fff4 !important;
}

/* Error messages container */
.parsley-errors-list {
    display: block;
    margin-top: 5px;
    padding: 0;
    list-style: none;
}

/* Individual error message */
.parsley-error-message {
    display: block;
    color: #dc3545;
    font-size: 13px;
    font-weight: 500;
    margin-top: 5px;
    padding: 5px 10px;
    background-color: #fff5f5;
    border-left: 3px solid #dc3545;
    border-radius: 3px;
}

/* Animation for error messages */
.parsley-errors-list {
    animation: slideDown 0.3s ease-in-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus state for error fields */
input.parsley-error:focus,
textarea.parsley-error:focus {
    outline: none;
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Focus state for success fields */
input.parsley-success:focus,
textarea.parsley-success:focus {
    outline: none;
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Form group spacing */
.form_group {
    position: relative;
    margin-bottom: 20px;
}

/* Status message styling */
#status {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 5px;
    font-weight: 500;
    text-align: center;
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Required field indicator */
label span[style*="color: red"] {
    color: #dc3545 !important;
    font-weight: bold;
}

/* Submit button disabled state */
button[type="submit"]:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* CAPTCHA field specific styling */
#captcha.parsley-error {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Status message with icon */
#status:not(:empty) {
    padding: 12px 15px 12px 45px;
    position: relative;
}

#status:not(:empty)::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
}

/* Success icon */
#status[style*="rgb(40, 167, 69)"]:not(:empty)::before,
#status[style*="#28a745"]:not(:empty)::before {
    content: "✓";
    color: #28a745;
    font-weight: bold;
    font-size: 20px;
}

/* Error icon */
#status[style*="rgb(220, 53, 69)"]:not(:empty)::before,
#status[style*="#dc3545"]:not(:empty)::before {
    content: "✗";
    color: #dc3545;
    font-weight: bold;
    font-size: 20px;
}
