<?php $__env->startSection('title', 'تأیید کد ورود'); ?>

<?php $__env->startSection('content'); ?>
<div class="digi-auth-wrap">

    <div class="digi-auth-logo">
        <a href="<?php echo e(route('home')); ?>">
            <img src="<?php echo e($siteLogo); ?>" width="160" alt="">
        </a>
    </div>

    <div class="digi-auth-card">
        <p class="digi-auth-card-title">کد تأیید را وارد کنید</p>
        <p class="digi-auth-card-desc">کد ۵ رقمی ارسال‌شده به <strong><?php echo e($mobile); ?></strong> را وارد کنید.</p>

        <?php if($errors->has('code')): ?>
            <div class="alert alert-danger digi-auth-alert" role="alert"><?php echo e($errors->first('code')); ?></div>
        <?php endif; ?>

        <?php if($errors->has('resend')): ?>
            <div class="alert alert-warning digi-auth-alert" role="alert"><?php echo e($errors->first('resend')); ?></div>
        <?php endif; ?>

        <?php if(session('resent')): ?>
            <div class="alert alert-success digi-auth-alert" role="alert">کد جدید ارسال شد.</div>
        <?php endif; ?>

        <form method="POST" action="<?php echo e(route('otp.verify')); ?>">
            <?php echo csrf_field(); ?>

            <div id="otp-input">
                <input placeholder="_" type="number" step="1" min="0" max="9" autocomplete="off" pattern="\d*" />
                <input placeholder="_" type="number" step="1" min="0" max="9" autocomplete="off" pattern="\d*" />
                <input placeholder="_" type="number" step="1" min="0" max="9" autocomplete="off" pattern="\d*" />
                <input placeholder="_" type="number" step="1" min="0" max="9" autocomplete="off" pattern="\d*" />
                <input placeholder="_" type="number" step="1" min="0" max="9" autocomplete="off" pattern="\d*" />
                <input id="otp-value" type="hidden" name="code" />
            </div>

            <?php if($hourlyUsed < 5): ?>
                <div class="countDownContainer">
                    <div class="countdown-bar" id="countdownB">
                        <div></div>
                        <div></div>
                    </div>
                </div>
            <?php else: ?>
                <p class="text-danger text-center small mt-3 mb-0">حداکثر ۵ بار در ساعت می‌توانید کد دریافت کنید.</p>
            <?php endif; ?>

            <button type="submit" id="submit" class="digi-auth-btn">ورود</button>
        </form>

        <a href="<?php echo e(route('otp.login')); ?>" class="digi-auth-secondary-link">تغییر شماره موبایل</a>
    </div>

    <p class="digi-auth-terms">
        با ورود به سایت، <a href="#">شرایط و قوانین</a> و <a href="#">قوانین حریم خصوصی</a> را می‌پذیرید.
    </p>

</div>

<form id="resend-form" action="<?php echo e(route('otp.resend')); ?>" method="POST" class="d-none"><?php echo csrf_field(); ?></form>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script src="<?php echo e(asset('theme/assets/plugin/otp-sms/otp-input.js')); ?>"></script>
<script src="<?php echo e(asset('theme/assets/plugin/otp-loader/script.js')); ?>"></script>
<?php if($hourlyUsed < 5): ?>
<script>
    $(document).ready(function () {
        <?php if($cooldown > 0): ?>
            countdown('countdownB', 0, 0, 0, <?php echo e($cooldown); ?>);
        <?php else: ?>
            $('#countdownB div:nth-of-type(2)').html(
                "<span class='otp-resend-trigger' style='color:#e31f26;font-weight:700;cursor:pointer;margin-top:10px;display:block;text-align:center;'>ارسال مجدد کد</span>"
            );
            $('.countdown-bar').css({'width':'250px','height':'2px','margin':'30px auto'});
        <?php endif; ?>
        $(document).on('click', '.otp-resend-trigger', function () {
            $('#resend-form').submit();
        });
    });
</script>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('site.layouts.auth-layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/louishop/public_html/engine/resources/views/auth/otp-verify-login.blade.php ENDPATH**/ ?>