<x-guest-layout>
    <div class="mb-6">
        <h2 class="text-xl font-bold text-white">Welcome back</h2>
        <p class="mt-1 text-sm text-slate-400">Sign in to your trading account</p>
    </div>

    @if (session('status'))
        <div class="mb-4 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3 text-sm text-emerald-300">
            {{ session('status') }}
        </div>
    @endif

    <form method="POST" action="{{ route('login') }}" class="space-y-5">
        @csrf

        <div>
            <label for="email" class="trade-label">Email</label>
            <input id="email"
                   type="email"
                   name="email"
                   value="{{ old('email') }}"
                   required
                   autofocus
                   autocomplete="username"
                   placeholder="admin@autotrade.local"
                   class="trade-input @error('email') border-rose-500/50 @enderror">
            @error('email')
                <p class="mt-1.5 text-sm text-rose-400">{{ $message }}</p>
            @enderror
        </div>

        <div>
            <label for="password" class="trade-label">Password</label>
            <input id="password"
                   type="password"
                   name="password"
                   required
                   autocomplete="current-password"
                   placeholder="••••••••"
                   class="trade-input @error('password') border-rose-500/50 @enderror">
            @error('password')
                <p class="mt-1.5 text-sm text-rose-400">{{ $message }}</p>
            @enderror
        </div>

        <div class="flex items-center justify-between">
            <label for="remember_me" class="inline-flex cursor-pointer items-center gap-2">
                <input id="remember_me"
                       type="checkbox"
                       name="remember"
                       class="rounded border-trade-border bg-trade-panel text-emerald-500 focus:ring-emerald-500/30">
                <span class="text-sm text-slate-400">Remember me</span>
            </label>

            @if (Route::has('password.request'))
                <a href="{{ route('password.request') }}" class="text-sm text-slate-400 transition hover:text-emerald-400">
                    Forgot password?
                </a>
            @endif
        </div>

        <button type="submit" class="trade-btn-primary w-full py-3">
            Sign in
        </button>
    </form>
</x-guest-layout>
