<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title class="nombreEmpresa"></title>
<meta content="" name="description">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="<?php echo asset('assets/img/favicon.png'); ?>" rel="icon">
<link href="<?php echo asset('assets/img/apple-touch-icon.png'); ?>" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.gstatic.com" rel="preconnect">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Nunito:300,300i,400,400i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="<?php echo asset('assets/vendor/bootstrap/css/bootstrap.min.css'); ?>" rel="stylesheet">
<link href="<?php echo asset('assets/vendor/bootstrap-icons/bootstrap-icons.css'); ?>" rel="stylesheet">
<link href="<?php echo asset('assets/vendor/boxicons/css/boxicons.min.css'); ?>" rel="stylesheet">
<link href="<?php echo asset('assets/vendor/quill/quill.snow.css'); ?>" rel="stylesheet">
<link href="<?php echo asset('assets/vendor/quill/quill.bubble.css'); ?>" rel="stylesheet">
<link href="<?php echo asset('assets/vendor/remixicon/remixicon.css'); ?>" rel="stylesheet">
<link href="<?php echo asset('assets/vendor/simple-datatables/style.css'); ?>" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="<?php echo asset('assets/css/style.css'); ?>" rel="stylesheet">
<script src="https://www.google.com/recaptcha/enterprise.js?render=6LeZJekqAAAAAGBUN6c4Cl9pAdsiZD3B4CIkGNO2"></script>
</head>
<body>
<main>
<div class="container">
    <section class="section register min-vh-100 d-flex flex-column align-items-center justify-content-center py-4">
    <div class="container">
        <div class="row justify-content-center">
        <div class="col-lg-4 col-md-6 d-flex flex-column align-items-center justify-content-center">
            <div class="d-flex justify-content-center py-4">
            <a href="index.html" class="logo d-flex align-items-center w-auto">
                <img  class="logo_empresa"  alt="logo">
                <span class="d-none d-lg-block"></span>
            </a>
            </div><!-- End Logo -->
            <div class="card mb-3">
            <div class="card-body">
                <div class="pt-4 pb-2">
                <h5 class="card-title text-center pb-0 fs-4">Ingresa tu cuenta</h5>
                <p class="text-center small">Customer Relationship Management</p>
                </div>
                <form class="row g-3 needs-validation" action="<?php echo e(route('login')); ?>" method="POST" novalidate id="miFormulario">
                <?php echo csrf_field(); ?>
                <div class="col-12">
                <label for="yourUsername" class="form-label">Correo electrónico</label>
                    <div class="input-group has-validation">
                        <span class="input-group-text" id="inputGroupPrepend">@</span>
                        <input type="email" name="email" class="form-control" id="yourUsername" required>
                        <div class="invalid-feedback">¡Por favor ingresa tu correo electrónico!</div>
                    </div>
                </div>
                <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <span class="invalid-feedback" role="alert">
                        <strong><?php echo e($message); ?></strong>
                    </span>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                <div class="col-12">
                    <label for="yourPassword" class="form-label">Contraseña</label>
                    <input type="password" name="password" class="form-control" id="yourPassword" required>
                    <div class="invalid-feedback">¡Por favor ingresa tu contraseña!</div>
                </div>
                <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <span class="invalid-feedback" role="alert">
                        <strong><?php echo e($message); ?></strong>
                    </span>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                <div class="col-12">
                    <div class="form-check">
                    <input class="form-check-input" type="checkbox" name="remember" value="true" id="rememberMe">
                    <label class="form-check-label" for="rememberMe">Recordar mi usuario</label>
                    </div>
                </div>
                <input type="hidden" name="g-recaptcha-response" id="recaptchaResponse">
                <div class="col-12">
                    <button class="btn btn-primary w-100" type="button" onclick="onSubmit()">Acceder</button>
                </div>
                <?php if($mensaje = Session::get('error')): ?>
                    <div class="alert alert-danger text-center" role="alert"><?php echo e($mensaje); ?></div>
                <?php endif; ?>
                <div class="col-12">
                    <p class="small mb-0">¿Aun no tienes una cuenta? <a href="<?php echo e(route('register')); ?>">Registrarse</a></p>
                </div>
                </form>
            </div>
            </div>
            <div class="credits">
                Desarrollado por  <a href="">Corporativo Loruna</a>
            </div>
        </div>
        </div>
    </div>
    </section>
</div>
</main>
    <script>
    function onSubmit() {
        grecaptcha.enterprise.ready(function() {
            grecaptcha.enterprise.execute('6LeZJekqAAAAAGBUN6c4Cl9pAdsiZD3B4CIkGNO2', {action: 'submit'}).then(function(token) {
                // Envía el token al backend para su validación
                document.getElementById('recaptchaResponse').value = token;
                document.getElementById('miFormulario').submit(); // Envía el formulario
            });
        });
    }
    </script>
<a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>
<!-- Vendor JS Files -->
<script src="<?php echo asset('assets/vendor/apexcharts/apexcharts.min.js'); ?>"></script>
<script src="<?php echo asset('assets/vendor/bootstrap/js/bootstrap.bundle.min.js'); ?>"></script>
<script src="<?php echo asset('assets/vendor/chart.js/chart.umd.js'); ?>"></script>
<script src="<?php echo asset('assets/vendor/echarts/echarts.min.js'); ?>"></script>
<script src="<?php echo asset('assets/vendor/quill/quill.min.js'); ?>"></script>
<script src="<?php echo asset('assets/vendor/simple-datatables/simple-datatables.js'); ?>"></script>
<script src="<?php echo asset('assets/vendor/tinymce/tinymce.min.js'); ?>"></script>
<script src="<?php echo asset('assets/vendor/php-email-form/validate.js'); ?>"></script>
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<!-- Template Main JS File -->
<script src="<?php echo asset('assets/js/main.js'); ?>"></script>
    <script>
        $(document).ready(function() {
                $.ajax({
                    url: '<?php echo e(route('empresa')); ?>', // URL de la ruta
                    type: 'GET',
                    success: function(response) {
                        var nombreEmpresa = response.empresa_config;
                        $('.nombre_empresa').text(nombreEmpresa)
                        var logo = response.logo_config;
                        if (typeof logo !== 'undefined' && logo) {
                            var src = "<?php echo asset('assets/img/logos/'); ?>/" + logo;
                            $('.logo_empresa').attr('src', src);
                        } else {
                            var src = "<?php echo asset('assets/img/logos/logo.png'); ?>";
                            $('.logo_empresa').attr('src', src);
                        }
                    },
                    error: function(xhr) {
                        console.error('Error:', xhr);
                    }
                });
            });
    </script>
</body>
</html>
<?php /**PATH C:\xampp\htdocs\tiendablogauto\resources\views/auth/login.blade.php ENDPATH**/ ?>