<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= esc($title) ?></title>
    <style>
        body { font-family: Arial, sans-serif; background: linear-gradient(135deg, #111827, #1f2937); color: #f9fafb; margin: 0; padding: 0; }
        .container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
        .card { width: 100%; max-width: 420px; background: #fff; color: #111827; border-radius: 16px; padding: 30px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
        h2 { margin-top: 0; color: #111827; }
        .alert { background: #fee2e2; color: #991b1b; padding: 10px; border-radius: 8px; margin-bottom: 15px; }
        .field { margin-bottom: 14px; }
        label { display: block; margin-bottom: 6px; font-weight: bold; }
        input, select { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 8px; box-sizing: border-box; }
        button { width: 100%; background: #2563eb; color: white; border: none; padding: 12px; border-radius: 8px; font-weight: bold; cursor: pointer; }
        button:hover { background: #1d4ed8; }
        .hint { margin-top: 12px; font-size: 13px; color: #6b7280; }
    </style>
</head>
<body>
<div class="container">
    <div class="card">
        <h2>Login POS Barber</h2>
        <?php if (!empty($error)) : ?>
            <div class="alert"><?= esc($error) ?></div>
        <?php endif; ?>
        <form action="/auth/attempt" method="post">
            <div class="field">
                <label for="username">Username</label>
                <input type="text" id="username" name="username" required>
            </div>
            <div class="field">
                <label for="password">Password</label>
                <input type="password" id="password" name="password" required>
            </div>
            <div class="field">
                <label for="role">Login Sebagai</label>
                <select id="role" name="role" required>
                    <option value="owner">Owner</option>
                    <option value="cashier">Kasir</option>
                </select>
            </div>
            <button type="submit">Masuk</button>
        </form>
    </div>
</div>
</body>
</html>
