

<?php $__env->startSection('content'); ?>
<div class="login-page py-5" style="background-color: #f8f9fa; min-height: 80vh; display: flex; align-items: center;">
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-5">
                <div class="card border-0 shadow-lg rounded-4 overflow-hidden">
                    <div class="card-body p-5">
                        <div class="text-center mb-4">
                            <div class="d-inline-flex align-items-center justify-content-center bg-primary text-white rounded-circle mb-3" style="width: 60px; height: 60px;">
                                <i class="fas fa-user-lock fs-3"></i>
                            </div>
                            <h2 class="fw-bold">Welcome Back</h2>
                            <p class="text-muted">Please enter your details to sign in</p>
                        </div>

                        <form id="standalone_login_form">
                            <?php echo csrf_field(); ?>
                            <div class="mb-4">
                                <label class="form-label fw-bold">Email Address</label>
                                <div class="input-group">
                                    <span class="input-group-text bg-light border-end-0"><i class="fas fa-envelope text-muted"></i></span>
                                    <input type="email" name="email" class="form-control form-control-lg bg-light border-start-0" placeholder="your@email.com" required>
                                </div>
                            </div>

                            <div class="mb-4">
                                <div class="d-flex justify-content-between">
                                    <label class="form-label fw-bold">Password</label>
                                    <a href="<?php echo e(route('forget.password.get')); ?>" class="small text-decoration-none">Forgot password?</a>
                                </div>
                                <div class="input-group">
                                    <span class="input-group-text bg-light border-end-0"><i class="fas fa-lock text-muted"></i></span>
                                    <input type="password" name="password" class="form-control form-control-lg bg-light border-start-0" placeholder="••••••••" required>
                                </div>
                            </div>

                            <button type="submit" class="btn btn-dark btn-lg w-100 rounded-pill py-3 fw-bold mb-4">
                                Sign In
                            </button>
                        </form>

                        <div class="text-center">
                            <p class="text-muted mb-0">Don't have an account? <a href="#" id="standalone-signup-trigger" class="fw-bold text-decoration-none">Create Account</a></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<?php $__env->startPush('scripts'); ?>
<script>
$(document).ready(function() {
    $('#standalone_login_form').on('submit', function(e) {
        e.preventDefault();
        
        const btn = $(this).find('button[type="submit"]');
        btn.prop('disabled', true).html('<span class="spinner-border spinner-border-sm me-2"></span>Signing in...');

        $.ajax({
            type: 'POST',
            url: "<?php echo e(route('american.plastic.user.login')); ?>",
            data: $(this).serialize(),
            success: function(response) {
                if (response.success) {
                    window.location.href = "<?php echo e(route('american.plastic.web')); ?>";
                } else {
                    toastr.error("Login failed. Please try again.");
                    btn.prop('disabled', false).text('Sign In');
                }
            },
            error: function() {
                toastr.error("Username or password incorrect!", "Error");
                btn.prop('disabled', false).text('Sign In');
            }
        });
    });

    $('#standalone-signup-trigger').on('click', function(e) {
        e.preventDefault();
        // Redirect to home and trigger signup modal
        window.location.href = "<?php echo e(route('american.plastic.web')); ?>?show_modal=register_success";
    });
});
</script>
<?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('web.home.layout.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/amerbofz/public_html/resources/views/web/home/login/login.blade.php ENDPATH**/ ?>