<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login - FileChest</title>
    <style>
        * { box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            margin: 0; padding: 20px; background: #f5f5f5;
            min-height: 100vh; display: flex; align-items: center; justify-content: center;
        }
        .login-container {
            background: white; padding: 30px; border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1); width: 100%; max-width: 400px;
        }
        h1 { margin: 0 0 20px 0; font-size: 1.5em; text-align: center; }
        .form-group { margin-bottom: 15px; }
        .form-group label { display: block; margin-bottom: 5px; font-weight: 500; }
        .form-group input {
            width: 100%; padding: 10px; border: 1px solid #ddd;
            border-radius: 4px; font-size: 14px;
        }
        .form-group input:focus { outline: none; border-color: #1976d2; }
        .btn-submit {
            width: 100%; padding: 12px; background: #1976d2; color: white;
            border: none; border-radius: 4px; font-size: 16px; cursor: pointer;
        }
        .btn-submit:hover { background: #1565c0; }
        .error-list {
            background: #ffebee; color: #c62828; padding: 10px;
            border-radius: 4px; margin-bottom: 15px; list-style: none;
        }
        .error-list li { margin: 5px 0; }
    </style>
</head>
<body>
    <div class="login-container">
        <h1>FileChest Login</h1>
        {% if form.errors %}
        <ul class="error-list">
            {% for field in form %}
                {% for error in field.errors %}
                    <li>{{ error }}</li>
                {% endfor %}
            {% endfor %}
            {% for error in form.non_field_errors %}
                <li>{{ error }}</li>
            {% endfor %}
        </ul>
        {% endif %}
        <form method="post">
            {% csrf_token %}
            <div class="form-group">
                <label for="id_username">Username</label>
                <input type="text" name="username" id="id_username" autofocus required>
            </div>
            <div class="form-group">
                <label for="id_password">Password</label>
                <input type="password" name="password" id="id_password" required>
            </div>
            <button type="submit" class="btn-submit">Login</button>
        </form>
    </div>
</body>
</html>
