@extends('Dashboard.auth_master_page')

@section('meta_title')
    {{ 'Email Verification - Aryanict.com' }}
@endsection


@section('title')
    <span>Verification OTP</span>
@endsection


@section('description')
    <p>
        Please check your given email the OTP has been sent in order
        to verify your account!
    </p>
@endsection


@section('content')

<div class="row g-0 justify-content-center">
    <div class="col-sm-8 col-xl-4">
      <form  action="{{ route('verify.email.verfication') }}"  method="POST" >
        @csrf
        <div class="mb-4">
          <input type="text" class="form-control form-control-lg form-control-alt py-3 @error('verify') is-invalid @enderror" value="{{ old('verify') }}" name="verify" placeholder="Enter OTP here">
          <input type="hidden" name="email" value="{{ session()->get('user_data.email') }}">
          @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('verify')
          <div  class="invalid-feedback animated fadeIn">{{ $message }}</div>
          @enderror
        </div>

        <div class="text-center">
            <a  href="{{ route('change.email.verification') }}" style="margin-right: 10px"> Change Email</a>

          <button type="submit" class="btn btn-lg btn-alt-primary">
            <i class="fa fa-fw fa-envelope me-1 opacity-50"></i> Verify Now
          </button>
          
        </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


