{% extends 'base.html' %}

{% block title %}Login - Support Center{% endblock %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-md-5">
        <div class="card shadow-sm border-0 mt-5">
            <div class="card-body p-5 text-center">
                <h2 class="fw-bold mb-4">Welcome Back</h2>
                <p class="text-muted mb-4">Please log in to manage your support tickets.</p>
                
                <form method="post">
                    {% csrf_token %}
                    <div class="mb-3 text-start">
                        <label for="id_username" class="form-label">Username</label>
                        <input type="text" name="username" autofocus maxlength="150" required id="id_username" class="form-control">
                    </div>
                    <div class="mb-4 text-start">
                        <label for="id_password" class="form-label">Password</label>
                        <input type="password" name="password" required id="id_password" class="form-control">
                    </div>
                    
                    {% if form.errors %}
                        <div class="alert alert-danger py-2 small">
                            Your username and password didn't match. Please try again.
                        </div>
                    {% endif %}
                    
                    <button type="submit" class="btn btn-primary w-100 py-2 fw-bold">Login</button>
                    <input type="hidden" name="next" value="{{ next }}">
                </form>
                
                <div class="mt-4 pt-3 border-top">
                    <p class="small text-muted mb-0">Don't have an account? Contact your administrator.</p>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
