<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= $title ?? 'Login SIAKAD ITKA' ?></title>
    
    <!-- Boxicons -->
    <link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
    
    <!-- Custom CSS -->
    <link rel="stylesheet" href="<?= base_url('assets/css/style.css') ?>">
</head>
<body class="login-body">
    
    <div class="login-container">
        <div class="login-card glass">
            <div class="login-header">
                <div class="login-logo">
                    <i class='bx bxs-graduation'></i>
                </div>
                <h2>siAkad ITKA</h2>
                <p>Silakan login untuk mengakses sistem</p>
            </div>

            <?php if(session()->getFlashdata('error')): ?>
                <div class="alert alert-danger" style="background-color: rgba(244, 63, 94, 0.1); color: var(--accent); border: 1px solid rgba(244, 63, 94, 0.2);">
                    <?= session()->getFlashdata('error') ?>
                </div>
            <?php endif; ?>

            <form action="<?= base_url('auth/loginSubmit') ?>" method="post">
                <div class="form-group">
                    <label class="form-label" for="username">Username</label>
                    <div class="input-with-icon">
                        <i class='bx bx-user'></i>
                        <input type="text" class="form-control" id="username" name="username" value="<?= old('username') ?>" required placeholder="Masukkan username">
                    </div>
                </div>

                <div class="form-group">
                    <label class="form-label" for="password">Password</label>
                    <div class="input-with-icon">
                        <i class='bx bx-lock-alt'></i>
                        <input type="password" class="form-control" id="password" name="password" required placeholder="Masukkan password">
                    </div>
                </div>

                <div class="form-group login-options">
                    <label class="checkbox-container">
                        <input type="checkbox" name="remember" value="1" <?= old('remember') ? 'checked' : '' ?>>
                        <span class="checkmark"></span>
                        Ingat Saya
                    </label>
                    <a href="#" class="forgot-password">Lupa Password?</a>
                </div>

                <button type="submit" class="btn btn-primary btn-block" style="width: 100%; margin-top: 1rem; padding: 0.75rem;">Login</button>
            </form>
            
            <div class="login-footer">
                <p>&copy; <?= date('Y') ?> Institut Teknologi & Sains ITKA. All rights reserved.</p>
            </div>
        </div>
    </div>

</body>
</html>
