diff --git a/app/assets/javascripts/discourse/app/templates/login.hbs b/app/assets/javascripts/discourse/app/templates/login.hbs
index 9c235fe38c3..b04c4640238 100644
--- a/app/assets/javascripts/discourse/app/templates/login.hbs
+++ b/app/assets/javascripts/discourse/app/templates/login.hbs
@@ -6,7 +6,7 @@
}}
{{hide-application-header-buttons "search" "login" "signup" "menu"}}
{{hide-application-sidebar}}
-
+ {{body-class "login-page"}}
diff --git a/app/assets/javascripts/discourse/app/templates/signup.hbs b/app/assets/javascripts/discourse/app/templates/signup.hbs
index 8082ad61db4..2bd6d197e13 100644
--- a/app/assets/javascripts/discourse/app/templates/signup.hbs
+++ b/app/assets/javascripts/discourse/app/templates/signup.hbs
@@ -1,7 +1,7 @@
{{! template-lint-disable no-duplicate-id }}
{{hide-application-header-buttons "search" "login" "signup" "menu"}}
{{hide-application-sidebar}}
-
+{{body-class "signup-page"}}
diff --git a/app/assets/stylesheets/common/base/login-signup-page.scss b/app/assets/stylesheets/common/base/login-signup-page.scss
index 038f4efd8aa..e8e38ebf406 100644
--- a/app/assets/stylesheets/common/base/login-signup-page.scss
+++ b/app/assets/stylesheets/common/base/login-signup-page.scss
@@ -9,14 +9,17 @@
flex-direction: column;
}
-#main-outlet:has(.login-fullpage, .signup-fullpage, .invites-show) {
+body.login-page,
+body.signup-page,
+body.invite-page {
& ~ .powered-by-discourse,
.above-main-container-outlet {
display: none;
}
}
-body:has(.login-fullpage, .signup-fullpage) {
+body.login-page,
+body.signup-page {
background-color: var(--secondary);
}