{% extends 'base.html' %}

{% block title %}Register - RepairsHub{% endblock %}

{% block content %}
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-md-5">
            <div class="card p-4 p-lg-5">
                <div class="text-center mb-4">
                    <h2 class="brand-text">REPAIRS<span>HUB</span></h2>
                    <p class="text-muted">Create your account to get started</p>
                </div>
                <form method="post">
                    {% csrf_token %}
                    {% for field in form %}
                        <div class="mb-3">
                            <label class="form-label fw-medium">{{ field.label }}</label>
                            {{ field }}
                            {% if field.help_text %}
                                <div class="form-text">{{ field.help_text }}</div>
                            {% endif %}
                            {% for error in field.errors %}
                                <div class="text-danger small">{{ error }}</div>
                            {% endfor %}
                        </div>
                    {% endfor %}
                    <button type="submit" class="btn btn-primary w-100 mt-3">Register</button>
                </form>
                <div class="text-center mt-4">
                    <p class="text-muted small">Already have an account? <a href="{% url 'login' %}" class="text-primary fw-bold text-decoration-none">Login</a></p>
                </div>
            </div>
        </div>
    </div>
</div>

<style>
    input[type="text"], input[type="password"], input[type="email"] {
        display: block;
        width: 100%;
        padding: 0.375rem 0.75rem;
        font-size: 1rem;
        font-weight: 400;
        line-height: 1.5;
        color: #212529;
        background-color: #fff;
        background-clip: padding-box;
        border: 1px solid #ced4da;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        border-radius: 0.375rem;
        transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    }
</style>
{% endblock %}
