<!DOCTYPE html>
<html lang="id">
<head>
    <link rel="icon" type="image/png" href="{{ asset('img/Capture__1_-removebg-preview.png') }}">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login - SMKN 1 Prajekan</title>
    <meta name="description" content="Login Administrator - Sistem Absensi Terpadu SMKN 1 Prajekan">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
    <style>
        body {
            background-color: #f1f5f9;
            font-family: 'Inter', sans-serif;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .login-card {
            background-color: #ffffff;
            border-radius: 14px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
            padding: 36px 32px;
            width: 100%;
            max-width: 380px;
            text-align: center;
            border: 1px solid #e2e8f0;
        }

        .logo-img {
            width: 80px;
            height: 80px;
            object-fit: contain;
            margin-bottom: 16px;
        }

        .login-title {
            font-size: 18px;
            font-weight: 700;
            color: #0f172a;
            margin-bottom: 2px;
        }

        .login-subtitle {
            font-size: 12px;
            color: #94a3b8;
            margin-bottom: 28px;
            letter-spacing: 1px;
            font-weight: 600;
            text-transform: uppercase;
        }

        .form-control-flat {
            background-color: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 12px 14px;
            font-size: 14px;
            font-family: 'Inter', sans-serif;
        }

        .form-control-flat:focus {
            border-color: #0284c7;
            box-shadow: 0 0 0 0.2rem rgba(2, 132, 199, 0.15);
            background-color: #ffffff;
        }

        .btn-login {
            background-color: #0f172a;
            color: #ffffff;
            border: none;
            border-radius: 8px;
            padding: 12px 20px;
            font-weight: 600;
            width: 100%;
            font-size: 14px;
            transition: all 0.2s ease;
            font-family: 'Inter', sans-serif;
        }

        .btn-login:hover {
            background-color: #1e293b;
            color: #ffffff;
        }

        .form-label {
            font-size: 12px;
            font-weight: 600;
            color: #64748b;
        }

        .back-link {
            display: inline-block;
            margin-top: 16px;
            font-size: 13px;
            color: #64748b;
            text-decoration: none;
        }

        .back-link:hover {
            color: #0f172a;
        }

        @media (max-width: 576px) {
            .login-card {
                padding: 28px 22px;
            }

            .logo-img {
                width: 64px;
                height: 64px;
            }

            .login-title {
                font-size: 16px;
            }
        }
    </style>
</head>
<body>

    <div class="login-card">
        <img src="{{ asset('img/Capture__1_-removebg-preview.png') }}" alt="Logo SMKN 1 Prajekan" class="logo-img">

        <h2 class="login-title">SMKN 1 PRAJEKAN</h2>
        <p class="login-subtitle">Sistem Absensi</p>

        @if ($errors->any())
            <div class="alert alert-danger" style="font-size: 13px; text-align: left; padding: 10px 14px; border-radius: 8px;">
                @foreach ($errors->all() as $error)
                    <div>{{ $error }}</div>
                @endforeach
            </div>
        @endif

        <form action="{{ route('login.post') }}" method="POST">
            @csrf
            <div class="mb-3 text-start">
                <label for="username" class="form-label">Username</label>
                <input type="text" name="username" id="username" class="form-control form-control-flat"
                       placeholder="Masukkan username..." value="{{ old('username') }}" required autofocus>
            </div>

            <div class="mb-4 text-start">
                <label for="password" class="form-label">Password</label>
                <input type="password" name="password" id="password" class="form-control form-control-flat"
                       placeholder="Masukkan password..." required>
            </div>

            <button type="submit" class="btn btn-login">Login Sekarang</button>
        </form>

        <a href="{{ url('/') }}" class="back-link">
            <i class="bi bi-arrow-left"></i> Kembali ke Beranda
        </a>
    </div>

</body>
</html>
