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

<?php $__env->startSection('content'); ?>
<div class="login-wrapper">
    

    
    <div class="login-card">
        
        <div class="login-brand inside-card">
        <img src="<?php echo e(asset('images/pamsimas-logo.png')); ?>" alt="PAMSIMAS Logo" class="login-logo" />
        <p class="login-subtitle">Penyediaan Air Minum dan Sanitasi<br>Berbasis Masyarakat</p>
    </div>

    
        <h2 class="login-title">Masuk ke Akun</h2>

        <?php if(session('error')): ?>
            <div class="alert alert-error">
                <i class="fas fa-exclamation-circle"></i> <?php echo e(session('error')); ?>

            </div>
        <?php endif; ?>
        <?php if(session('status')): ?>
            <div class="alert alert-success">
                <i class="fas fa-check-circle"></i> <?php echo e(session('status')); ?>

            </div>
        <?php endif; ?>

        <form action="<?php echo e(route('login.submit')); ?>" method="POST" class="login-form">
            <?php echo csrf_field(); ?>
            <div class="input-group">
                <span class="input-icon"><i class="fas fa-envelope"></i></span>
                <input type="email" name="email" placeholder="Alamat Email" required autocomplete="email" />
            </div>
            <div class="input-group">
            <span class="input-icon"><i class="fas fa-lock"></i></span>
            <input type="password" name="password" id="password" placeholder="Kata Sandi" required autocomplete="current-password" />
            <span class="toggle-password" onclick="togglePassword()">
                <i id="toggleIcon" class="fas fa-eye"></i>
            </span>
            </div>
            <button type="submit" class="btn-login">
                <span>Login</span>
                
            </button>
        </form>

        <div class="login-footer">
            Belum punya akun?
            <a href="<?php echo e(route('register')); ?>">Daftar sekarang</a>
        </div>
    </div>
</div>

<script>
function togglePassword() {
    const passwordInput = document.getElementById('password');
    const toggleIcon = document.getElementById('toggleIcon');

    if (passwordInput.type === 'password') {
        passwordInput.type = 'text';
        toggleIcon.classList.remove('fa-eye');
        toggleIcon.classList.add('fa-eye-slash');
    } else {
        passwordInput.type = 'password';
        toggleIcon.classList.remove('fa-eye-slash');
        toggleIcon.classList.add('fa-eye');
    }
}
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
    var alerts = document.querySelectorAll('.alert');
    if (alerts.length > 0) {
        setTimeout(function() {
            alerts.forEach(function(alert) {
                alert.style.transition = 'opacity 0.5s ease';
                alert.style.opacity = '0';
                setTimeout(function() {
                    alert.remove();
                }, 500);
            });
        }, 5000); // 3 detik
    }
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.auth', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\UsEr\Documents\0 Mata Kuliah\Tugas Akhir\Project Pamsimas\PAMSIMAS_User\resources\views/auth/login.blade.php ENDPATH**/ ?>