When I click on the input field, I expect the label to transform but it doesn't. However, using ".user-input:focus, .user-input:valid" changes the input, indicating that it should work with the label as well.
.user-input:focus+.user-label,
.user-input:valid+.user-label {
color: yellow;
transform: translate(10px, -14px) scale(.8);
}
<div class="container">
<div class="input-group">
<label for="user" class="user-label">Username</label>
<input type="text" name="user" class="user-input" required>
</div>
</div>