/* Validation Error Styling for Yii2 ActiveForm */
/* Bootstrap Danger Color Scheme */

/* Invalid feedback messages */
/*
.invalid-feedback {
    display: block !important;
    visibility: visible !important;
    width: 100%;
    margin-top: 8px;
    margin-bottom: 5px;
    font-size: 13px;
    color: #fff !important;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: 500;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    border-left: 4px solid #bd2130;
}
*/
/* Arrow pointer for error message */
/*
.invalid-feedback:before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #dc3545;
}
*/
/* Error state for form fields */
.has-error .form-control,
.has-error .input-text,
.is-invalid {
    border-color: #dc3545 !important;
    background-color: #fff8f8 !important;
    box-shadow: 0 0 0 0.1rem rgba(220, 53, 69, 0.1) !important;
}

/* Error state focus */
.has-error .form-control:focus,
.has-error .input-text:focus,
.is-invalid:focus {
    border-color: #dc3545 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
    outline: none !important;
}

/* Help block for errors - Bootstrap Danger */
.help-block {
    display: block !important;
    visibility: visible !important;
    margin-top: 8px;
    margin-bottom: 5px;
    font-size: 13px;
    color: #fff !important;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    border-left: 4px solid #bd2130;
}

/* Help block error specific */
.help-block-error {
    display: block !important;
    visibility: visible !important;
    color: #fff !important;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 8px;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* Error icon for input fields - Bootstrap Danger */
.has-error .input-with-icon-left i,
.has-error .input-with-icon i {
    color: #dc3545 !important;
}

/* Alert style error messages */
.alert-danger {
    color: #721c24 !important;
    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;
}

/* Bootstrap text danger */
.text-danger {
    color: #dc3545 !important;
}

/* Bootstrap border danger */
.border-danger {
    border-color: #dc3545 !important;
}

/* Success state - Bootstrap Success */
.has-success .form-control,
.has-success .input-text {
    border-color: #28a745 !important;
    background-color: #f8fff9 !important;
}

.has-success .form-control:focus,
.has-success .input-text:focus {
    border-color: #28a745 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* Form group spacing with errors */
.has-error {
    margin-bottom: 1rem;
}

/* Hide default browser validation tooltips */
input:invalid {
    box-shadow: none;
}

/* Field error styling for Yii2 - Bootstrap Danger */
.field-loginform-username.has-error .form-control,
.field-loginform-username.has-error .input-text,
.field-loginform-password.has-error .form-control,
.field-loginform-password.has-error .input-text,
.field-signupform-username.has-error .form-control,
.field-signupform-username.has-error .input-text,
.field-signupform-email.has-error .form-control,
.field-signupform-email.has-error .input-text,
.field-signupform-password.has-error .form-control,
.field-signupform-password.has-error .input-text {
    border-color: #dc3545 !important;
    background-color: #fff8f8 !important;
}

/* Field success styling - Bootstrap Success */
.field-loginform-username.has-success .input-text,
.field-loginform-password.has-success .input-text,
.field-signupform-username.has-success .input-text,
.field-signupform-email.has-success .input-text,
.field-signupform-password.has-success .input-text {
    border-color: #28a745 !important;
    background-color: #f8fff9 !important;
}

/* Error text visibility */
.invalid-feedback,
.help-block-error {
/*    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;*/
    color: #721c24 !important;
/*    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;*/
}

/* Animation for error appearance */
@keyframes fadeInError {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.invalid-feedback,
.help-block {
    animation: fadeInError 0.3s ease-in-out;
}
