@extends('layouts.guest')

@section('title', __('ui.sign_in'))

@section('content')
    <div class="mb-7">
        <p class="text-xs font-medium uppercase tracking-widest text-muted-foreground">{{ __('ui.welcome_back') }}</p>
        <h2 class="mt-2 text-2xl font-semibold tracking-tight text-foreground">{{ __('ui.sign_in_to_account') }}</h2>
        <p class="mt-2 text-sm text-muted-foreground">{{ __('ui.login_help') }}</p>
    </div>

    <form method="POST" action="{{ route('login.store') }}" class="space-y-5">
        @csrf
        <div>
            <label for="login" class="mf-field-label">{{ __('ui.email_or_username') }}</label>
            <input id="login" name="login" type="text" value="{{ old('login') }}" autocomplete="username" autofocus required class="mf-input @error('login') is-invalid @enderror" placeholder="admin or name@company.com">
            @error('login')<p class="mf-field-error">{{ $message }}</p>@enderror
        </div>
        <div>
            <div class="mb-2 flex items-center justify-between gap-3">
                <label for="password" class="mf-field-label mb-0">{{ __('ui.password') }}</label>
                <a href="{{ route('password.request') }}" class="text-xs font-medium text-primary hover:underline">{{ __('ui.forgot_password') }}</a>
            </div>
            <input id="password" name="password" type="password" autocomplete="current-password" required class="mf-input @error('password') is-invalid @enderror" placeholder="{{ __('ui.enter_password') }}">
            @error('password')<p class="mf-field-error">{{ $message }}</p>@enderror
        </div>
        <label class="inline-flex cursor-pointer items-center gap-2.5 text-sm text-muted-foreground">
            <input type="checkbox" name="remember" value="1" class="mf-checkbox" {{ old('remember') ? 'checked' : '' }}>
            <span>{{ __('ui.keep_signed_in') }}</span>
        </label>
        <button type="submit" class="mf-btn mf-btn-primary h-10 w-full">{{ __('ui.sign_in') }}</button>
    </form>
@endsection
