@extends('layouts.sub')

@section('content')
<div id="loginForm" class="container">
    <header>
        <a href="/" type="text/html" rel="noreferrer" referrerpolicy="no-referrer">
            {{ strtoupper(config('app.name')) }}
        </a>
    </header>
    <main>
        <h5>{{ __('Login') }}</h5>

        <form name="f_login" id="fLogin" method="post" action="{{ route('login') }}" accept-charset="UTF-8">
            @csrf
            <input type="hidden" name="callback" value="{{ request()->query('callback') }}"/>

            <!-- Email -->
            <div class="mb-3">
                <div class="row">
                    <label for="email" class="col-auto col-form-label">{{ __('Email Address') }}</label>
                    <div class="col align-self-center text-end pe-0">
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="checkbox" name="remember" id="remember" @if(old('remember')) checked @endif/>
                            <label class="form-check-label" for="remember">
                                {{ __('Remember Me') }}
                            </label>
                        </div>
                    </div>
                </div>
                <input id="email" type="text" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email', $email) }}" required autocomplete="email" autofocus/>

                @error('email')
                <span class="invalid-feedback" role="alert">
                    <strong>{{ $message }}</strong>
                </span>
                @enderror
            </div>

            <!-- Password -->
            <div class="mb-3">
                <label for="password" class="form-label">{{ __('Password') }}</label>
                <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" value="{{ $password }}" required autocomplete="current-password"/>

                @error('password')
                <span class="invalid-feedback" role="alert">
                    <strong>{{ $message }}</strong>
                </span>
                @enderror
            </div>

            <div class="mb-3">
                <button type="submit" class="btn btn-success w-100">
                    {{ __('Login') }}
                </button>
            </div>

            <div>
                <ul class="list-inline text-center">
                    @if (Route::has('register'))
                        <li class="list-inline-item">
                            <a href="{{ route('register') }}" class="btn btn-link">{{ __('Register') }}</a>
                        </li>
                    @endif
                        <li class="list-inline-item"><span>&nbsp;</span></li>
                    {{--
                        <li class="list-inline-item">
                            <a href="{{ route('auth.findID') }}" class="btn btn-link">아이디 찾기</a>
                        </li>
                        <li class="list-inline-item"><span>&nbsp;</span></li>
                    --}}
                    @if (Route::has('password.request'))
                        <li class="list-inline-item">
                            <a class="btn btn-link" href="{{ route('password.request') }}">비밀번호 재설정</a>
                        </li>
                    @endif
                </ul>
            </div>
        </form>

        <hr/>

        <footer>
            Copyright (C) @ {{ date('Y') }} {{ config('company_name') }} Corp. All Rights Reserved.
        </footer>
    </main>
</div>
@endsection

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

@push('scripts')
    <script src="{{ asset('/js/auth/login.js') }}" defer></script>
@endpush
