@extends('layouts.auth')

@section('content')

    <!-- Content -->
    <div class="authentication-wrapper authentication-2 ui-bg-cover ui-bg-overlay-container px-4" style="background-image: url({{asset('images/back.jpg')}});">
        <div class="ui-bg-overlay bg-dark opacity-25"></div>

        <div class="authentication-inner py-5">

            <div class="card bg-body">
                <div class="p-4 p-sm-4" style="adding-bottom: 0.25rem !important;">
                    <!-- Logo -->
                    <div class="d-flex justify-content-center align-items-center pb-2 mb-4">
                        <div class="">
                            <div class="w-100 position-relative">
                                <a href="/"><img src="{{ asset('/images/gruene-seele-logo.jpg') }}" alt="gruene-seele-logo" class=""></a>
                            </div>
                        </div>
                    </div>
                    <!-- / Logo -->

                    <h5 class="text-center text-muted font-weight-normal mb-4">{{ __('Register') }}</h5>

                    <form method="POST" class="my-3" action="{{ route('user_register') }}" aria-label="{{ __('Register') }}">
                        @csrf
                        @if(isset($from_member_id))
                            {!! Form::hidden('from_member_id', $from_member_id) !!}
                        @endif
                        <div class="form-group">
                            <label for="salutation" class="form-label">{{ __('Salutation') }}*</label>

                            {!! Form::select('salutation', [''=>'Bitte wählen', 'mr'=>'Herr', 'ms'=>'Frau'], '', ['class' => 'form-control '.($errors->has('salutation') ? 'error is-invalid' : ''), 'required'=>false]) !!}
                            @if ($errors->has('salutation'))
                                <span class="invalid-feedback" role="alert">
                                    <strong>{{ $errors->first('salutation') }}</strong>
                                </span>
                            @endif
                        </div>

                        <div class="form-group">
                            <label for="first_name" class="form-label">{{ __('First name') }}*</label>
                            <input id="first_name" type="first_name" class="form-control{{ $errors->has('first_name') ? ' is-invalid' : '' }}" name="first_name" value="{{ old('first_name') }}" required>
                            @if ($errors->has('first_name'))
                                <span class="invalid-feedback" role="alert">
                                        <strong>{{ $errors->first('first_name') }}</strong>
                                    </span>
                            @endif
                        </div>

                        <div class="form-group">
                            <label for="last_name" class="form-label">{{ __('Last name') }}*</label>
                            <input id="last_name" type="last_name" class="form-control{{ $errors->has('last_name') ? ' is-invalid' : '' }}" name="last_name" value="{{ old('last_name') }}" required>
                            @if ($errors->has('last_name'))
                                <span class="invalid-feedback" role="alert">
                                        <strong>{{ $errors->first('last_name') }}</strong>
                                    </span>
                            @endif
                        </div>


                        <div class="form-group">
                            <label for="email" class="form-label">{{ __('E-Mail Address') }}*</label>
                            <input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required>
                            @if ($errors->has('email'))
                                <span class="invalid-feedback" role="alert">
                                        <strong>{{ $errors->first('email') }}</strong>
                                    </span>
                            @endif
                        </div>
                        <div class="form-group">
                            <label for="password" class="form-label">{{ __('Password') }}*</label>
                            <input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>

                            @if ($errors->has('password'))
                                <span class="invalid-feedback" role="alert">
                                        <strong>{{ $errors->first('password') }}</strong>
                                    </span>
                            @endif
                        </div>
                        <div class="form-group">
                            <label for="password-confirm" class="form-label">{{ __('Confirm Password') }}*</label>
                            <input id="password-confirm" type="password" class="form-control{{ $errors->has('password-confirm') ? ' is-invalid' : '' }}" name="password_confirmation" required>

                            @if ($errors->has('password-confirm'))
                                <span class="invalid-feedback" role="alert">
                                        <strong>{{ $errors->first('password-confirm') }}</strong>
                                    </span>
                            @endif
                        </div>

                        <div class="d-flex justify-content-between align-items-center m-0">
                            <label class="custom-control custom-checkbox m-0">
                                <input type="checkbox" class="custom-control-input{{ $errors->has('accepted_data_protection') ? ' is-invalid' : '' }}" name="accepted_data_protection">
                                <span class="custom-control-label small" style="line-height: 1.2em !important;">{!! trans('register.reg_checked') !!}</span>
                            </label>

                        </div>
                        @if ($errors->has('accepted_data_protection'))
                            <div class="invalid-feedback d-block" role="alert">
                                <strong>{{ $errors->first('accepted_data_protection') }}</strong>
                            </div>
                        @endif
                        <button type="submit" class="btn btn-primary btn-block mt-4">  {{ __('Register') }}</button>
                        <div class="small text-muted mt-2 text-right">* {{trans('register.required_fields')}}</div>

                    </form>
                    <!-- / Form -->

                    <div class="card-footer">
                        <div class="text-center text-muted">
                            <a href="{{route('login')}}" class="btn btn-outline-primary mt-2 btn-sm">{{__('Login')}}</a>
                        </div>
                        <div class="mt-3 text-center">
                            <hr>
                            <a href="https://www.gruene-seele.bio/datenschutzerklaerung/" class="btn btn-outline-secondary mt-0 btn-sm">{{__('data protection')}}</a>
                            <a href="https://www.gruene-seele.bio/impressum/" class="btn btn-outline-secondary mt-0 btn-sm">{{__('imprint')}}</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection