{% extends "base.html" %}
{% block title %}Register{% endblock %}
{% block content %}
    <div class="container mt-4">
        <div class="row">
            <div class="col-md-6 offset-md-3">
                <div class="card">
                    <div class="card-header">
                        <h3>Register</h3>
                    </div>
                    <div class="card-body">
                        <form method="POST" action="">
                            {{ form.hidden_tag() }}
                            <div class="mb-3">
                                {{ form.username.label(class="form-label") }}
                                {{ form.username(class="form-control") }}
                                {% if form.username.errors %}
                                    {% for error in form.username.errors %}
                                        <div class="text-danger">{{ error }}</div>
                                    {% endfor %}
                                {% endif %}
                            </div>
                            <div class="mb-3">
                                {{ form.email.label(class="form-label") }}
                                {{ form.email(class="form-control") }}
                                {% if form.email.errors %}
                                    {% for error in form.email.errors %}
                                        <div class="text-danger">{{ error }}</div>
                                    {% endfor %}
                                {% endif %}
                            </div>
                            <div class="mb-3">
                                {{ form.password.label(class="form-label") }}
                                {{ form.password(class="form-control") }}
                                {% if form.password.errors %}
                                    {% for error in form.password.errors %}
                                        <div class="text-danger">{{ error }}</div>
                                    {% endfor %}
                                {% endif %}
                            </div>
                            <div class="mb-3">
                                {{ form.confirm_password.label(class="form-label") }}
                                {{ form.confirm_password(class="form-control") }}
                                {% if form.confirm_password.errors %}
                                    {% for error in form.confirm_password.errors %}
                                        <div class="text-danger">{{ error }}</div>
                                    {% endfor %}
                                {% endif %}
                            </div>
                            {{ form.submit(class="btn btn-primary") }}
                        </form>
                    </div>
                    <div class="card-footer">
                        <small>Already have an account? <a href="{{ url_for('auth.login') }}">Sign in</a></small>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock content %}
