<?php include_once "header.php"; ?>

                    <!-- Header -->
                    <div class="mb-4 idx2-stagger-1">
                        <div class="idx2-header-icon">
                            <i class="bi bi-box-arrow-in-right"></i>
                        </div>
                        <h2 class="idx2-title"><?= __('front.login') ?></h2>
                        <p class="idx2-subtitle"><?= __('front.welcome_back_sign_in') ?></p>
                    </div>

                    <!-- Nav Pills -->
                    <ul class="nav nav-pills idx2-nav-pills justify-content-center mb-4 idx2-stagger-2" role="tablist">
                        <li class="nav-item flex-fill">
                            <a class="nav-link active" href="<?= base_url() ?>">
                                <i class="bi bi-box-arrow-in-right me-1"></i><?= __('front.login') ?>
                            </a>
                        </li>
                        <?php
                            if (isset($store['registration_status']) && $store['registration_status'] != 0) {
                                if (($vendor_marketstatus["marketvendorstatus"] == 1 || $vendor_storestatus['storestatus']) && $store['registration_status'] != 3) {
                                    echo '<li class="nav-item flex-fill">
                                            <a class="nav-link" href="'. base_url('register') .'">
                                                <i class="bi bi-person-plus me-1"></i>'. __('front.register') .'
                                            </a>
                                          </li>';
                                }
                            } else if ($store['registration_status'] != 2) {
                                echo '<li class="nav-item flex-fill">
                                        <a class="nav-link" href="'. base_url('register') .'">
                                            <i class="bi bi-person-plus me-1"></i>'. __('front.register') .'
                                        </a>
                                      </li>';
                            }
                        ?>
                    </ul>

                    <!-- Login Form -->
                    <form id="login-form">
                        <!-- Username -->
                        <div class="form-floating idx2-input-group mb-4 idx2-stagger-3">
                            <input type="text"
                                   class="form-control idx2-input"
                                   id="username"
                                   name="username"
                                   placeholder="<?= __('front.enter_username_email') ?>"
                                   required>
                            <label for="username">
                                <i class="bi bi-person-circle me-2"></i><?= __('front.username_email') ?>
                            </label>
                        </div>

                        <!-- Password -->
                        <div class="form-floating idx2-input-group mb-4 position-relative idx2-stagger-4">
                            <input type="password"
                                   class="form-control idx2-input"
                                   id="password"
                                   name="password"
                                   placeholder="<?= __('front.password') ?>"
                                   required>
                            <label for="password">
                                <i class="bi bi-shield-lock me-2"></i><?= __('front.password') ?>
                            </label>
                            <button type="button"
                                    class="btn btn-sm toggle-password"
                                    tabindex="-1"
                                    aria-label="Toggle Password Visibility">
                                <i class="bi bi-eye"></i>
                            </button>
                        </div>

                        <!-- Status Message -->
                        <div class="mb-3 text-center" id="login-status-msg"></div>

                        <!-- reCAPTCHA -->
                        <div class="mb-4 idx2-stagger-5">
                            <?= render_recaptcha_html('affiliate_login') ?>
                        </div>

                        <!-- Login Button -->
                        <div class="d-grid mb-3 idx2-stagger-5">
                            <button type="submit"
                                    id="login_button"
                                    class="btn idx2-btn-primary btn-lg py-3">
                                <i class="bi bi-box-arrow-in-right me-2"></i><?= __('front.login') ?>
                            </button>
                        </div>

                        <!-- Forgot Password -->
                        <div class="text-center idx2-stagger-6">
                            <a href="<?= base_url('forget-password') ?>" class="idx2-link">
                                <i class="bi bi-question-circle me-1"></i><?= __('front.forget_password') ?>?
                            </a>
                        </div>
                    </form>

                    <!-- Trust Footer -->
                    <div class="idx2-trust-footer text-center idx2-stagger-6">
                        <small>
                            <i class="bi bi-shield-check me-1"></i><?= __('front.your_information_secure') ?>
                        </small>
                    </div>

<?php include_once "footer.php"; ?>
