<?php
/**
 * Template Name: HVAC Community Login
 *
 * This is the custom template for the community login page.
 *
 * @package HVAC_Community_Events
 */

get_header(); ?>

<style>
/* Override theme constraints for login page */
#primary, #main, .content-area, .site-main {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide default page title */
.entry-header {
    display: none !important;
}

/* Ensure full-width wrapper */
.hvac-community-login-wrapper {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    padding: 60px 20px !important;
    min-height: 70vh !important;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
}
</style>

<div id="primary" class="content-area">
    <main id="main" class="site-main" role="main">
        <?php 
        // Process the shortcode directly  
        // First instantiate the login handler class to ensure shortcode is registered
        if (!class_exists('\\HVAC_Community_Events\\Community\\Login_Handler')) {
            require_once HVAC_CE_PLUGIN_DIR . 'includes/community/class-login-handler.php';
        }
        $login_handler = new \HVAC_Community_Events\Community\Login_Handler();
        // Now call the render method directly
        echo $login_handler->render_login_form(array());
        ?>
    </main><!-- #main -->
</div><!-- #primary -->

<?php get_footer(); ?>