<?php
/**
 * Login form template
 *
 * This template can be overridden by copying it to yourtheme/radius-booking/global/form-login.php.
 *
 * @package suspended suspended RadiusBooking\Templates
 * @version 1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}

// Don't show login form if user is already logged in.
if ( is_user_logged_in() ) {
    return;
}

?>
<form class="radius-booking-form radius-booking-form-login" method="post">

    <?php
    /**
     * Fires at the start of the login form.
     *
     * @since 1.0.0
     */
    do_action( 'radius_booking_login_form_start' );
    ?>

    <?php if ( ! empty( $message ) ) : ?>
        <div class="radius-booking-form-message">
            <?php echo wp_kses_post( wpautop( wptexturize( $message ) ) ); ?>
        </div>
    <?php endif; ?>

    <div class="radius-booking-form-row radius-booking-form-row--username">
        <label for="radius-booking-login-username" class="radius-booking-form-label">
            <?php esc_html_e( 'Username or Email', 'radius-booking' ); ?>
            <span class="radius-booking-required" aria-hidden="true">*</span>
            <span class="screen-reader-text"><?php esc_html_e( 'Required', 'radius-booking' ); ?></span>
        </label>

        <div class="radius-booking-input-wrapper">
            <input
                    type="text"
                    class="radius-booking-input radius-booking-input--text"
                    name="username"
                    id="radius-booking-login-username"
                    autocomplete="username"
                    required
                    aria-required="true"
            />
        </div>
    </div>

    <div class="radius-booking-form-row radius-booking-form-row--password">
        <label for="radius-booking-login-password" class="radius-booking-form-label">
            <?php esc_html_e( 'Password', 'radius-booking' ); ?>
            <span class="radius-booking-required" aria-hidden="true">*</span>
            <span class="screen-reader-text"><?php esc_html_e( 'Required', 'radius-booking' ); ?></span>
        </label>

        <div class="radius-booking-input-wrapper radius-booking-password-wrapper">
            <input
                    type="password"
                    class="radius-booking-input radius-booking-input--password"
                    name="password"
                    id="radius-booking-login-password"
                    autocomplete="current-password"
                    required
                    aria-required="true"
            />

            <button type="button" class="radius-booking-password-toggle" aria-label="<?php esc_attr_e( 'Toggle password visibility', 'radius-booking' ); ?>">
				<span class="radius-booking-icon radius-booking-icon--eye-open" aria-hidden="true">
					<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
						<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
						<circle cx="12" cy="12" r="3"></circle>
					</svg>
				</span>
                <span class="radius-booking-icon radius-booking-icon--eye-closed" aria-hidden="true" style="display:none;">
					<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
						<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path>
						<line x1="1" y1="1" x2="23" y2="23"></line>
					</svg>
				</span>
            </button>
        </div>
    </div>

    <?php
    /**
     * Fires within the login form, after the password field.
     *
     * @since 1.0.0
     */
    do_action( 'radius_booking_login_form' );
    ?>

    <div class="radius-booking-form-row radius-booking-form-row--options">
        <label for="radius-booking-rememberme" class="radius-booking-checkbox-label">
            <input
                    type="checkbox"
                    class="radius-booking-input radius-booking-input--checkbox"
                    name="rememberme"
                    id="radius-booking-rememberme"
                    value="forever"
            />
            <span class="radius-booking-checkbox-mark">
				<svg width="12" height="10" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg">
					<path d="M1 5L4.5 8.5L11 1" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
				</svg>
			</span>
            <span class="radius-booking-checkbox-text"><?php esc_html_e( 'Remember me', 'radius-booking' ); ?></span>
        </label>

        <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" class="radius-booking-forgot-password">
            <?php esc_html_e( 'Forgot password?', 'radius-booking' ); ?>
        </a>
    </div>

    <div class="radius-booking-form-row radius-booking-form-row--submit">
        <?php wp_nonce_field( 'radius-booking-login', 'radius_booking_login_nonce' ); ?>
        <input type="hidden" name="action" value="radius_booking_login" />
        <input type="hidden" name="redirect_to" value="<?php echo esc_url( $redirect_to ); ?>" />

        <button type="submit" class="radius-booking-button radius-booking-button--primary radius-booking-button--login" name="login">
            <span class="radius-booking-button-text"><?php esc_html_e( 'Log In', 'radius-booking' ); ?></span>
            <span class="radius-booking-button-loader" aria-hidden="true"></span>
        </button>
    </div>
    <?php
    if($registration_enable){
        ?>
        <div class="radius-booking-form-row radius-booking-form-row--switch">
            <p class="radius-booking-form-switch">
                <?php esc_html_e( "Don't have an account?", 'radius-booking' ); ?>
                <a href="#" class="radius-booking-show-signup-form">
                    <?php esc_html_e( 'Sign Up', 'radius-booking' ); ?>
                </a>
            </p>
        </div>
    <?php
    }
    ?>


    <?php
    /**
     * Fires at the end of the login form.
     *
     * @since 1.0.0
     */
    do_action( 'radius_booking_login_form_end' );
    ?>

</form>