@extends('layouts.landing_page.master')

@section('title', __('2FA authenticate'))

@push('styles')
    <link href="{{ asset('frontend/styles/css/page-css/login-register-page.css') }}" rel="stylesheet">
@endpush

@section('content')
<section id="signin" class="h-100vh">
    <div class="container bgm-shadows">
        <div class="row">
            <div class="col-lg-7 col-md-12 col-sm-12 col-12">
                <img class="d-block" src="{{ asset('frontend/images/logo.png') }}" alt="..." width="95px"
                height="95px" />
                <h2 class="lgm-title mt-2">{{ __('Sign In') }}</h2>
            </div>
            <div class="col-lg-1 col-md-12 col-sm-12 col-12"></div>
            <div class="col-lg-4 col-md-12 col-sm-12 col-12">
                <h4 class="mt-2 fs-4 fw-bold">{{ __('Please Enter Your 6-Digit Code') }}</h4>
                @if(isset($MFPAuthType) && $MFPAuthType !== false)
                    <p class="fs-6">{{ __('We noticed a sign-in from a device you don’t usually use. To help keep your account safe, please verify it’s you.')}}</p>
                @else
                    <p class="fs-6">{{ __('To help keep your account safe, please verify it’s you.')}}</p>
                @endif
                <div id="sign_in_box" class="guest-box">
                    @include('frontend.auth.2fa-3fa-validate-form',['showModalCancelBtn' => false,'type' => 'login'])
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</section>
@endsection

<?php
$faSetting = $userSetting->fa_setting;
if (!empty($faSetting) && !in_array('login',$faSetting)){
    $faSetting = null;
}
$fa3Setting = $userSetting->fa3_setting;
if(isset($MFPAuthType) && $MFPAuthType !== false){
    if ($MFPAuthType == 'otp') {
        $fa3Setting[] = 'login';
    } else {
        $faSetting[] = 'login';
    }
}
?>
@push('scripts')
    @if(empty($faSetting))
        <script>
            document.addEventListener("DOMContentLoaded", function () {
                startResendOtpTimer();
            });
        </script>
    @endif

    <script src="{{asset('frontend/js/custom-frontend.js')}}"></script>
@endpush
