@extends('layouts.auth')

@section('content')
    <!--begin::Card-->
    <div class="bg-body d-flex flex-column align-items-stretch flex-center rounded-4 w-md-600px p-20">
        <!--begin::Wrapper-->
        <div class="d-flex flex-center flex-column flex-column-fluid px-lg-10 pb-15 pb-lg-20">
            <!--begin::Form-->
            <form class="form w-100" novalidate="novalidate" method="POST" action="{{ route('register') }}">

                @csrf

                <!--begin::Heading-->
                <div class="text-center mb-11">
                    <!--begin::Title-->
                    <h1 class="text-gray-900 fw-bolder mb-3">Inscription</h1>
                    <!--end::Title-->
                </div>
                <!--begin::Heading-->

                @if(session()->has('success'))
                <!--begin::Alert-->
                <div class="alert alert-dismissible bg-success d-flex flex-column flex-sm-row w-100 p-5 mb-10">
                    <!--begin::Content-->
                    <div class="d-flex flex-column text-light pe-0 pe-sm-10">
                        <h4 class="mb-2 text-light">{{ session('success') }}</h4>
                    </div>
                    <!--end::Content-->
                </div>
                <!--end::Alert-->
                @endif

                <div class="fv-row mb-8">
                    <label for="exampleFormControlInput1" class="required form-label">Email</label>
                    <input type="email" placeholder="Email" name="email"  value="{{ old('email') }}" class="form-control bg-transparent" />
                    @error('email')
                    <div
                        class="fv-plugins-message-container fv-plugins-message-container--enabled invalid-feedback">
                        {{ $message }}
                    </div>
                    @enderror
                </div>

                <div class="fv-row mb-8">
                    <label for="exampleFormControlInput1" class="required form-label">Mot de passe</label>
                    <input type="password" placeholder="Mot de passe" name="password" class="form-control bg-transparent" />
                    @error('password')
                    <div
                        class="fv-plugins-message-container fv-plugins-message-container--enabled invalid-feedback">
                        {{ $message }}
                    </div>
                    @enderror
                </div>

                <div class="fv-row mb-8">
                    <label for="exampleFormControlInput1" class="required form-label">Confirmer le mot de passe</label>
                    <input type="password" placeholder="Confirmer le mot de passe" name="password_confirmation"  class="form-control bg-transparent" />
                    @error('password_confirmation')
                    <div
                        class="fv-plugins-message-container fv-plugins-message-container--enabled invalid-feedback">
                        {{ $message }}
                    </div>
                    @enderror
                </div>

                <!--begin::Submit button-->
                <div class="d-grid mb-10">
                    <button type="submit" id="kt_sign_up_submit" class="btn btn-primary">
                        <!--begin::Indicator label-->
                        <span class="indicator-label">S'inscrire</span>
                        <!--end::Indicator label-->
                    </button>
                </div>
                <!--end::Submit button-->
            </form>
            <!--end::Form-->
        </div>
        <!--end::Wrapper-->
    </div>
    <!--end::Card-->
@endsection
