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

        <div class="idx11-card">
            <div class="idx11-image-side">
                <div class="idx11-deco-shapes">
                    <div class="idx11-deco-circle idx11-deco-c1"></div>
                    <div class="idx11-deco-circle idx11-deco-c2"></div>
                    <div class="idx11-deco-circle idx11-deco-c3"></div>
                    <div class="idx11-deco-leaf">
                        <i class="bi bi-tree"></i>
                    </div>
                </div>
                <div class="idx11-image-overlay">
                    <div class="idx11-side-icon"><i class="bi bi-shield-lock-fill"></i></div>
                    <h3><?= $setting['heading'] ?></h3>
                    <p><?= strip_tags($setting['content']) ?></p>
                </div>
            </div>
            <div class="idx11-form-side">
                <div class="idx11-form-wrapper">
                    <div class="idx11-header-icon idx11-stagger-1">
                        <i class="bi bi-shield-lock-fill"></i>
                    </div>
                    <h1 class="idx11-title idx11-stagger-2"><?= __('front.login') ?></h1>
                    <p class="idx11-subtitle idx11-stagger-2"><?= __('front.Use_your_credentials_to_login_into_account') ?></p>

                    <form id="login-form" autocomplete="off">
                        <div class="mb-3 idx11-stagger-3">
                            <div class="form-floating idx11-input-group">
                                <input required class="form-control idx11-input" name="username" id="idx11-username" placeholder="<?= __('front.username_email') ?>">
                                <label for="idx11-username"><i class="bi bi-person me-1"></i> <?= __('front.username_email') ?></label>
                            </div>
                        </div>

                        <div class="mb-3 idx11-stagger-3">
                            <div class="form-floating idx11-input-group">
                                <input required class="form-control idx11-input" type="password" name="password" id="idx11-password" placeholder="<?= __('front.password') ?>">
                                <label for="idx11-password"><i class="bi bi-lock me-1"></i> <?= __('front.password') ?></label>
                                <button type="button" class="toggle-password" data-target="#idx11-password" aria-label="Toggle password">
                                    <i class="bi bi-eye"></i>
                                </button>
                            </div>
                        </div>

                        <div class="d-flex justify-content-between align-items-center mb-3 idx11-stagger-4">
                            <div id="login-status-msg"></div>
                            <a href="<?= base_url('forget-password') ?>" class="idx11-link"><?= __('front.forget_password') ?>?</a>
                        </div>

                        <?= render_recaptcha_html('affiliate_login') ?>

                        <div class="d-grid gap-2 idx11-stagger-5">
                            <button class="btn idx11-btn-primary py-3 btn-submit" id="login_button">
                                <i class="bi bi-box-arrow-in-right me-2"></i><?= __('front.login') ?>
                            </button>
                        </div>
                    </form>

                    <?php if(isset($store['registration_status']) && $store['registration_status']==0) {}
                    else if( ($vendor_marketstatus["marketvendorstatus"]==1 || $vendor_storestatus['storestatus']) && $store['registration_status']!=3 ) { ?>
                        <div class="idx11-separator my-3 idx11-stagger-6"><?= __('front.or') ?></div>
                        <div class="d-grid idx11-stagger-6">
                            <a href="<?= base_url('register') ?>" class="btn idx11-btn-outline py-2">
                                <i class="bi bi-person-plus me-1"></i> <?= __('front.create_account') ?>
                            </a>
                        </div>
                    <?php } else if($store['registration_status']!=2){ ?>
                        <div class="idx11-separator my-3 idx11-stagger-6"><?= __('front.or') ?></div>
                        <div class="d-grid idx11-stagger-6">
                            <a href="<?= base_url('register') ?>" class="btn idx11-btn-outline py-2">
                                <i class="bi bi-person-plus me-1"></i> <?= __('front.create_account') ?>
                            </a>
                        </div>
                    <?php } ?>

                    <div class="idx11-trust-footer text-center d-flex justify-content-center gap-3 idx11-stagger-6">
                        <span><i class="bi bi-shield-check me-1"></i> <?= __('front.secure') ?></span>
                        <span><i class="bi bi-lightning-charge me-1"></i> <?= __('front.fast') ?></span>
                        <span><i class="bi bi-patch-check me-1"></i> <?= __('front.trusted') ?></span>
                    </div>
                </div>
            </div>
        </div>

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