{!! Form::open(['route' => 'Shop.register.post', 'method' => 'post', 'autocomplete' => 'off']) !!}
<div class="row green">
    <div class="col-12">
        <x-card title='Créez votre compte' class='mt-3 mb-3'>

            @include('Shop.Customers.partials.registration')

            <div class="row">
                <div class="col-6">
                    <div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
                        <label>Mot de passe *</label>
                        {{ Form::password('password', [
                            'class' => 'form-control',
                            'id' => 'password',
                            'placeholder' => __('boilerplate::auth.fields.password'),
                            'required',
                        ]) }}
                        {!! $errors->registration->first('password', '<p class="text-danger"><strong>:message</strong></p>') !!}
                        @include('Shop.auth.partials.password_rules', ['passwordInputId' => 'password'])
                    </div>
                </div>
                <div class="col-6">
                    <label>Confirmation du mot de passe *</label>
                    <div class="form-group {{ $errors->has('password_confirmation') ? 'has-error' : '' }}">
                        {{ Form::password('password_confirmation', [
                            'class' => 'form-control',
                            'placeholder' => __('boilerplate::auth.fields.password_confirm'),
                            'required',
                        ]) }}
                        {!! $errors->registration->first(
                            'password_confirmation',
                            '<p class="text-danger"><strong>:message</strong></p>',
                        ) !!}
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-12">
                    @include('components.form.checkboxes.icheck', [
                        'name' => 'use_for_delivery',
                        'value' => false,
                        'label' => 'Utiliser une autre adresse pour la livraison',
                    ])
                </div>
            </div>

            <div class="row d-none" id="address_delivery">
                <div class="col-12">
                    @include('Shop.Customers.partials.address', [
                        'label' => 'Adresse de livraison',
                        'prefix' => 'delivery_',
                    ])
                </div>
            </div>

        </x-card>

        <div class="row mbm">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
                <button type="submit" class="btn btn-green-dark">
                    {{ __('boilerplate::auth.register.register_button') }}
                </button>
            </div>
        </div>

    </div>
</div>
</form>

@include('load.form.password_toggle')

@push('js')
    <script>
        $('#use_for_delivery').click(function() {
            $('#address_delivery').toggleClass('d-none');
        })
    </script>
@endpush
