@extends('layouts.master')

@section('content')
<div class="container" style="max-width: 500px; margin-top: 2rem;">
    <div class="card">
        <div class="card-header">تسجيل الدخول</div>
        <div class="card-body">
            <form method="POST" action="{{ request()->is('admin/*') ? url('/admin/login') : route('login') }}">
                @csrf

                <div class="form-group">
                    <label for="email">البريد الإلكتروني</label>
                    <input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required autofocus>
                    @if ($errors->has('email'))
                        <span class="invalid-feedback" role="alert">
                            <strong>{{ $errors->first('email') }}</strong>
                        </span>
                    @endif
                </div>

                <div class="form-group">
                    <label for="password">كلمة المرور</label>
                    <input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>
                    @if ($errors->has('password'))
                        <span class="invalid-feedback" role="alert">
                            <strong>{{ $errors->first('password') }}</strong>
                        </span>
                    @endif
                </div>

                <div class="form-group">
                    <div class="form-check">
                        <input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
                        <label class="form-check-label" for="remember" style="margin-right: 1.2rem;">تذكرني</label>
                    </div>
                </div>

                <div class="form-group" style="text-align: center;">
                    <button type="submit" class="btn btn-primary">دخول</button>
                    <a class="btn btn-link" href="{{ route('password.request') }}">
                        نسيت كلمة المرور؟
                    </a>
                </div>
            </form>
        </div>
    </div>
</div>
@endsection
