<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login — Procurement System</title>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <style>
        :root {
            --bg: #0f1117; --bg-card: #1a1d27; --bg-input: #13151f;
            --border: #2a2d3e; --text: #e2e4f0; --text-muted: #6b7280;
            --accent: #4f6ef7; --red: #ef4444; --red-soft: rgba(239,68,68,.12);
        }
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; align-items: center; justify-content: center; }

        .login-wrap { width: 100%; max-width: 400px; padding: 24px; }
        .login-brand { text-align: center; margin-bottom: 36px; }
        .brand-icon { width: 56px; height: 56px; background: var(--accent); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: white; margin: 0 auto 14px; }
        .brand-name { font-size: 22px; font-weight: 700; }
        .brand-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

        .card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 32px; }
        .card-title { font-size: 18px; font-weight: 600; margin-bottom: 24px; }
        .form-group { margin-bottom: 16px; }
        label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
        input { width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; color: var(--text); font-size: 14px; font-family: inherit; outline: none; transition: border-color .15s; }
        input:focus { border-color: var(--accent); }
        .btn { width: 100%; padding: 11px; background: var(--accent); color: white; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; margin-top: 8px; transition: opacity .15s; }
        .btn:hover { opacity: .9; }
        .checkbox-wrap { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
        .checkbox-wrap input { width: auto; }
        .checkbox-wrap label { margin: 0; font-size: 13px; color: var(--text-muted); }
        .alert { padding: 10px 14px; background: var(--red-soft); color: var(--red); border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
        .demo-info { margin-top: 20px; padding: 14px; background: rgba(79,110,247,.08); border: 1px solid rgba(79,110,247,.2); border-radius: 8px; font-size: 12.5px; color: var(--text-muted); }
        .demo-info strong { color: var(--accent); }
        .psak-badge { text-align: center; margin-top: 24px; font-size: 11.5px; color: var(--text-muted); }
    </style>
</head>
<body>
<div class="login-wrap">
    <div class="login-brand">
        <div class="brand-icon">Procurement System</div>
        <div class="brand-name">PT. Solusi Semesta Rekakreasi</div>
        <div class="brand-sub">Sistem Akuntansi Pengadaan Barang & Jasa</div>
    </div>
    <div class="card">
        <div class="card-title">Masuk ke Sistem</div>
        {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}{% for cat, msg in messages %}<div class="alert">{{ msg }}</div>{% endfor %}{% endif %}
        {% endwith %}
        <form method="POST">
            <div class="form-group">
                <label>Username</label>
                <input type="text" name="username" required autofocus placeholder="Masukkan username">
            </div>
            <div class="form-group">
                <label>Password</label>
                <input type="password" name="password" required placeholder="Masukkan password">
            </div>
            <div class="checkbox-wrap">
                <input type="checkbox" name="remember" id="remember">
                <label for="remember">Ingat saya</label>
            </div>
            <button type="submit" class="btn">Masuk →</button>
        </form>
        <div class="demo-info">
            <strong>Demo Login:</strong><br>
            Username: <strong>admin</strong> | Password: <strong>admin123</strong>
        </div>
    </div>
    <div class="psak-badge">Sistem Akuntansi sesuai PSAK No. 72 — Pendapatan dari Kontrak Pelanggan</div>
</div>
</body>
</html>
