<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login - BEST Procurement</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
    <style>
        * {
            margin: 0; padding: 0; box-sizing: border-box;
            font-family: 'Inter', 'Segoe UI', sans-serif;
        }

        body {
            background: linear-gradient(
                135deg, 
                rgba(245, 6, 6, 0.47) 0%, 
                rgba(18, 18, 18, 0.19) 100%
            ), 
            url('https://images.unsplash.com/photo-1477346611705-65d1883cee1e?auto=format&fit=crop&w=1920&q=80');
            
            background-size: cover;
            background-position: center;
            background-attachment: fixed;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .login-card {
            background: rgba(30, 30, 30, 0.65); 
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            padding: 40px;
            border-radius: 20px;
            width: 100%;
            max-width: 400px;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
            border: 1px solid rgba(255, 255, 255, 0.15);
            text-align: center;
            z-index: 2;
        }

        .login-card img {
            width: 220px;
            margin-bottom: 30px;
            filter: drop-shadow(0 0 10px rgba(247, 247, 247, 0.55));
        }

        /* Styling Form Input */
        .form-group {
            position: relative;
            margin-bottom: 20px;
        }

        /* Warna Ikon di samping input */
        .form-group i {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: #ffffff; /* Mengubah ikon menjadi putih terang */
            font-size: 18px;
        }

        .form-control {
            width: 100%;
            padding: 14px 15px 14px 45px;
            background: rgba(255, 255, 255, 0.1); /* Latar belakang input lebih terang */
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 10px;
            
            /* WARNA TEKS SAAT DIKETIK */
            color: #ffffff; 
            font-weight: 500;
            font-size: 15px;
            
            outline: none;
            transition: 0.3s;
        }

        /* WARNA PLACEHOLDER (Username & Password) Agar Lebih Terlihat */
        .form-control::placeholder {
            color: rgba(255, 255, 255, 0.8) !important; /* Putih pekat transparan */
            opacity: 1; /* Penting untuk Firefox */
        }

        .form-control:focus {
            background: rgba(255, 255, 255, 0.2);
            border-color: #ff4d4d; /* Merah lebih terang saat fokus */
            box-shadow: 0 0 12px rgba(255, 77, 77, 0.4);
        }

        .btn-login {
            width: 100%;
            padding: 14px;
            background: #b71c1c;
            border: none;
            border-radius: 10px;
            color: white;
            font-weight: bold;
            font-size: 16px;
            cursor: pointer;
            transition: 0.3s ease;
            margin-top: 10px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .btn-login:hover {
            background: #e53935;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(183, 28, 28, 0.4);
        }

        .alert {
            background: rgba(183, 28, 28, 0.4);
            color: white;
            padding: 12px;
            border-radius: 10px;
            font-size: 14px;
            margin-bottom: 25px;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .footer-text {
            color: rgba(255, 255, 255, 0.6);
            font-size: 12px;
            margin-top: 30px;
        }
    </style>
</head>
<body>

    <div class="login-card">
        <img src="assets/logosys.png" alt="Logo">

        <?php if(isset($_GET['pesan'])): ?>
            <div class="alert">
                <?php 
                    if($_GET['pesan'] == "gagal") echo "Username atau Password salah!";
                    else if($_GET['pesan'] == "logout") echo "Berhasil logout.";
                    else if($_GET['pesan'] == "belum_login") echo "Silakan login terlebih dahulu.";
                ?>
            </div>
        <?php endif; ?>

        <form action="proses_login.php" method="POST">
            <div class="form-group">
                <i class="fa-solid fa-user"></i>
                <input type="text" name="username" class="form-control" placeholder="Username" required autocomplete="off">
            </div>
            
            <div class="form-group">
                <i class="fa-solid fa-lock"></i>
                <input type="password" name="password" class="form-control" placeholder="Password" required>
            </div>

            <button type="submit" name="login" class="btn-login">Sign In</button>
        </form>

        <div class="footer-text">
            &copy; 2026 BEST Procurement System
        </div>
    </div>

</body>
</html>