<x-auth-layout>
    <style>
        /* Override parent layout background */
        html, body, .min-h-screen, .bg-gray-100, [class*="bg-gray"], .dark\:bg-gray-900 {
            background: linear-gradient(135deg, #0a1628 0%, #1a2d4a 50%, #0f1d32 100%) !important;
            min-height: 100vh !important;
        }
        
        /* Hide the header logo/text from parent layout */
        body > div:first-child > a,
        body > div:first-child > div:first-child,
        header, nav,
        [class*="justify-center"] > a:first-child,
        .min-h-screen > a:first-child,
        .min-h-screen > div:first-child > a {
            display: none !important;
        }
        
        .login-container {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            background: transparent;
        }
        
        .login-card {
            width: 100%;
            max-width: 450px;
            background: rgba(30, 55, 90, 0.4);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 24px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            padding: 2.5rem 2rem;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
        }
        
        .logo-container {
            display: flex;
            justify-content: center;
            margin-bottom: 1.5rem;
        }
        
        .logo-container img {
            max-width: 100px;
            height: auto;
            object-fit: contain;
        }
        
        .welcome-title {
            font-size: 2rem;
            font-weight: 700;
            color: #ffffff;
            margin-bottom: 0.5rem;
        }
        
        .welcome-subtitle {
            font-size: 1rem;
            color: rgba(255, 255, 255, 0.6);
            margin-bottom: 2rem;
        }
        
        .input-group {
            margin-bottom: 1rem;
        }
        
        .input-label {
            display: none;
        }
        
        .input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }
        
        .input-icon {
            position: absolute;
            left: 1rem;
            color: rgba(255, 255, 255, 0.4);
            width: 20px;
            height: 20px;
        }
        
        .styled-input {
            width: 100%;
            padding: 1rem 1rem 1rem 3rem;
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 12px;
            font-size: 1rem;
            color: #ffffff;
            background: rgba(255, 255, 255, 0.05);
            transition: all 0.3s ease;
        }
        
        .styled-input:focus {
            outline: none;
            border-color: rgba(255, 255, 255, 0.3);
            background: rgba(255, 255, 255, 0.08);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
        }
        
        .styled-input::placeholder {
            color: rgba(255, 255, 255, 0.4);
        }
        
        .options-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1.5rem;
            margin-top: 0.5rem;
        }
        
        .remember-me {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
        }
        
        .remember-me input[type="checkbox"] {
            width: 18px;
            height: 18px;
            border-radius: 4px;
            accent-color: #3b82f6;
        }
        
        .remember-me span {
            font-size: 0.875rem;
            color: rgba(255, 255, 255, 0.6);
        }
        
        .forgot-link {
            font-size: 0.875rem;
            color: #60a5fa;
            text-decoration: none;
            font-weight: 500;
            transition: color 0.2s ease;
        }
        
        .forgot-link:hover {
            color: #93c5fd;
            text-decoration: underline;
        }
        
        .login-button {
            width: 100%;
            padding: 1rem;
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
        }
        
        .login-button:hover {
            background: linear-gradient(135deg, #4f8ff7 0%, #3b7cf6 100%);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
        }
        
        .login-button:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }
        
        .login-button .spinner {
            display: none;
            width: 20px;
            height: 20px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        
        .login-button.loading .spinner {
            display: block;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        .bottom-links {
            text-align: center;
            margin-top: 1.5rem;
        }
        
        .bottom-links a {
            display: block;
            margin-bottom: 0.75rem;
            font-size: 0.9rem;
            color: rgba(255, 255, 255, 0.5);
            text-decoration: none;
            transition: color 0.2s ease;
        }
        
        .bottom-links a:hover {
            color: rgba(255, 255, 255, 0.8);
        }
        
        .signup-text span {
            color: #60a5fa;
            font-weight: 600;
        }
        
        .validation-errors {
            background: rgba(239, 68, 68, 0.15);
            border: 1px solid rgba(239, 68, 68, 0.3);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1.5rem;
        }
        
        .validation-errors ul {
            margin: 0;
            padding-left: 1.25rem;
            color: #fca5a5;
            font-size: 0.875rem;
        }
        
        .status-message {
            background: rgba(34, 197, 94, 0.15);
            border: 1px solid rgba(34, 197, 94, 0.3);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1.5rem;
            color: #86efac;
            font-size: 0.875rem;
            text-align: center;
        }

        .home-link {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
        }
        
        .bottom-note {
            text-align: center;
            margin-top: 1.25rem;
            font-size: 0.85rem;
            color: rgba(255, 255, 255, 0.4);
        }
    </style>

    <div class="login-container">
        <div class="login-card">
            <!-- Welcome Text -->
            <h1 class="welcome-title">Welcome Back</h1>
            <p class="welcome-subtitle">Sign in to continue to {{ global_setting()->name ?? 'your account' }}</p>

            <!-- Validation Errors -->
            <x-validation-errors class="validation-errors"/>

            <!-- Status Message -->
            @session('status')
            <div class="status-message">
                {{ $value }}
            </div>
            @endsession

            <!-- Login Form -->
            <form method="POST" action="{{ route('login') }}" id="loginForm">
                @csrf

                <!-- Email Field -->
                <div class="input-group">
                    <div class="input-wrapper">
                        <svg class="input-icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
                        </svg>
                        <input 
                            id="email" 
                            class="styled-input" 
                            type="email" 
                            name="email" 
                            value="{{ old('email') }}" 
                            placeholder="{{ __('app.email') }}"
                            required 
                            autofocus 
                            autocomplete="username"
                        />
                    </div>
                </div>

                <!-- Password Field -->
                <div class="input-group">
                    <div class="input-wrapper">
                        <svg class="input-icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
                        </svg>
                        <input 
                            id="password" 
                            class="styled-input" 
                            type="password" 
                            name="password" 
                            placeholder="{{ __('app.password') }}"
                            required 
                            autocomplete="current-password"
                        />
                    </div>
                </div>

                <!-- Remember Me & Forgot Password -->
                <div class="options-row">
                    <label for="remember_me" class="remember-me">
                        <input type="checkbox" id="remember_me" name="remember">
                        <span>{{ __('app.rememberMe') }}</span>
                    </label>
                    <a href="{{ route('password.request') }}" class="forgot-link">
                        {{ __('app.forgotPassword') }}
                    </a>
                </div>

                <!-- Login Button -->
                <button type="submit" class="login-button" id="loginBtn">
                    <span class="spinner"></span>
                    <span class="btn-text">{{ __('app.login') }}</span>
                </button>

                <!-- Bottom Links -->
                <div class="bottom-links">
                    @if(!module_enabled('Subdomain'))
                    <a href="{{ route('restaurant_signup') }}" class="signup-text">
                        @lang('auth.areYouNew', ['appName' => global_setting()->name]) <span>@lang('auth.createAccount')</span>
                    </a>
                    @endif

                    @if(!module_enabled('Subdomain') && !global_setting()->disable_landing_site)
                    <a href="{{ route('home') }}" class="home-link">
                        <svg width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18" />
                        </svg>
                        @lang('auth.goHome')
                    </a>
                    @endif
                </div>
            </form>
        </div>
    </div>

    <script>
        document.getElementById('loginForm').addEventListener('submit', function(e) {
            const emailField = document.getElementById('email');
            const passwordField = document.getElementById('password');
            const button = document.getElementById('loginBtn');

            if (emailField.checkValidity() && passwordField.checkValidity() && emailField.value && passwordField.value) {
                button.classList.add('loading');
                button.disabled = true;
                button.querySelector('.btn-text').textContent = '@lang("app.loading")';
            }
        });
    </script>

</x-auth-layout>