/* Form Error Styling */
.form-control.is-invalid,
.form-select.is-invalid,
textarea.is-invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus,
textarea.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
    animation: fadeIn 0.3s ease-in-out;
}

/* Add error state to form groups */
.form-group.has-error {
    margin-bottom: 1rem;
}

/* Add error state to form rows */
.row.has-error {
    margin-bottom: 1rem;
}

/* Add error state to form columns */
.col.has-error {
    margin-bottom: 1rem;
}

/* Add error state to form labels */
label.has-error {
    color: #dc3545;
}

/* Add error state to form inputs */
input.has-error,
select.has-error,
textarea.has-error {
    border-color: #dc3545;
    background-color: #fff8f8;
}

/* Add error state to form inputs on focus */
input.has-error:focus,
select.has-error:focus,
textarea.has-error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Add error state to form inputs on hover */
input.has-error:hover,
select.has-error:hover,
textarea.has-error:hover {
    border-color: #dc3545;
}

/* Add error state to form inputs on active */
input.has-error:active,
select.has-error:active,
textarea.has-error:active {
    border-color: #dc3545;
}

/* Add error state to form inputs on disabled */
input.has-error:disabled,
select.has-error:disabled,
textarea.has-error:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

/* Add error state to form inputs on readonly */
input.has-error[readonly],
select.has-error[readonly],
textarea.has-error[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

/* Add error state to form inputs on required */
input.has-error[required],
select.has-error[required],
textarea.has-error[required] {
    border-color: #dc3545;
}

/* Add error state to form inputs on required and valid */
input.has-error[required]:valid,
select.has-error[required]:valid,
textarea.has-error[required]:valid {
    border-color: #198754;
}

/* Add error state to form inputs on required and invalid */
input.has-error[required]:invalid,
select.has-error[required]:invalid,
textarea.has-error[required]:invalid {
    border-color: #dc3545;
}

/* Add error state to form inputs on required and valid and touched */
input.has-error[required]:valid:not(:placeholder-shown),
select.has-error[required]:valid:not(:placeholder-shown),
textarea.has-error[required]:valid:not(:placeholder-shown) {
    border-color: #198754;
}

/* Add error state to form inputs on required and invalid and touched */
input.has-error[required]:invalid:not(:placeholder-shown),
select.has-error[required]:invalid:not(:placeholder-shown),
textarea.has-error[required]:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
}

/* Add error state to form inputs on required and valid and touched and focused */
input.has-error[required]:valid:not(:placeholder-shown):focus,
select.has-error[required]:valid:not(:placeholder-shown):focus,
textarea.has-error[required]:valid:not(:placeholder-shown):focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

/* Add error state to form inputs on required and invalid and touched and focused */
input.has-error[required]:invalid:not(:placeholder-shown):focus,
select.has-error[required]:invalid:not(:placeholder-shown):focus,
textarea.has-error[required]:invalid:not(:placeholder-shown):focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Add error state to form inputs on required and valid and touched and focused and hovered */
input.has-error[required]:valid:not(:placeholder-shown):focus:hover,
select.has-error[required]:valid:not(:placeholder-shown):focus:hover,
textarea.has-error[required]:valid:not(:placeholder-shown):focus:hover {
    border-color: #198754;
}

/* Add error state to form inputs on required and invalid and touched and focused and hovered */
input.has-error[required]:invalid:not(:placeholder-shown):focus:hover,
select.has-error[required]:invalid:not(:placeholder-shown):focus:hover,
textarea.has-error[required]:invalid:not(:placeholder-shown):focus:hover {
    border-color: #dc3545;
}

/* Add error state to form inputs on required and valid and touched and focused and active */
input.has-error[required]:valid:not(:placeholder-shown):focus:active,
select.has-error[required]:valid:not(:placeholder-shown):focus:active,
textarea.has-error[required]:valid:not(:placeholder-shown):focus:active {
    border-color: #198754;
}

/* Add error state to form inputs on required and invalid and touched and focused and active */
input.has-error[required]:invalid:not(:placeholder-shown):focus:active,
select.has-error[required]:invalid:not(:placeholder-shown):focus:active,
textarea.has-error[required]:invalid:not(:placeholder-shown):focus:active {
    border-color: #dc3545;
}

/* Add error state to form inputs on required and valid and touched and focused and disabled */
input.has-error[required]:valid:not(:placeholder-shown):focus:disabled,
select.has-error[required]:valid:not(:placeholder-shown):focus:disabled,
textarea.has-error[required]:valid:not(:placeholder-shown):focus:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

/* Add error state to form inputs on required and invalid and touched and focused and disabled */
input.has-error[required]:invalid:not(:placeholder-shown):focus:disabled,
select.has-error[required]:invalid:not(:placeholder-shown):focus:disabled,
textarea.has-error[required]:invalid:not(:placeholder-shown):focus:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

/* Add error state to form inputs on required and valid and touched and focused and readonly */
input.has-error[required]:valid:not(:placeholder-shown):focus[readonly],
select.has-error[required]:valid:not(:placeholder-shown):focus[readonly],
textarea.has-error[required]:valid:not(:placeholder-shown):focus[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

/* Add error state to form inputs on required and invalid and touched and focused and readonly */
input.has-error[required]:invalid:not(:placeholder-shown):focus[readonly],
select.has-error[required]:invalid:not(:placeholder-shown):focus[readonly],
textarea.has-error[required]:invalid:not(:placeholder-shown):focus[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 