@extends('layouts.frontend')

@section('title', 'Registrarse')

@section('content')
    <article class="page">
        <div class="breadcrumb">
            <div class="container d-flex align-items-center">
                <a href="{{ url('/') }}">Inicio</a>
                <span>@yield('title')</span>
            </div>
        </div>
        <section class="content">
            <div class="container">
                <div class="row justify-content-center">
                    <div class="col-md-6">
                        {!! Form::open() !!}
                        @if($errors->any())
                            <div class="alert alert-danger form-group">
                                @foreach($errors->all() as $error)
                                    {{ $error }}<br>
                                @endforeach
                            </div>
                        @endif
                        @if($status)
                            <div class="alert alert-success form-group">
                                {{ $status }}
                            </div>
                        @endif
                        <div class="form-group">
                            {!! Form::text('user_data[first_name]', null, ['placeholder' => 'Nombre *', 'required', 'class' => 'form-control']) !!}
                        </div>
                        <div class="form-group">
                            {!! Form::text('user_data[last_name]', null, ['placeholder' => 'Apellido *', 'required', 'class' => 'form-control']) !!}
                        </div>
                        <div class="form-group">
                            {!! Form::text('user_data[phone]', null, ['placeholder' => 'Teléfono *', 'required', 'class' => 'form-control']) !!}
                        </div>
                        <div class="form-group">
                            {!! Form::email('email', null, ['placeholder' => 'Email *', 'required', 'class' => 'form-control']) !!}
                        </div>
                        <div class="form-group">
                            {!! Form::text('name', null, ['placeholder' => 'Nombre de usuario (opcional)', 'required', 'class' => 'form-control']) !!}
                        </div>
                        <div class="form-group">
                            {!! Form::password('password', ['placeholder' => 'Contraseña', 'required', 'class' => 'form-control']) !!}
                        </div>
                        <div class="form-group">
                            {!! Form::password('password_confirmation', ['placeholder' => 'Confirmar contraseña', 'required', 'class' => 'form-control']) !!}
                        </div>
                        <div class="form-group">
                            <button type="submit" class="btn">
                                <span>Crear cuenta</span>
                                <i class="far fa-arrow-right"></i>
                            </button>
                        </div>
                        {!! Form::close() !!}
                    </div>
                </div>
            </div>
        </section>
    </article>
@endsection
