One way to make a style sheet only apply within specific div (or any other) tags is by enclosing the code within a div element with a unique ID, such as 'login', and then using #login before each style rule in the CSS file. This will restrict the styles to only be applied within that particular div.
For instance, if your original CSS for login has a line like:
form { border: none; }
it can be modified to:
#login form { border: none; }
This approach would need to be applied to every style rule in the CSS file. It may be an easier solution compared to loading a separate HTML file for the pop-up window without including the main CSS file.