@extends('Dashboard.auth_master_page')




@section('meta_title')
    {{ 'Password Reset - Aryanict.com' }}
@endsection


@section('title')
    <span>Forgot your password?</span>
@endsection

@if(!Session::has('success_message'))

@section('description')
    <p>
        Enter your myLEAP email to request a password reset
    </p>
@endsection

@endif


@section('content')

<div class="row g-0 justify-content-center">
    <div class="col-sm-8 col-xl-4">
      <form class="js-validation-reminder" action="{{ route('password.email') }}?token={{ csrf_token() }}"  method="POST" id="email_form">
        @csrf
        <div class="mb-4">
          @if(!Session::has('success_message'))
          <input type="email" class="form-control form-control-lg form-control-alt py-3 @error('email') is-invalid @enderror" value="{{ old('email') }}" id="reminder-credential" name="email" placeholder="Email">
          @endif
          @if(Session::has('success_message'))
          <div style="color:green;font-size: .875rem;margin-top: .375rem;width:100%">{{ Session::get('success_message') }}</div>
          @endif

          @if(Session::has('error_message'))
           <div style="color:#dc2626;font-size: .875rem;margin-top: .375rem;width:100%">{{ Session::get('error_message') }}</div>
          @endif

          @error('email')
          <div  class="invalid-feedback animated fadeIn">{{ $message }}</div>
          @enderror
        </div>

        @if(!Session::has('success_message'))

        <div class="mb-4">
            {!! NoCaptcha::renderJs() !!}
            {!! NoCaptcha::display() !!}

            @error('g-recaptcha-response')
           <div style="color:#dc2626;font-size: .875rem;margin-top: .375rem;width:100%">{{ $message }}</div>
            @enderror
          
            
        </div>
        @endif
        <br>
        <div class="text-center">
            <a href="/" style="margin-right: 10px">Back to Login Page</a>

            @if(!Session::has('success_message'))
          <button type="submit" class="btn btn-lg btn-alt-primary">
             Continue
          </button>
          @endif
          
        </div>
      </form>
    </div>
  </div>




@endsection

@section('script')
<script>
    $(function() {
        $('#email_form').submit(function(event) {
            var verified = grecaptcha.getResponse();
            if (verified.length === 0) {
                event.preventDefault();
            }
        });
    });
</script>

@endsection


