<?php $__env->startSection('title', 'Login'); ?>
<?php $__env->startSection('content'); ?>

<div class="auth-form-wrap">
    <div class="auth-form-header">
        <h2 class="auth-form-title">Welcome back 👋</h2>
        <p class="auth-form-sub">Sign in to your <?php echo e(optional($settings)->website_name ?? config('app.name')); ?> account to continue.</p>
    </div>

    <form class="auth-form" method="POST" action="<?php echo e(route('user.login.submit')); ?>">
        <?php echo csrf_field(); ?>

        <div class="auth-field">
            <label class="auth-label">Email Address</label>
            <div class="auth-input-wrap">
                <i class="ti ti-mail auth-input-icon"></i>
                <input type="email" name="email" class="form-control" placeholder="you@example.com" value="<?php echo e(old('email')); ?>" required>
            </div>
        </div>

        <div class="auth-field">
            <label class="auth-label">Password</label>
            <div class="auth-input-wrap">
                <i class="ti ti-lock auth-input-icon"></i>
                <input type="password" name="password" id="auth-password" class="form-control" placeholder="Your password" required>
                <button type="button" class="auth-pw-toggle" onclick="togglePw('auth-password', this)">
                    <i class="ti ti-eye"></i>
                </button>
            </div>
        </div>

        <?php if(optional($settings)->recaptcha == 1 && isset($captcha)): ?>
        <div class="auth-field">
            <label class="auth-label">Captcha</label>
            <div class="auth-captcha-row">
                <div class="auth-input-wrap" style="flex:1">
                    <i class="ti ti-shield auth-input-icon"></i>
                    <input type="text" name="captcha" class="form-control" placeholder="Enter captcha" required autocomplete="off">
                </div>
                <span class="captcha-text"><?php echo e($captcha); ?></span>
                <button type="button" class="captcha-refresh" title="Refresh"><i class="ti ti-refresh"></i></button>
            </div>
        </div>
        <?php endif; ?>

        <div class="auth-terms">
            By continuing, you agree to our
            <a href="<?php echo e(route('frontend.terms')); ?>">Terms</a> and
            <a href="<?php echo e(route('frontend.privacy')); ?>">Privacy Policy</a>.
        </div>

        <button type="submit" class="auth-btn">
            <i class="ti ti-login"></i> Sign In
        </button>

        <div class="auth-footer">
            <p class="auth-footer-line">
                Don't have an account?
                <a href="<?php echo e(route('user.register')); ?>" class="auth-footer-link">Create one</a>
            </p>
            <a href="<?php echo e(route('user.forgot-password')); ?>" class="auth-footer-link--block">Forgot your password?</a>
        </div>
    </form>
</div>

<?php if(optional($settings)->recaptcha == 1 && isset($captcha)): ?>
<script>
document.addEventListener('DOMContentLoaded', function () {
    document.querySelector('.captcha-refresh')?.addEventListener('click', function () {
        fetch('<?php echo e(route('user.refresh-captcha')); ?>', {
            headers: { 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content, 'Accept': 'application/json' }
        }).then(r => r.json()).then(d => { if (d.captcha) document.querySelector('.captcha-text').textContent = d.captcha; });
    });
});
</script>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('frontend.layout.auth', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\jjd\socialnum\sstack\mine\core\resources\views/frontend/auth/login.blade.php ENDPATH**/ ?>