@extends('frontend::layouts.auth')

@section('title')
    {{ __('Login') }}
@endsection
@section('content')
    <!-- Sign area start -->
    <div class="td-authentication">
        <div class="container">
            <div class="td-authentication-box">
                <a href="{{ route('home') }}" class="td-authentication-box-logo">
                    <img class="td-authentication-box-logo-img" src="{{ asset(setting('site_logo')) }}" alt="">
                </a>
                <div class="row g-4 g-lg-5">
                    <div class="col-md-6 td-authentication-left">
                        <div class="td-authentication-left-box">
                            <h2>{{ $data['title'] }}</h2>
                            <form action="{{ route('login') }}" method="POST"
                                class="td-authentication-left-box-forms common-form">
                                @csrf

                                @foreach ($errors->all() as $error)
                                    <div class="alert alert-danger">
                                        {{ $error }}
                                    </div>
                                @endforeach

                                <div class="row g-2 g-lg-3">
                                    <div class="col-lg-12">
                                        <div class="form-floating common-form-item">
                                            <input type="email" name="email" class="form-control" id="floatingInput"
                                                placeholder="{{ __('Email Address') }}" value="{{ old('email') }}">
                                            <label for="floatingInput">{{ __('Email Address') }}</label>
                                        </div>
                                    </div>
                                    <div class="col-lg-12">
                                        <div class="form-floating common-form-item">
                                            <input type="password" name="password" class="form-control" id="floatingInput2"
                                                placeholder="Password">
                                            <label for="floatingInput2">{{ __('Password') }}</label>
                                        </div>
                                    </div>
                                    <div class="col-lg-12">
                                        <div class="checkbox-and-forgot-pass">
                                            <div class="form-check">
                                                <input class="form-check-input custom-form-check-input" name="remember_me"
                                                    type="checkbox" value="" id="rememberMe">
                                                <label class="form-check-label custom-form-check-label" for="rememberMe">
                                                    {{ __('Remember me') }}
                                                </label>
                                            </div>
                                            <a href="{{ route('password.request') }}">{{ __('Forgot Password') }}</a>
                                        </div>
                                    </div>
                                    @if ($googleReCaptcha)
                                        <div class="col-lg-12">
                                            <div class="g-recaptcha mb-3" id="feedback-recaptcha"
                                                data-sitekey="{{ json_decode($googleReCaptcha->data, true)['site_key'] }}">
                                            </div>
                                        </div>
                                    @endif
                                </div>

                                <div class="td-authentication-left-box-forms-button">
                                    <button class="td-btn td-btn-fullWidth">
                                        <span class="td-btn-wrap">
                                            <span class="td-btn-y-1">{{ __('Log in') }}</span>
                                            <span class="td-btn-y-2">{{ __('Log in') }}</span>
                                        </span>
                                        <i></i>
                                    </button>
                                </div>
                            </form>
                            <div class="td-authentication-left-box-button">
                                <p class="td-authentication-left-box-button-authPage">{{ __('Don’t have an account?') }} <a
                                        href="{{ route('register') }}">{{ __('Sign up') }}</a>
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6 td-authentication-right">
                        <div class="td-authentication-right-box">
                            <div class="swiper myAuthSwipper">
                                <div class="swiper-wrapper">
                                    @foreach ($landingContents as $content)
                                        <div class="swiper-slide">
                                            <div class="clipped-image">
                                                <img src="{{ asset($content->photo) }}" alt="Clipped Image">
                                                <div class="clipped-image-text">
                                                    <h2>{{ $content->title }}</h2>
                                                </div>
                                            </div>
                                        </div>
                                    @endforeach
                                </div>
                                <div class="swiper-pagination"></div>
                            </div>
                            <div class="td-authentication-right-box-circle"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="td-authentication-circle"></div>
        <div class="td-authentication-bottom">
            <img src="{{ asset('frontend/default/img/authentication/auth-bottom-element.svg') }}" alt="">
        </div>
        <div class="td-authentication-top">
            <img src="{{ asset('frontend/default/img/authentication/auth-top-element.svg') }}" alt="">
        </div>
    </div>
    <!-- Sign area end -->
@endsection
@push('js')
    @if ($googleReCaptcha)
        <script src="https://www.google.com/recaptcha/api.js" async defer></script>
    @endif
@endpush
