<div class="min-h-screen grid lg:grid-cols-2">

    {{-- LEFT SIDE (BRANDING) --}}
    <div class="hidden lg:flex flex-col justify-between bg-gradient-to-br from-primary to-primary/80 text-white p-10">

        <div>
            <x-logo mode="!fill-white" class="w-40 h-16"/>
        </div>

        <div class="space-y-6 max-w-md">
            <h1 class="text-3xl font-semibold leading-tight">
                {{ t('auth.login.hero.title') }}
            </h1>

            <p class="text-sm text-white/80">
                {{ t('auth.login.hero.subtitle') }}
            </p>

            <div class="space-y-2 text-sm text-white/70">
                <div>✓ {{ t('auth.hero.features.reminders') }}</div>
                <div>✓ {{ t('auth.hero.features.assistant') }}</div>
                <div>✓ {{ t('auth.hero.features.cross_device') }}</div>
            </div>
        </div>

        <div class="text-xs text-white/50">
            © {{ date('Y') }} {{ config('app.name')  }}. {{ t('auth.hero.copyright') }}
        </div>

    </div>


    {{-- RIGHT SIDE (LOGIN) --}}
    <div class="relative flex items-center justify-center p-6 overflow-hidden">

        <div class="w-full max-w-md space-y-6 z-10">
            {{-- MOBILE LOGO --}}
            <div class="lg:hidden text-center">
                <x-logo class="w-40 h-16 mx-auto"/>
            </div>

            {{-- CARD --}}
            <div class="bg-surface border border-border rounded-2xl p-6 shadow-card space-y-5">

                <div class="text-center">
                    <h2 class="text-xl font-semibold text-text">{{ t('auth.login.title') }}</h2>
                    <p class="text-sm text-text-muted">{{ t('auth.login.subtitle') }}</p>
                </div>

                @if(session()->has('success'))
                    <div class="bg-green-100 text-green-700 px-4 py-3 rounded-lg text-sm text-center w-fit mx-auto">
                        {{ session('success') }}
                    </div>
                @endif

                <form wire:submit.prevent="login" class="space-y-4">

                    {{-- EMAIL --}}
                    <div>
                        <input
                            type="text"
                            placeholder="{{ t('auth.login.email_placeholder') }}"
                            wire:model="email"
                            class="w-full border rounded-xl px-4 py-3 text-sm
                            {{ $errors->has('email') ? 'border-danger' : 'border-border' }}"
                        >

                        <div class="h-4 mt-1">
                            @error('email')
                            <p class="text-xs text-danger">{{ $message }}</p>
                            @enderror
                        </div>
                    </div>

                    {{-- PASSWORD --}}
                    <div>
                        <input
                            type="password"
                            placeholder="{{ t('auth.login.password_placeholder') }}"
                            wire:model="password"
                            class="w-full border rounded-xl px-4 py-3 text-sm
                            {{ $errors->has('password') ? 'border-danger' : 'border-border' }}"
                        >

                        <div class="h-4 mt-1">
                            @error('password')
                            <p class="text-xs text-danger">{{ $message }}</p>
                            @enderror
                        </div>
                    </div>

                    {{-- BUTTON --}}
                    <button
                        type="submit"
                        class="w-full bg-primary text-white py-3 rounded-xl transition hover:opacity-90"
                    >
                        {{ t('auth.login.button') }}
                    </button>

                </form>

                <div class="flex items-center justify-between text-sm">
                    <a href="{{ route('register') }}" class="text-primary hover:underline">
                        {{ t('auth.login.no_account') }}
                    </a>
                    <a href="{{ route('password.request') }}" class="text-text-muted hover:text-primary">
                        Passwort vergessen?
                    </a>
                </div>

            </div>

        </div>

    </div>

</div>
