<!DOCTYPE html>
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale())); ?>">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php echo e(config('app.name', 'Laravel')); ?> - Login</title>
    <?php if(file_exists(public_path('build/manifest.json')) || file_exists(public_path('hot'))): ?>
        <?php echo app('Illuminate\Foundation\Vite')(['resources/css/app.css', 'resources/js/app.js']); ?>
    <?php endif; ?>
    <!-- Bootstrap Icons -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
</head>
<body class="d-flex align-items-center justify-content-center" style="min-height:100vh;">
    <div class="card shadow-sm" style="width:100%;max-width:420px; margin:1rem;">
        <div class="card-body">
            <h3 class="card-title mb-3">Selamat datang</h3>
            <p class="text-muted">Silakan masuk untuk melanjutkan.</p>

            <?php if(auth()->guard()->check()): ?>
                <div class="mb-3">
                    <?php if((auth()->user()->is_admin ?? false) || (auth()->user()->role ?? '') === 'admin'): ?>
                        <a href="/admin" class="btn btn-secondary w-100 mb-2">Buka Admin Dashboard</a>
                    <?php elseif((auth()->user()->role ?? '') === 'guru'): ?>
                        <a href="/guru/dashboard" class="btn btn-secondary w-100 mb-2">Buka Guru Dashboard</a>
                    <?php else: ?>
                        <a href="/" class="btn btn-secondary w-100 mb-2">Dashboard</a>
                    <?php endif; ?>
                </div>
                <form method="POST" action="<?php echo e(route('logout')); ?>">
                    <?php echo csrf_field(); ?>
                    <button type="submit" class="btn btn-outline-danger w-100">Logout</button>
                </form>
            <?php else: ?>
                <?php if($errors->any()): ?>
                    <div class="alert alert-danger">
                        <?php echo e($errors->first()); ?>

                    </div>
                <?php endif; ?>

                <form method="POST" action="<?php echo e(route('login.attempt')); ?>">
                    <?php echo csrf_field(); ?>
                    <div class="mb-3">
                        <label for="username" class="form-label">Username</label>
                        <div class="input-group">
                            <span class="input-group-text bg-success text-white border-0" id="username-addon">
                                <!-- user icon -->
                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person" viewBox="0 0 16 16">
                                    <path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>
                                    <path fill-rule="evenodd" d="M8 9a5 5 0 0 0-4.546 2.916.5.5 0 0 0 .447.668h8.198a.5.5 0 0 0 .447-.668A5 5 0 0 0 8 9z"/>
                                </svg>
                            </span>
                            <input type="text" class="form-control" id="username" name="username" value="<?php echo e(old('username')); ?>" placeholder="masukkan username" aria-describedby="username-addon" required>
                        </div>
                    </div>
                    <div class="mb-3">
                        <label for="password" class="form-label">Password</label>
                        <div class="input-group">
                            <span class="input-group-text bg-danger text-white border-0" id="password-addon">
                                <i class="bi bi-key" aria-hidden="true" style="font-size:1rem;"></i>
                            </span>
                            <input type="password" class="form-control" id="password" name="password" placeholder="masukkan password" aria-describedby="password-addon" required>
                        </div>
                    </div>
                    <button type="submit" class="btn btn-primary w-100">Masuk</button>
                </form>
            <?php endif; ?>
        </div>
    </div>
</body>
</html>
<?php /**PATH C:\App\laravel\laravel\resources\views/login.blade.php ENDPATH**/ ?>