@extends('dashboard.authBase')

@section('content')


<div class="container">

    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card">
                @if (isset($type) && $type == 'consultant')
                <div class="card-header text-center" style="color:#000;">
                    <h2>{{ __('Consultant Login') }}</h2>
                </div>
                @else
                <div class="card-header text-center" style="color:#000;">
                    <h2>
                       @if (isset($type) && $type == 'client')
                                {{ __('Client Login') }} 
                            @elseif(isset($type) && $type == 'consultant')
                               {{ __('Consultant Login') }} 
                            @else
                                {{ __('Admin Login') }}   
                            @endif 

                    </h2>
                </div>
                @endif

                <div class="card-body bg-white text-dark">
                    <form method="POST" action="{{ route('login') }}">
                        @csrf
                        @if (session('msg'))
                        <div class="alert alert-success">
                            {{ session('msg') }}
                        </div>
                        @endif
                        @if (isset($type) && $type == 'consultant')
                        <div class="form-group row mt-3">
                            <label for="email" class="col-sm-4 col-form-label text-md-right" style="color:#000;">{{
                                __('PEC Number') }}</label>

                            <div class="col-md-6">
                                <input id="email" type="phone"
                                    class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email"
                                    value="{{ old('email') }}" required autofocus>

                                @if ($errors->has('email'))
                                <span class="invalid-feedback">
                                    <strong>{{ $errors->first('email') }}</strong>
                                </span>
                                @endif
                            </div>
                        </div>
                        @else
                        <div class="form-group row mt-3">
                            <label for="email" class="col-sm-4 col-form-label text-md-right" style="color:#000;">
                            @if (isset($type) && $type == 'client')
                                {{__('Mobile Number') }}
                            @else
                                {{__('E-Mail Address') }}   
                            @endif
                            </label>

                            <div class="col-md-6">
                                <input id="email" 
                                     @if (isset($type) && $type == 'client')
                                        type="text"
                                    @else
                                        type="email"   
                                    @endif

                                    
                                    class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email"
                                    value="{{ old('email') }}" required autofocus>

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

                        <div class="form-group row">
                            <label for="password" class="col-md-4 col-form-label text-md-right" style="color:#000;">{{
                                __('Password') }}</label>

                            <div class="col-md-6">
                                <input id="password" type="password"
                                    class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}"
                                    name="password" required>

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

                        <!-- <div class="form-group row">
                            <div class="col-md-6 offset-md-4">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" name="remember" {{ old('remember') ? 'checked' : '' }}> {{ __('Remember Me') }}
                                    </label>
                                </div>
                            </div>
                        </div> -->

                        <div class="form-group row mb-4">
                            <div class="col-md-2 offset-md-4">
                                <button type="submit" class="btn" style="background-color: #004E1E; color: #fff;">
                                    {{ __('Login') }}
                                </button>
                            </div>
                            <div class="col-4 text-right text-dark">
                                <a href="{{ route('password.request') }}" class="btn btn-link  px-0"
                                    style="color:#000;">{{ __('Forgot Your Password?') }}</a>
                            </div>
                        </div>

                        <div class="form-group row mb-4">
                            @if (isset($type) && $type == 'client')
                                <div class="col-4 text-right">
                                    <a href="{{url('/clients/create')}}" class="btn btn-link  px-0" style="color:#000;">Client Sign
                                        Up</a>
                                </div>
                            @elseif(isset($type) && $type == 'consultant')
                               <div class="col-6 text-center">
                                    <a href="{{url('/consultants/create')}}" class="btn btn-link  px-0" style="color:#000;">Consultant
                                        Sign Up</a>
                                </div> 
                            @else
                            
                            @endif  
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
