how to make popover responsive?

I have configured popover for signup. I am using gravityform inside the popup. But theres some issue with this popup:
1. When I reduce browser for abour 400-500px the width of the popup increases without being reduced.
2. When I reduce the width more the text box for email decreases in height.

What I did for solve these issue:
1. I used media query to hide #darkbackground and .visiblebox for browser width less then 480px. But it did not work. May be because there's some inline css dynamically generated.

@media screen and (max-width:480px) {
#darkbackground {
visibility: hidden;
.visiblebox {
visibility: hidden;
h1 {
border:1px solid #333;
The h1 part works.