{% extends 'layouts/base.html.twig' %}

{% block title %}Inscription - LamaZoo{% endblock %}

{% block stylesheets %}
    {{ parent() }}
    <link rel="stylesheet" href="{{ asset('css/registration.css') }}">
{% endblock %}

{% block body %}
<div class="registration-container">
    <div class="registration-card">
        <div class="card-body">
            <h1 class="registration-title">Inscription</h1>

            {% for flash_error in app.flashes('verify_email_error') %}
                <div class="alert-danger">{{ flash_error }}</div>
            {% endfor %}

            {{ form_start(registrationForm, {'attr': {'class': 'registration-form'}}) }}
                <div class="form-row">
                    <div class="form-group">
                        {{ form_label(registrationForm.nom, 'Nom') }}
                        {{ form_widget(registrationForm.nom, {'attr': {'class': 'form-control'}}) }}
                        {{ form_errors(registrationForm.nom) }}
                    </div>
                    <div class="form-group">
                        {{ form_label(registrationForm.prenom, 'Prénom') }}
                        {{ form_widget(registrationForm.prenom, {'attr': {'class': 'form-control'}}) }}
                        {{ form_errors(registrationForm.prenom) }}
                    </div>
                </div>

                <div class="form-row">
                    <div class="form-group">
                        {{ form_label(registrationForm.email, 'Email') }}
                        {{ form_widget(registrationForm.email, {'attr': {'class': 'form-control'}}) }}
                        {{ form_errors(registrationForm.email) }}
                    </div>
                    <div class="form-group">
                        {{ form_label(registrationForm.telephone, 'Téléphone') }}
                        {{ form_widget(registrationForm.telephone, {'attr': {'class': 'form-control'}}) }}
                        {{ form_errors(registrationForm.telephone) }}
                    </div>
                </div>

                <div class="form-row">
                    <div class="form-group">
                        {{ form_label(registrationForm.adresse, 'Adresse') }}
                        {{ form_widget(registrationForm.adresse, {'attr': {'class': 'form-control'}}) }}
                        {{ form_errors(registrationForm.adresse) }}
                    </div>
                    <div class="form-group">
                        {{ form_label(registrationForm.plainPassword, 'Mot de passe') }}
                        {{ form_widget(registrationForm.plainPassword, {'attr': {'class': 'form-control'}}) }}
                        {{ form_errors(registrationForm.plainPassword) }}
                    </div>
                </div>

                <div class="form-check">
                    {{ form_widget(registrationForm.agreeTerms) }}
                    {{ form_label(registrationForm.agreeTerms, 'J\'accepte les conditions d\'utilisation') }}
                    {{ form_errors(registrationForm.agreeTerms) }}
                </div>

                <button type="submit" class="btn-register">S'inscrire</button>
            {{ form_end(registrationForm) }}

            <div class="text-center">
                <p>Déjà inscrit ? <a href="{{ path('app_login') }}" class="registration-link">Connectez-vous ici</a></p>
            </div>
        </div>
    </div>
</div>
{% endblock %}