It is not possible to achieve your goal using only CSS. In order to change the background color of a div when an input is focused, you will need to use JavaScript event listeners for the focus and blur events on the input element:
document.querySelector('#input').addEventListener('focus', function(e) {
e.target.closest("#container").classList.add('focus');
})
document.querySelector('#input').addEventListener('blur', function(e) {
e.target.closest("#container").classList.remove('focus');
})
Here is the CSS code to style the div when it is in focus:
#container.focus{
background-color: "red"
}