<?php $__env->startSection('content'); ?>
<div class="d-flex justify-content-center align-items-center" style="min-height: 100vh;">
    <div class="shadow-lg rounded p-4" style="background-color: white; width: 100%; max-width: 400px;">
        <?php if(session('success')): ?>
        <div class="alert alert-success">
            <?php echo e(session('success')); ?>

        </div>
        <?php endif; ?>
        <form method="post" action="<?php echo e(route('login.perform')); ?>">
            <?php echo csrf_field(); ?>

            <div class="text-center mb-3">
                <img src="<?php echo e(asset('assets/logo/logo.png')); ?>" alt="Logo" height="57">
                <div class="brand-text font-weight-light mt-1" style="color:#c93525;font-style: italic;font-size: 23px;font-weight:bold">Laporan Stok Malam</div>
            </div>

            <h1 class="h5 mb-4 text-center"><small>Web Portal</small></h1>

            <?php if($errors->any()): ?>
            <div class="alert alert-danger">
                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php echo e($error); ?>

                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
            <?php endif; ?>

            <div class="form-group form-floating mb-3">
                <input type="text" class="form-control <?php $__errorArgs = ['username'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="username" value="<?php echo e(old('username', Session::get('username'))); ?>" placeholder="Username" required autofocus>
                <label for="floatingName">Email atau Username</label>
                <?php $__errorArgs = ['username'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div class="invalid-feedback"><?php echo e($message); ?></div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="form-group form-floating mb-3 position-relative">
                <input type="password" class="form-control <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="password" id="password" value="<?php echo e(Session::get('password')); ?>" placeholder="Password" required>
                <label for="floatingPassword">Password</label>

                <!-- Icon mata kanan -->
                <span onclick="togglePassword()" class="position-absolute top-50 end-0 translate-middle-y me-3" style="cursor: pointer; z-index: 10;">
                    <i class="fas fa-eye" id="toggleIcon"></i>
                </span>

                <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div class="invalid-feedback"><?php echo e($message); ?></div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="d-flex justify-content-between mb-3">
                <!-- <a href="#" class="text-decoration-none small">Register</a> -->
                <!-- <a href="#" class="text-decoration-none me-3 small">Forgot Password?</a> -->
            </div>

            <button class="w-100 btn btn-warning mb-3" type="submit">Masuk</button>

            <div class="text-center mb-5"></div>



            <p class="text-muted text-sm text-center small mb-0"><?php echo $__env->make('auth.partials.copy', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?></p>
        </form>
    </div>
</div>

<script>
    let isSubmitting = false;
    document.querySelector('form').addEventListener('submit', function(e) {
        if (isSubmitting) {
            e.preventDefault();
            return false;
        }
        isSubmitting = true;
        const loader = document.getElementById('loaderkdnknz');
        if (loader) loader.style.display = 'block';
    });

    function togglePassword() {
        const input = document.getElementById('password');
        const icon = document.getElementById('toggleIcon');

        if (input.type === 'password') {
            input.type = 'text';
            icon.classList.remove('fa-eye');
            icon.classList.add('fa-eye-slash');
        } else {
            input.type = 'password';
            icon.classList.remove('fa-eye-slash');
            icon.classList.add('fa-eye');
        }
    }
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.auth-master', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\LSM\resources\views/auth/login.blade.php ENDPATH**/ ?>