I needed the same behavior in another project and solved it this way:
Fedor, because your css doesn't know the emptyness of an input field, you need some additional js that resets the css class of an input field when it's empty. Then you can do something like:
.yourcssclass .input {
background-color: #000 !important;
}
So you need js to set a new css-class when the input field is empty. As far as I know you need a new input field widget for this. Basically a skilled jscripter have to reuse the input field widget and modify this one with your needs :)
No, this is currently not possible as there is no hook for the CSS to know if it is empty or not.
You would need to use javascript to check if it's empty and set a class to apply CSS styling befitting the current status.