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

<div class="auth-form-wrap">
    <div class="auth-form-header">
        <h2 class="auth-form-title">Create your account ✨</h2>
        <p class="auth-form-sub">Join <?php echo e(optional($settings)->website_name ?? config('app.name')); ?> and get started in seconds.</p>
    </div>

    <form class="auth-form" method="POST" action="<?php echo e(route('user.register.submit', ['referrer_id' => $referralId ?? null])); ?>" enctype="multipart/form-data">
        <?php echo csrf_field(); ?>

        <div class="auth-grid">
            <div class="auth-field">
                <label class="auth-label">First Name</label>
                <div class="auth-input-wrap">
                    <i class="ti ti-user auth-input-icon"></i>
                    <input type="text" name="fname" class="form-control" placeholder="John" value="<?php echo e(old('fname')); ?>" required>
                </div>
            </div>
            <div class="auth-field">
                <label class="auth-label">Last Name</label>
                <div class="auth-input-wrap">
                    <i class="ti ti-user auth-input-icon"></i>
                    <input type="text" name="lname" class="form-control" placeholder="Doe" value="<?php echo e(old('lname')); ?>" required>
                </div>
            </div>
        </div>

        <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">Phone Number <span style="color:var(--text-secondary);font-weight:400">(optional)</span></label>
            <div class="auth-input-wrap">
                <i class="ti ti-phone auth-input-icon"></i>
                <input type="tel" name="phone" class="form-control" placeholder="+1 234 567 8900" value="<?php echo e(old('phone')); ?>">
            </div>
        </div>

        <div class="auth-grid">
            <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="Min 8 characters" required>
                    <button type="button" class="auth-pw-toggle" onclick="togglePw('auth-password', this)">
                        <i class="ti ti-eye"></i>
                    </button>
                </div>
            </div>
            <div class="auth-field">
                <label class="auth-label">Confirm Password</label>
                <div class="auth-input-wrap">
                    <i class="ti ti-lock auth-input-icon"></i>
                    <input type="password" name="password_confirmation" id="auth-password-confirm" class="form-control" placeholder="Repeat password" required>
                    <button type="button" class="auth-pw-toggle" onclick="togglePw('auth-password-confirm', this)">
                        <i class="ti ti-eye"></i>
                    </button>
                </div>
            </div>
        </div>

        <div class="auth-field">
            <label class="auth-label">Referrer ID <span style="color:var(--text-secondary);font-weight:400">(optional)</span></label>
            <div class="auth-input-wrap">
                <i class="ti ti-users auth-input-icon"></i>
                <input type="number" min="1" name="reffered_by" class="form-control" placeholder="Enter referrer ID" value="<?php echo e(old('reffered_by', $referralId ?? request('reffered_by'))); ?>">
            </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 creating an account, you agree to our
            <a href="<?php echo e(route('frontend.terms')); ?>">Terms of Service</a> and
            <a href="<?php echo e(route('frontend.privacy')); ?>">Privacy Policy</a>.
        </div>

        <button type="submit" class="auth-btn">
            <i class="ti ti-user-plus"></i> Create Account
        </button>

        <div class="auth-footer">
            <p class="auth-footer-line">
                Already have an account?
                <a href="<?php echo e(route('user.login.page')); ?>" class="auth-footer-link">Sign in</a>
            </p>
        </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/register.blade.php ENDPATH**/ ?>