diff --git a/assets/css/auth-forms.css b/assets/css/auth-forms.css new file mode 100644 index 0000000..4b59489 --- /dev/null +++ b/assets/css/auth-forms.css @@ -0,0 +1,164 @@ +/** + * Auth Forms Styles — Anbieter Login Page + * + * Matches the Mentor:innen Login styles from general.css. + * Loaded only on the anbieter-login page to override baked-in inline CSS. + * + * @package DDHH_Job_Manager + */ + +/* ----------------------------------------------- + Layout: two-column container + ----------------------------------------------- */ +.ddhh-auth-container { + display: flex; + gap: 2rem; + margin: 2rem 0; +} + +@media (max-width: 768px) { + .ddhh-auth-container { + flex-direction: column; + } +} + +/* ----------------------------------------------- + Sections: remove gray card backgrounds + ----------------------------------------------- */ +.ddhh-register-section, +.ddhh-login-section { + flex: 1; + padding: 2rem; + background: transparent; + border-radius: 0; + border: none; +} + +.ddhh-register-section h2, +.ddhh-login-section h2 { + margin-top: 0; + margin-bottom: 1.5rem; + color: #333; + font-size: 1.5rem; +} + +/* ----------------------------------------------- + Labels: match Mentor Login (color #333, 18px, bold) + High specificity to override Formidable's + .with_frm_style .frm_primary_label selectors + ----------------------------------------------- */ +.ddhh-auth-container label, +.ddhh-auth-container .frm_forms.with_frm_style .frm_primary_label { + color: #333; + font-size: 18px; + font-weight: 700; + line-height: 18px; + margin-bottom: 0; +} + +/* ----------------------------------------------- + Inputs: match Mentor Login field sizing + ----------------------------------------------- */ +.ddhh-auth-container input[type="text"], +.ddhh-auth-container input[type="email"], +.ddhh-auth-container input[type="password"], +.ddhh-auth-container input[type="url"], +.ddhh-auth-container input[type="tel"], +.ddhh-auth-container select { + width: 100%; + min-height: 40px; + max-width: 350px; + border: 0.0625rem solid; + border-radius: 3px; + padding: 0.1875rem 0.3125rem; + margin: 0 6px 16px 0; + box-sizing: border-box; + font-size: 16px; + line-height: normal; + font-family: "Poppins", Sans, Helvetica, Arial; +} + +/* ----------------------------------------------- + Formidable submit wrapper: override flex-row + so the button stretches to full width + ----------------------------------------------- */ +.ddhh-auth-container .frm_submit.frm_flex { + flex-direction: column; +} + +/* ----------------------------------------------- + Buttons: navy pill with red hover + High specificity to override Formidable's + .frm_style_formidable-style.with_frm_style selectors + ----------------------------------------------- */ +.ddhh-auth-container input[type="submit"], +.ddhh-auth-container button[type="submit"], +.ddhh-auth-container .frm_forms.with_frm_style .frm_submit button.frm_button_submit { + background-color: var(--wp--preset--color--primary, #003063); + border-width: 0; + color: #fff; + font-family: inherit; + font-size: inherit; + line-height: inherit; + padding: 0.4em 1.333em; + border-radius: 100px; + text-decoration: none; + width: 100%; + max-width: 350px; + cursor: pointer; + transition: all 0.7s ease; + box-sizing: border-box; +} + +.ddhh-auth-container input[type="submit"]:hover, +.ddhh-auth-container button[type="submit"]:hover, +.ddhh-auth-container .frm_forms.with_frm_style .frm_submit button.frm_button_submit:hover { + background-color: var(--wp--preset--color--hhred, #E40613); +} + +/* ----------------------------------------------- + wp_login_form() specific: style the

wrappers + ----------------------------------------------- */ +.ddhh-login-section .login-username, +.ddhh-login-section .login-password { + margin-bottom: 20px; +} + +.ddhh-login-section .login-remember, +.ddhh-login-section .login-submit { + margin-bottom: 1rem; +} + +.ddhh-login-section .login-username br, +.ddhh-login-section .login-password br { + display: none; +} + +.ddhh-login-section .login-username label, +.ddhh-login-section .login-password label { + display: block; + font-weight: 700; + margin-bottom: 0; + padding-bottom: 3px; +} + +.ddhh-login-section .login-remember label { + font-weight: 700; +} + +/* ----------------------------------------------- + Passwort vergessen link + ----------------------------------------------- */ +.ddhh-login-section .login-lost-password { + margin-top: 0.75rem; +} + +.ddhh-login-section .login-lost-password a { + color: var(--wp--preset--color--primary, #003063); + text-decoration: underline; + font-size: 0.9em; +} + +.ddhh-login-section .login-lost-password a:hover { + color: var(--wp--preset--color--hhred, #E40613); +} diff --git a/includes/class-pages.php b/includes/class-pages.php index 78eeb86..c40a1c7 100644 --- a/includes/class-pages.php +++ b/includes/class-pages.php @@ -21,6 +21,58 @@ class DDHH_JM_Pages { public static function setup_hooks() { // Redirect logged-in providers from login page to dashboard add_action( 'template_redirect', array( __CLASS__, 'maybe_redirect_logged_in_from_login' ) ); + + // Enqueue auth form styles on anbieter-login page + add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_auth_styles' ) ); + + // Clean up legacy inline styles and inject missing elements on login page + add_filter( 'the_content', array( __CLASS__, 'filter_login_page_content' ) ); + } + + /** + * Enqueue auth form styles on the anbieter-login page + */ + public static function enqueue_auth_styles() { + $login_page_id = get_option( 'ddhh_jm_login_page_id' ); + if ( ! $login_page_id || ! is_page( $login_page_id ) ) { + return; + } + + wp_enqueue_style( + 'ddhh-jm-auth-forms', + DDHH_JM_PLUGIN_URL . 'assets/css/auth-forms.css', + array(), + DDHH_JM_VERSION + ); + } + + /** + * Filter login page content to remove legacy inline styles and inject missing elements + * + * @param string $content Page content. + * @return string Filtered content. + */ + public static function filter_login_page_content( $content ) { + $login_page_id = get_option( 'ddhh_jm_login_page_id' ); + if ( ! $login_page_id || ! is_page( $login_page_id ) ) { + return $content; + } + + // Strip legacy inline '; + // Build page content — styles are loaded via enqueued auth-forms.css + $content = ''; $content .= '

'; @@ -197,6 +191,7 @@ class DDHH_JM_Pages { ); $content .= wp_login_form( $login_args ); + $content .= '

Passwort vergessen?

'; $content .= '
'; $content .= ''; // .ddhh-auth-container diff --git a/includes/class-template.php b/includes/class-template.php index 6a36157..de3a806 100644 --- a/includes/class-template.php +++ b/includes/class-template.php @@ -55,9 +55,16 @@ class DDHH_JM_Template { ← Alle Jobangebote
- -