<x-layouts.auth title="{{ config('app.name') }} | Secure Access">
<main class="flex-grow flex items-center justify-center px-6 py-20">
    <div class="w-full max-w-lg flex flex-col items-center">
        <div class="mb-12 text-center">
            <h1 class="text-4xl serif-italic text-on-surface tracking-tight mb-2">{{ config('app.name') }}</h1>
            <p class="text-secondary font-label tracking-[0.2em] text-[10px] uppercase">Secure Online Banking</p>
        </div>
        <div class="w-full bg-surface-container-lowest p-10 lg:p-14 rounded-lg shadow-[0_24px_48px_rgba(0,0,0,0.03)] border border-outline-variant/10">
            <header class="mb-10">
                <h2 class="text-2xl serif-bold text-on-surface mb-2">Secure Access</h2>
                <p class="text-on-surface-variant text-sm font-label">Please enter your credentials to manage your estate.</p>
            </header>

            @if($errors->any())
                <div class="mb-6 bg-error-container text-on-error-container p-4 rounded-sm text-sm">
                    @foreach($errors->all() as $error)
                        <p>{{ $error }}</p>
                    @endforeach
                </div>
            @endif

            <form class="space-y-8" method="POST" action="{{ route('login') }}">
                @csrf
                <div class="space-y-1">
                    <label class="text-[11px] font-semibold text-secondary uppercase tracking-wider" for="email">Email Address</label>
                    <input class="w-full bg-surface-container-high border-none rounded-sm py-3 px-4 text-on-surface font-body input-focus-gold transition-all duration-200" id="email" name="email" placeholder="Enter your registered email" type="email" value="{{ old('email') }}" required/>
                </div>
                <div class="space-y-1">
                    <div class="flex justify-between items-center">
                        <label class="text-[11px] font-semibold text-secondary uppercase tracking-wider" for="password">Password</label>
                    </div>
                    <div class="relative">
                        <input class="w-full bg-surface-container-high border-none rounded-sm py-3 px-4 pr-12 text-on-surface font-body input-focus-gold transition-all duration-200" id="password" name="password" placeholder="••••••••" type="password" required/>
                        <button class="absolute right-4 top-1/2 -translate-y-1/2 text-on-surface-variant hover:text-on-surface" type="button" onclick="togglePassword()">
                            <span class="material-symbols-outlined text-lg" id="eye-icon">visibility</span>
                        </button>
                    </div>
                </div>
                <div class="flex items-center space-x-2">
                    <input class="h-4 w-4 rounded-sm border-outline-variant text-secondary focus:ring-secondary transition-all" id="remember" name="remember" type="checkbox" {{ old('remember') ? 'checked' : '' }}/>
                    <label class="text-sm text-on-surface-variant font-label" for="remember">Remember me on this device</label>
                </div>
                <div class="pt-4 flex flex-col space-y-6">
                    <button class="w-full bg-primary hover:bg-primary-container text-on-primary font-label text-sm font-semibold py-4 rounded-sm transition-all duration-300 shadow-sm" type="submit">
                        SIGN IN
                    </button>
                    <div class="relative flex py-2 items-center">
                        <div class="flex-grow border-t border-outline-variant/30"></div>
                        <span class="flex-shrink mx-4 text-on-surface-variant text-[10px] font-label tracking-widest uppercase">Biometric Verification</span>
                        <div class="flex-grow border-t border-outline-variant/30"></div>
                    </div>
                    <div class="flex justify-center space-x-8">
                        <button class="group flex flex-col items-center space-y-2 opacity-60 hover:opacity-100 transition-opacity" type="button">
                            <div class="w-14 h-14 rounded-full border border-outline-variant/40 flex items-center justify-center group-hover:border-secondary transition-colors">
                                <span class="material-symbols-outlined text-3xl text-on-surface">face</span>
                            </div>
                            <span class="text-[10px] font-semibold text-on-surface-variant tracking-tighter uppercase">Face ID</span>
                        </button>
                        <button class="group flex flex-col items-center space-y-2 opacity-60 hover:opacity-100 transition-opacity" type="button">
                            <div class="w-14 h-14 rounded-full border border-outline-variant/40 flex items-center justify-center group-hover:border-secondary transition-colors">
                                <span class="material-symbols-outlined text-3xl text-on-surface">fingerprint</span>
                            </div>
                            <span class="text-[10px] font-semibold text-on-surface-variant tracking-tighter uppercase">Touch ID</span>
                        </button>
                    </div>
                </div>
            </form>
            <footer class="mt-12 pt-8 border-t border-outline-variant/10 text-center">
                <p class="text-on-surface-variant text-xs">
                    Don't have an account?
                    <a class="text-secondary font-semibold hover:text-primary transition-colors ml-1" href="{{ route('register') }}">Inquire About Membership</a>
                </p>
            </footer>
        </div>
        <div class="mt-12 text-center flex items-center space-x-6">
            <a class="text-[10px] text-on-surface-variant hover:text-on-surface uppercase tracking-widest font-label transition-colors" href="#">Privacy Policy</a>
            <span class="w-1 h-1 rounded-full bg-outline-variant"></span>
            <a class="text-[10px] text-on-surface-variant hover:text-on-surface uppercase tracking-widest font-label transition-colors" href="#">Security Standards</a>
            <span class="w-1 h-1 rounded-full bg-outline-variant"></span>
            <a class="text-[10px] text-on-surface-variant hover:text-on-surface uppercase tracking-widest font-label transition-colors" href="#">Contact Concierge</a>
        </div>
    </div>
</main>

@push('scripts')
<script>
    function togglePassword() {
        const pw = document.getElementById('password');
        const icon = document.getElementById('eye-icon');
        if (pw.type === 'password') { pw.type = 'text'; icon.textContent = 'visibility_off'; }
        else { pw.type = 'password'; icon.textContent = 'visibility'; }
    }
</script>
@endpush
</x-layouts.auth>
