{% extends 'base.html' %}

{% block title %}Login - PixelMinds{% endblock %}

{% block content %}
<div class="section">
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-lg-5">
                <div class="card shadow-lg border-0">
                    <div class="card-body p-5">
                        <h1 class="section-title text-center mb-4">Welcome Back</h1>
                        
                        {% if form.errors %}
                            <div class="alert alert-danger" role="alert">
                                Your username and password didn't match. Please try again.
                            </div>
                        {% endif %}

                        <form method="post" action="{% url 'login' %}">
                            {% csrf_token %}
                            <div class="mb-3">
                                <label for="id_username" class="form-label">Username</label>
                                <input type="text" name="username" class="form-control" id="id_username" required>
                            </div>
                            <div class="mb-3">
                                <label for="id_password" class="form-label">Password</label>
                                <input type="password" name="password" class="form-control" id="id_password" required>
                            </div>
                            <div class="d-grid mb-3">
                                <button type="submit" class="btn btn-primary btn-lg">Login</button>
                            </div>
                            <p class="text-center"><a href="{% url 'password_reset' %}">Forgot password?</a></p>
                        </form>
                    </div>
                </div>
                <p class="text-center mt-4">Don't have an account? <a href="{% url 'signup' %}">Sign up</a></p>
            </div>
        </div>
    </div>
</div>
{% endblock %}
