<x-guest-layout>
    <!-- Session Status -->
    @if (session('status'))
        <div class="alert alert-success">
            {{ session('status') }}
        </div>
    @endif

    @if ($errors->any())
        <div class="alert alert-error">
            E-posta veya şifre hatalı. Lütfen tekrar deneyin.
        </div>
    @endif

    <form method="POST" action="{{ route('login') }}">
        @csrf

        <!-- Email -->
        <div class="input-group">
            <label for="email">📧 E-posta Adresi</label>
            <input id="email" type="email" name="email" value="{{ old('email') }}"
                   required autofocus autocomplete="username"
                   placeholder="ornek@email.com">
            @error('email')
                <p class="text-error">{{ $message }}</p>
            @enderror
        </div>

        <!-- Password -->
        <div class="input-group">
            <label for="password">🔒 Şifre</label>
            <input id="password" type="password" name="password"
                   required autocomplete="current-password"
                   placeholder="••••••••">
            @error('password')
                <p class="text-error">{{ $message }}</p>
            @enderror
        </div>

        <!-- Remember + Forgot -->
        <div class="auth-links">
            <label class="checkbox-group">
                <input type="checkbox" name="remember" id="remember_me">
                <label for="remember_me">Beni hatırla</label>
            </label>

            @if (Route::has('password.request'))
                <a href="{{ route('password.request') }}">Şifremi unuttum</a>
            @endif
        </div>

        <!-- Submit -->
        <button type="submit" class="btn-primary">
            🔐 Giriş Yap
        </button>

        <!-- Register Link -->
        <div class="auth-switch">
            Hesabınız yok mu?<a href="{{ route('register') }}">Kayıt Ol →</a>
        </div>
    </form>
</x-guest-layout>
