UPDATE: Thanks to @Renato’s comment, according to https://github.com/w3c/csswg-drafts/issues/2257, the drop pseudo-class has been dropped now.
There is :drop and :drop() pseudo-class, which is currently in Working Draft status.
According to [moderator: link to spam removed], the browser support is not good.
For “file being dropped is not accepted” case, :drop(invalid active) is expected to work, in future.