I'm currently utilizing bootstrap 5 to craft a form featuring floating input functionality. Below is an example of the input I am utilizing:
<div class="form-floating mx-auto mb-3 w-25">
<input type="text" class="form-control" id="username_field" placeholder=" " />
<label for="username_field" class="form-label">Username</label>
</div>
This code snippet produces a floating input element as shown in the following image: floating input I am seeking a way to alter the label color when the input is selected, utilizing only CSS if feasible.