<?php $__env->startSection('content'); ?>
<?php
    $socialProviders = json_decode(site_settings('social_login_with'),true);
    $mediums = [];
    foreach($socialProviders as $key=>$login_medium){
        if($login_medium['status'] == App\Enums\StatusEnum::TRUE->status()){
            array_push($mediums, str_replace('_oauth',"",$key));
        }
    }
    $googleCaptcha = (object) json_decode(site_settings("google_recaptcha"));
?>

<section class="auth">
    <div class="container-fluid px-0">
      <div class="auth-wrapper">
        <div class="row g-0">
          <?php echo $__env->make($themeManager->view('auth.partials.content'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
          <div class="col-lg-6 order-lg-1 order-0">
            <div class="auth-right">
              <a href="<?php echo e(url('/')); ?>">
                <img src="<?php echo e(showImage(config('setting.file_path.site_logo.path').'/'.site_settings('site_logo'),config('setting.file_path.site_logo.size'))); ?>" class="logo-lg" alt="">
              </a>
              <div class="auth-form-wrapper">
                <h3><?php echo e(translate("Sign in")); ?></h3>
                <form action="<?php echo e(route('login.store')); ?>" method="POST" id="login-form" class="auth-form">
                    <?php echo csrf_field(); ?>
                    
                    <?php if(site_settings('captcha') == \App\Enums\StatusEnum::TRUE->status() && site_settings('captcha_with_login') == \App\Enums\StatusEnum::TRUE->status() && $googleCaptcha->status == \App\Enums\StatusEnum::TRUE->status()): ?>
                        <input type="hidden" name="g-recaptcha-response" id="g-recaptcha-response">
                    <?php endif; ?>
                    
                    <div class="form-element">
                        <label for="email" class="form-label"><?php echo e(translate("Email Address")); ?></label>
                        <input type="email" name="email" value="<?php echo e(env("APP_MODE") == 'demo' ? env("APP_USER_EMAIL") : ''); ?>" placeholder="<?php echo e(translate('Enter your email address')); ?>" id="user" aria-describedby="user email" class="form-control"/>
                    </div>
                    <div class="form-element">
                        <label for="password" class="form-label"><?php echo e(translate("Password")); ?></label>
                        <input type="password" id="password" value="<?php echo e(env("APP_MODE") == 'demo' ? env("APP_USER_PASSWORD") : ''); ?>" name="password" class="form-control" placeholder="Enter password" aria-label="password" />
                        <a href="<?php echo e(route('password.request')); ?>" class="forget-password"><?php echo e(translate("Forget password?")); ?></a>
                    </div>
                    
                    <button class="i-btn btn--primary bg--gradient btn--xl rounded-3 w-100 mt-2" type="submit" id="submit-btn">
                        <?php echo e(translate("Sign In")); ?> 
                        <i class="ri-arrow-right-line fs-18"></i>
                    </button>
                    
                    <?php if(site_settings('captcha') == \App\Enums\StatusEnum::TRUE->status() && site_settings('captcha_with_login') == \App\Enums\StatusEnum::TRUE->status() && $googleCaptcha->status == \App\Enums\StatusEnum::TRUE->status()): ?>
                        <div class="text-center mt-2">
                            <small class="text-muted">
                                <i class="ri-shield-check-line"></i> 
                                <?php echo e(translate("Protected by reCAPTCHA")); ?>

                            </small>
                        </div>
                    <?php endif; ?>
                </form>
                
                <div class="mt-3">
                    <div class="auth-form-bottom">
                        <?php if(site_settings("social_login") == \App\Enums\StatusEnum::TRUE->status()): ?>
                        <div class="divider">
                            <span><?php echo e(translate('Or continue with')); ?></span>
                        </div>
                        <div class="row g-4">
                          <div class="col-sm-12">
                              <a href="<?php echo e(url('auth/google')); ?>" class="sign-option-btn">
                                  <span class="sign-option-logo">
                                    <img src="<?php echo e(showImage(config('setting.file_path.social_login.google.path').'/'."google.png",config('setting.file_path.social_login.google.size'))); ?>" alt="google">
                                  </span> <?php echo e(translate("Google")); ?> </a>
                              </div>
                          </div>
                        <?php endif; ?>
                        <div class="mt-20 text-center">
                            <p class="fw-semibold"> <?php echo e(translate("Don't have account?")); ?> <a class="text-primary text-decoration-underline" href="<?php echo e(route('register')); ?>" ><?php echo e(translate('New To')); ?> <?php echo e(ucfirst(site_settings("site_name"))); ?>?</a>
                            </p>
                        </div>
                    </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
</section>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('script-push'); ?>
<?php if(site_settings('captcha') == \App\Enums\StatusEnum::TRUE->status() && site_settings('captcha_with_login') == \App\Enums\StatusEnum::TRUE->status() && $googleCaptcha->status == \App\Enums\StatusEnum::TRUE->status()): ?>
    <script src="https://www.google.com/recaptcha/api.js?render=<?php echo e($googleCaptcha->key); ?>"></script>
    <script>
      'use strict'
      document.addEventListener('DOMContentLoaded', function() {
          const form = document.getElementById('login-form');
          const submitBtn = document.getElementById('submit-btn');
          
          
          form.addEventListener('submit', function(e) {
              e.preventDefault();
              
              submitBtn.innerHTML = 'Verifying... <i class="ri-loader-4-line fs-18"></i>';
              submitBtn.disabled = true;
              
              grecaptcha.ready(function() {
                  grecaptcha.execute('<?php echo e($googleCaptcha->key); ?>', {action: 'login'})
                  .then(function(token) {
                      document.getElementById('g-recaptcha-response').value = token;
                      submitBtn.innerHTML = '<?php echo e(translate("Sign In")); ?> <i class="ri-arrow-right-line fs-18"></i>';
                      submitBtn.disabled = false;
                      form.submit();
                  })
                  .catch(function(error) {
                      console.error('reCAPTCHA error:', error);
                      submitBtn.innerHTML = '<?php echo e(translate("Sign In")); ?> <i class="ri-arrow-right-line fs-18"></i>';
                      submitBtn.disabled = false;
                      notify('error', 'reCAPTCHA verification failed. Please try again.');
                  });
              });
          });
        });
    </script>
<?php endif; ?>
<?php $__env->stopPush(); ?>
<?php echo $__env->make($themeManager->view('layouts.main'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\wamp64\www\public\mailing\xsender2026\xsender4.1\src\resources\views/frontend/themes/default/auth/user/login.blade.php ENDPATH**/ ?>