@extends('layouts.app')

@section('title', 'Login - TUNJUK-i')

@section('content')
<div class="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
    <div class="max-w-md w-full space-y-8 bg-white p-8 rounded-lg shadow-md">
        <div>
            <h2 class="text-center text-3xl font-extrabold text-[#0b2b4a]">
                TUNJUK-i
            </h2>
            <p class="mt-2 text-center text-sm text-gray-600">
                Login untuk mengakses dashboard
            </p>
        </div>

        @if(session('error'))
            <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded">
                {{ session('error') }}
            </div>
        @endif

        @if($errors->any())
            <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded">
                @foreach($errors->all() as $error)
                    <p>{{ $error }}</p>
                @endforeach
            </div>
        @endif

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

            <div class="rounded-md shadow-sm -space-y-px">
                <div>
                    <label for="email" class="sr-only">Email</label>
                    <input id="email" name="email" type="email" required
                           class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:ring-[#0b2b4a] focus:border-[#0b2b4a] focus:z-10 sm:text-sm"
                           placeholder="Email" value="admin@tunjuk-i.id">
                </div>
                <div>
                    <label for="password" class="sr-only">Password</label>
                    <input id="password" name="password" type="password" required
                           class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-[#0b2b4a] focus:border-[#0b2b4a] focus:z-10 sm:text-sm"
                           placeholder="Password" value="password">
                </div>
            </div>

            <div>
                <button type="submit"
                        class="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-[#0b2b4a] hover:bg-[#1a4a6e] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#0b2b4a]">
                    Login
                </button>
            </div>
        </form>

        <p class="text-center text-sm text-gray-600">
            Belum punya akun?
            <a href="{{ route('register') }}" class="font-medium text-[#0b2b4a] hover:text-[#1a4a6e]">
                Register
            </a>
        </p>
    </div>
</div>
@endsection