<?php
/**
 * Login form template
 *
 * @link       https://yourwebsite.com
 * @since      1.0.0
 *
 * @package    Subscription_System
 * @subpackage Subscription_System/public/partials
 */
?>

<div class="subscription-system-form-container">
    <div class="subscription-system-form-header">
        <h2>Login to Your Account</h2>
        <p>Enter your credentials to access your account.</p>
    </div>
    
    <div class="subscription-system-message-container"></div>
    
    <form id="subscription-system-login-form" class="subscription-system-form">
        <div class="form-row">
            <div class="form-group">
                <label for="username_email">Username or Email *</label>
                <input type="text" id="username_email" name="username_email" class="form-control" required>
            </div>
        </div>
        
        <div class="form-row">
            <div class="form-group">
                <label for="password">Password *</label>
                <div class="password-field-container">
                    <input type="password" id="password" name="password" class="form-control" required>
                    <span class="password-toggle" data-target="password">👁️</span>
                </div>
            </div>
        </div>
        
        <div class="form-row">
            <div class="form-group remember-me">
                <input type="checkbox" id="remember" name="remember" value="1">
                <label for="remember">Remember Me</label>
            </div>
        </div>
        
        <div class="form-row">
            <div class="form-group">
                <button type="submit" class="subscription-system-submit-btn">Login</button>
            </div>
        </div>
        
        <div class="subscription-system-form-footer">
            <?php
            // Get register page
            $register_page_id = get_option('register_page', 0);
            $register_url = $register_page_id ? get_permalink($register_page_id) : '#';
            
            // Get forgot password page
            $forgot_password_page_id = get_option('subscription_reset_password_page', 0);
            $forgot_password_url = $forgot_password_page_id ? get_permalink($forgot_password_page_id) : wp_lostpassword_url();
            ?>
            <p>Don't have an account? <a href="<?php echo esc_url($register_url); ?>">Register here</a></p>
            <p><a href="<?php echo esc_url($forgot_password_url); ?>">Forgot Password?</a></p>
        </div>
        
        <?php wp_nonce_field('subs_sys_login_nonce', 'subs_sys_login_nonce'); ?>
    </form>
</div> 