<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login Admin - SMKN 1 Sukalarang</title>
    
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
    
    <style>
        :root {
            /* Warna Green Yellow sesuai pilihan Bapak */
            --accent-color: #ADFF2F; 
            --text-dark: #2d3436;
        }

        body { 
            /* Menggunakan nama file background.jpg sesuai instruksi */
            background-image: url('<?= base_url('assets/img/background.jpg') ?>'); 
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            background-attachment: fixed;
            min-height: 100vh; 
            display: flex; 
            align-items: center; 
            justify-content: center;
            font-family: 'Segoe UI', Roboto, sans-serif;
            margin: 0;
            position: relative;
            overflow-x: hidden;
        }

        /* Overlay transparan agar background.jpg terlihat lebih terang sesuai keinginan */
        body::before {
            content: "";
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.2); 
            z-index: 1;
        }

        .container { position: relative; z-index: 2; }

        .login-card { 
            width: 100%;
            max-width: 420px; 
            background: rgba(255, 255, 255, 0.1); 
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 40px; 
            box-shadow: 0 25px 50px rgba(0,0,0,0.5);
            overflow: hidden;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .login-card:hover {
            transform: scale(1.02);
            box-shadow: 0 30px 60px rgba(0,0,0,0.6);
        }

        .login-header {
            background: rgba(255, 255, 255, 0.05);
            padding: 45px 20px;
            text-align: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .login-logo {
            max-height: 80px;
            filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3));
            margin-bottom: 20px;
            /* Animasi logo berdenyut */
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.08); }
            100% { transform: scale(1); }
        }

        .text-accent {
            color: var(--accent-color);
            text-shadow: 0 0 15px rgba(173, 255, 47, 0.5);
        }

        .form-group label {
            font-weight: 500;
            color: rgba(255, 255, 255, 0.9);
            font-size: 0.85rem;
            margin-left: 15px;
            margin-bottom: 8px;
        }

        .input-group-text {
            background-color: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-right: none;
            border-radius: 20px 0 0 20px;
            color: var(--accent-color);
        }

        .form-control {
            background-color: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-left: none;
            border-radius: 0 20px 20px 0;
            height: 52px;
            color: #fff;
            transition: all 0.3s ease;
        }

        .form-control:focus {
            background-color: rgba(255, 255, 255, 0.2);
            border-color: var(--accent-color);
            color: #fff;
            box-shadow: none;
        }

        .btn-login { 
            background: var(--accent-color);
            border: none; 
            border-radius: 20px;
            padding: 15px;
            font-weight: 800;
            color: var(--text-dark) !important;
            letter-spacing: 2px;
            transition: all 0.4s;
            margin-top: 20px;
            box-shadow: 0 10px 25px rgba(173, 255, 47, 0.3);
        }

        .btn-login:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 35px rgba(173, 255, 47, 0.5);
            letter-spacing: 3px;
        }

        .footer-text {
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.8rem;
            margin-top: 30px;
        }
        
        .footer-text a { color: var(--accent-color) !important; font-weight: 700; }
        .footer-text a:hover { text-decoration: none; filter: brightness(1.2); }
    </style>
</head>
<body>

<div class="container p-3">
    <div class="card login-card mx-auto animate__animated animate__zoomIn">
        <div class="login-header">
            <img src="<?= base_url('assets/img/logo/logo.png') ?>" class="login-logo" alt="Logo Negla">
            <h4 class="font-weight-bold mb-1 text-accent animate__animated animate__fadeInDown">ADMIN LOGIN</h4>
            <p class="small mb-0 text-white animate__animated animate__fadeInUp">SMK Negeri 1 Sukalarang</p>
        </div>

        <div class="card-body p-4 p-md-5">
            <?php if(session()->getFlashdata('msg')):?>
                <div class="alert alert-danger bg-danger text-white border-0 small py-2 animate__animated animate__shakeX">
                    <i class="fas fa-exclamation-circle mr-2"></i> <?= session()->getFlashdata('msg') ?>
                </div>
            <?php endif;?>

            <form action="<?= base_url('auth/login_proses') ?>" method="post">
                <?= csrf_field() ?>
                
                <div class="form-group mb-4 animate__animated animate__fadeInLeft" style="animation-delay: 0.2s;">
                    <label>Username</label>
                    <div class="input-group">
                        <div class="input-group-prepend">
                            <span class="input-group-text"><i class="fas fa-user-shield"></i></span>
                        </div>
                        <input type="text" name="username" class="form-control" placeholder="Masukkan username admin" required autocomplete="off">
                    </div>
                </div>

                <div class="form-group mb-4 animate__animated animate__fadeInRight" style="animation-delay: 0.4s;">
                    <label>Password</label>
                    <div class="input-group">
                        <div class="input-group-prepend">
                            <span class="input-group-text"><i class="fas fa-key"></i></span>
                        </div>
                        <input type="password" name="password" class="form-control" placeholder="Masukkan password admin" required>
                    </div>
                </div>

                <button type="submit" class="btn btn-block btn-lg btn-login animate__animated animate__fadeInUp" style="animation-delay: 0.6s;">
                    MASUK KE SISTEM <i class="fas fa-arrow-right ml-2"></i>
                </button>
            </form>

            <div class="text-center footer-text animate__animated animate__fadeIn" style="animation-delay: 0.8s;">
                <p class="mb-2">&copy; 2026 SMKN 1 Sukalarang</p>
                <a href="<?= base_url() ?>" class="small">
                    <i class="fas fa-chevron-left mr-1"></i> Kembali ke Beranda
                </a>
            </div>
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>