<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login - CRM Pro</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">

    <script>
        tailwind.config = {
            darkMode: 'class',
            theme: {
                extend: {
                    fontFamily: {
                        sans: ['Inter', 'sans-serif'],
                    },
                    colors: {
                        gold: {
                            50: '#fefce8',
                            100: '#fef9c3',
                            200: '#fef08a',
                            300: '#fde047',
                            400: '#facc15',
                            500: '#eab308',
                            600: '#ca8a04',
                            700: '#a16207',
                            800: '#854d0e',
                            900: '#713f12',
                        },
                        dark: {
                            primary: '#0f172a',
                            secondary: '#1e293b',
                            accent: '#facc15',
                            text: '#f8fafc'
                        }
                    },
                    animation: {
                        'fade-in': 'fadeIn 0.5s ease-in-out',
                        'slide-in': 'slideIn 0.3s ease-out',
                        'pulse-slow': 'pulse 3s infinite',
                        'shimmer': 'shimmer 2s infinite linear',
                    },
                    keyframes: {
                        fadeIn: {
                            '0%': { opacity: '0' },
                            '100%': { opacity: '1' },
                        },
                        slideIn: {
                            '0%': { transform: 'translateX(-100%)' },
                            '100%': { transform: 'translateX(0)' },
                        },
                        shimmer: {
                            '0%': { transform: 'translateX(-100%)' },
                            '100%': { transform: 'translateX(100%)' },
                        }
                    }
                }
            }
        }
    </script>
    <style>
        .glass {
            background: rgba(255, 255, 255, 0.7);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .dark .glass {
            background: rgba(30, 41, 59, 0.7);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .gradient-bg {
            background: linear-gradient(135deg, #fefce8 0%, #ffffff 100%);
        }

        .dark .gradient-bg {
            background: linear-gradient(135deg, #0f172a 0%, #1a202c 100%);
        }

        .logo-icon {
            background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
            box-shadow: 0 4px 15px rgba(250, 204, 21, 0.3);
        }

        .theme-toggle {
            position: relative;
            display: inline-block;
            width: 52px;
            height: 28px;
        }

        .theme-toggle input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .theme-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #cbd5e1;
            transition: .4s;
            border-radius: 34px;
        }

        .theme-slider:before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .theme-slider:before::after {
            content: "☀️";
            font-size: 10px;
        }

        input:checked+.theme-slider {
            background-color: #facc15;
        }

        input:checked+.theme-slider:before {
            transform: translateX(24px);
            background-color: #1e293b;
        }

        input:checked+.theme-slider:before::after {
            content: "🌙";
        }

        .decorative-element {
            position: absolute;
            z-index: -1;
            opacity: 0.1;
        }

        .form-input {
            transition: all 0.3s ease;
            border-radius: 12px;
        }

        .form-input:focus {
            box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.2);
            border-color: #facc15;
        }

        .btn-primary {
            background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
            transition: all 0.3s ease;
            border-radius: 12px;
            box-shadow: 0 4px 10px rgba(250, 204, 21, 0.3);
            position: relative;
            overflow: hidden;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(250, 204, 21, 0.4);
        }

        .btn-primary:active {
            transform: translateY(0);
        }

        .btn-primary::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transform: translateX(-100%);
        }

        .btn-primary:hover::after {
            animation: shimmer 1.5s infinite;
        }

        .animate-float {
            animation: float 6s ease-in-out infinite;
        }

        .gold-text {
            background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        @keyframes float {
            0% { transform: translateY(0px); }
            50% { transform: translateY(-10px); }
            100% { transform: translateY(0px); }
        }

        .gold-border {
            border-color: #facc15;
        }

        .gold-icon {
            color: #facc15;
        }

        .header-gold {
            background: linear-gradient(135deg, rgba(250, 204, 21, 0.1) 0%, rgba(234, 179, 8, 0.05) 100%);
            border: 1px solid rgba(250, 204, 21, 0.2);
        }

        .dark .header-gold {
            background: linear-gradient(135deg, rgba(250, 204, 21, 0.15) 0%, rgba(234, 179, 8, 0.1) 100%);
            border: 1px solid rgba(250, 204, 21, 0.3);
        }
    </style>
</head>

<body class="bg-gray-50 dark:bg-dark-primary transition-colors duration-300 min-h-screen flex items-center justify-center gradient-bg">
    <!-- Decorative Elements -->
    <div class="decorative-element top-10 left-10 w-72 h-72 rounded-full bg-gold-500 animate-float"></div>
    <div class="decorative-element bottom-10 right-10 w-96 h-96 rounded-full bg-gold-600 animate-float" style="animation-delay: 2s;"></div>
    <div class="decorative-element top-1/2 left-1/3 w-64 h-64 rounded-full bg-gold-400 animate-float" style="animation-delay: 4s;"></div>

    <!-- Login Container -->
    <div class="w-full max-w-md mx-4">
        <!-- Header -->
        <div class="flex flex-col items-center mb-8 animate-fade-in">
            <div class="flex items-center justify-center mb-4">
                
            </div>
            <div class="header-gold rounded-xl p-4 text-center w-full">
                <h2 class="text-xl font-semibold text-gray-800 dark:text-white mb-1">Welcome Back</h2>
                <p class="text-gray-600 dark:text-gray-300">Sign in to access your dashboard</p>
            </div> 
        </div>

        <!-- Login Card -->
        <div class="glass rounded-2xl shadow-xl p-8 animate-fade-in border border-gold-100 dark:border-gold-900">
            <!-- Login Form -->
            <form method="POST" action="{{ route('login') }}">
                @csrf

                <!-- Email Input -->
                <div class="mb-6">
                    <label for="email" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                        <i class="fas fa-envelope mr-2 gold-icon"></i>Email Address
                    </label>
                    <div class="relative">
                        <input id="email" type="email" name="email" value="{{ old('email') }}" required
                            autocomplete="email" autofocus
                            class="w-full px-4 py-3 form-input border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-800 dark:text-white focus:outline-none focus:ring-2 focus:ring-gold-500 @error('email') border-red-500 @enderror"
                            placeholder="you@example.com">
                        @error('email')
                            <div class="absolute right-3 top-3 text-red-500">
                                <i class="fas fa-exclamation-circle"></i>
                            </div>
                        @enderror
                    </div>
                    @error('email')
                        <p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
                    @enderror
                </div>

                <!-- Password Input -->
                <div class="mb-6">
                    <label for="password" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                        <i class="fas fa-lock mr-2 gold-icon"></i>Password
                    </label>
                    <div class="relative">
                        <input id="password" type="password" name="password" required autocomplete="current-password"
                            class="w-full px-4 py-3 form-input border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-800 dark:text-white focus:outline-none focus:ring-2 focus:ring-gold-500 @error('password') border-red-500 @enderror"
                            placeholder="••••••••">
                        @error('password')
                            <div class="absolute right-3 top-3 text-red-500">
                                <i class="fas fa-exclamation-circle"></i>
                            </div>
                        @enderror
                    </div>
                    @error('password')
                        <p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
                    @enderror
                </div>

                <!-- Remember Me & Forgot Password -->
                <div class="flex items-center justify-between mb-6">
                    <div class="flex items-center">
                        <input id="remember" name="remember" type="checkbox"
                            class="h-4 w-4 rounded border-gray-300 text-gold-500 focus:ring-gold-500 dark:border-gray-600 dark:bg-gray-800"
                            {{ old('remember') ? 'checked' : '' }}>
                        <label for="remember" class="ml-2 block text-sm text-gray-700 dark:text-gray-300">
                            Remember me
                        </label>
                    </div>

                    @if (Route::has('password.request'))
                        <a href="{{ route('password.request') }}"
                            class="text-sm font-medium text-gold-600 hover:text-gold-700 transition-colors dark:text-gold-400">
                            Forgot password?
                        </a>
                    @endif
                </div>

                <!-- Submit Button -->
                <button type="submit"
                    class="w-full btn-primary text-gray-800 font-semibold py-3 px-4 rounded-xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gold-500">
                    <i class="fas fa-sign-in-alt mr-2"></i>Sign In
                </button>
            </form>

 

 

            <!-- Register Link -->
            @if (Route::has('register'))
                <div class="mt-8 text-center">
                    <p class="text-sm text-gray-600 dark:text-gray-400">
                        Don't have an account?
                        <a href="{{ route('register') }}"
                            class="font-medium text-gold-600 hover:text-gold-700 transition-colors dark:text-gold-400">
                            Sign up
                        </a>
                    </p>
                </div>
            @endif
        </div>

        <!-- Footer -->
        <div class="text-center mt-8">
            <p class="text-xs text-gray-500 dark:text-gray-400">
                &copy; {{ date('Y') }} <span class="gold-text font-medium">CRM Pro</span>. All rights reserved.
            </p>
        </div>
    </div>

    <script>
        // Theme toggle functionality
        const themeToggle = document.getElementById('themeToggle');
        const htmlElement = document.documentElement;

        // Check for saved theme preference or respect OS preference
        if (localStorage.theme === 'dark' || (!localStorage.theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
            htmlElement.classList.add('dark');
            themeToggle.checked = true;
        } else {
            htmlElement.classList.remove('dark');
            themeToggle.checked = false;
        }

        // Toggle theme on checkbox change
        themeToggle.addEventListener('change', function() {
            if (this.checked) {
                htmlElement.classList.add('dark');
                localStorage.theme = 'dark';
            } else {
                htmlElement.classList.remove('dark');
                localStorage.theme = 'light';
            }
        });

        // Form input animations
        document.querySelectorAll('.form-input').forEach(input => {
            input.addEventListener('focus', function() {
                this.parentElement.classList.add('ring-2', 'ring-gold-500', 'rounded-xl');
            });

            input.addEventListener('blur', function() {
                this.parentElement.classList.remove('ring-2', 'ring-gold-500', 'rounded-xl');
            });
        });

        // Add floating animation to decorative elements
        document.addEventListener('DOMContentLoaded', function() {
            const elements = document.querySelectorAll('.decorative-element');
            elements.forEach((el, index) => {
                el.style.animationDelay = `${index * 2}s`;
            });
        });

        // Add shimmer effect to gold text elements
        const goldTextElements = document.querySelectorAll('.gold-text');
        goldTextElements.forEach(el => {
            el.style.backgroundSize = '200% 100%';
            el.style.animation = 'shimmer 3s infinite linear';
        });
    </script>
</body>

</html>