{% extends 'base.html' %}

{% block title %}Login - Referral Rewards{% endblock %}

{% block content %}
<div class="container py-5 mt-5">
    <div class="row justify-content-center">
        <div class="col-md-5">
            <div class="card border-0 shadow-lg p-4 p-md-5 rounded-4">
                <div class="text-center mb-4">
                    <h2 class="mb-3">Welcome Back</h2>
                    <p class="text-muted">Login to manage your referrals.</p>
                </div>
                
                <form method="post">
                    {% csrf_token %}
                    {% if form.non_field_errors %}
                        <div class="alert alert-danger">
                            {% for error in form.non_field_errors %}
                                {{ error }}
                            {% endfor %}
                        </div>
                    {% endif %}
                    
                    <div class="mb-3">
                        <label for="id_username" class="form-label fw-600">Username</label>
                        <input type="text" name="username" class="form-control" id="id_username" placeholder="Username" required>
                    </div>
                    
                    <div class="mb-2">
                        <label for="id_password" class="form-label fw-600">Password</label>
                        <input type="password" name="password" class="form-control" id="id_password" placeholder="Password" required>
                    </div>

                    <div class="d-flex justify-content-between mb-4">
                        <a href="{% url 'resend_activation' %}" class="text-decoration-none small fw-bold">Resend activation?</a>
                        <a href="{% url 'password_reset' %}" class="text-decoration-none small fw-bold">Forgot password?</a>
                    </div>
                    
                    <button type="submit" class="btn btn-primary w-100 py-3">Log In</button>
                </form>
                
                <div class="text-center mt-5">
                    <p class="text-muted mb-0">Don't have an account? <a href="{% url 'signup' %}" class="text-decoration-none fw-bold">Sign Up</a></p>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}