<!DOCTYPE html>
<html lang="tr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Giriş Yap - LexaScraper</title>
    <link rel="stylesheet" href="{{ asset('css/panel.css') }}">
    <script type="module" src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
    <script nomodule src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>
    <!-- Prevent Theme Flash -->
    <script>
        const savedTheme = localStorage.getItem('theme');
        const systemPrefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
        if (savedTheme === 'dark' || (!savedTheme && systemPrefersDark)) {
            document.documentElement.setAttribute('data-theme', 'dark');
        }
    </script>
</head>
<body>
    <style>
        body {
            display: block !important;
            height: auto !important;
            overflow: auto !important;
            background-color: var(--bg-main) !important;
        }
        [data-theme="dark"] {
            --bg-main: #0c110d;
            --bg-card: #121914;
            --border-color: #1a251d;
            --text-primary: #f5f8f6;
            --text-secondary: #a2b0a5;
        }
        [data-theme="dark"] .form-control {
            background-color: #18221a !important;
            border-color: #243527 !important;
            color: #f5f8f6 !important;
        }
        [data-theme="dark"] .form-control::placeholder {
            color: #6a786d !important;
        }
        [data-theme="dark"] .form-control:focus {
            border-color: var(--primary) !important;
            box-shadow: 0 0 10px rgba(99, 179, 114, 0.25) !important;
        }
        .auth-container {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            background-color: var(--bg-main);
            padding: 1.5rem;
        }
        .auth-card {
            width: 100%;
            max-width: 440px;
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            padding: 2.5rem;
            box-shadow: var(--shadow-lg);
        }
        .auth-header {
            text-align: center;
            margin-bottom: 2rem;
        }
        .auth-logo {
            width: 50px;
            height: 50px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            border-radius: var(--radius-md);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 0 20px rgba(0, 188, 255, 0.4);
            margin-bottom: 1rem;
        }
        .auth-title {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
        }
        .auth-subtitle {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }
        .error-alert {
            background-color: rgba(255, 23, 68, 0.08);
            border-left: 4px solid var(--danger);
            color: var(--danger);
            padding: 0.85rem 1rem;
            border-radius: var(--radius-sm);
            margin-bottom: 1.5rem;
            font-size: 0.85rem;
        }
        .remember-forgot {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            font-size: 0.85rem;
        }
        .remember-forgot label {
            display: flex;
            align-items: center;
            gap: 6px;
            color: var(--text-secondary);
            cursor: pointer;
        }
        .auth-footer {
            text-align: center;
            margin-top: 1.5rem;
            font-size: 0.85rem;
            color: var(--text-secondary);
        }
        .auth-footer a {
            color: var(--primary);
            text-decoration: none;
            font-weight: 600;
        }
        .auth-footer a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div class="auth-container">
        <div class="auth-card">
            <div class="auth-header">
                <div class="auth-logo" style="background: transparent; box-shadow: none; margin-bottom: 0.5rem;">
                    <img src="{{ asset('images/logo.png') }}" alt="LexaScraper Logo" style="height: 60px; border-radius: 12px;">
                </div>
                <h1 class="auth-title">Giriş Yap</h1>
                <p class="auth-subtitle">Hesabınıza giriş yaparak panelinizi yönetin</p>
            </div>

            @if($errors->any())
                <div class="error-alert">
                    @foreach($errors->all() as $error)
                        <p>{{ $error }}</p>
                    @endforeach
                </div>
            @endif

            <form action="{{ route('login') }}" method="POST">
                @csrf
                <div class="form-group">
                    <label for="email">E-POSTA ADRESİ</label>
                    <input type="email" name="email" id="email" class="form-control" placeholder="adiniz@example.com" value="{{ old('email') }}" required autofocus>
                </div>

                <div class="form-group">
                    <label for="password">ŞİFRE</label>
                    <input type="password" name="password" id="password" class="form-control" placeholder="••••••••" required>
                </div>

                <div class="remember-forgot">
                    <label>
                        <input type="checkbox" name="remember" style="accent-color: var(--primary);">
                        Beni Hatırla
                    </label>
                </div>

                <button type="submit" class="btn btn-primary" style="width: 100%; height: 42px;">
                    <ion-icon name="log-in-outline" style="font-size: 18px; vertical-align: middle; margin-right: 4px;"></ion-icon>
                    Giriş Yap
                </button>
                <a href="{{ route('login.demo') }}" class="btn btn-secondary" style="width: 100%; height: 42px; margin-top: 0.75rem; border-color: var(--primary); color: var(--primary);">
                    <ion-icon name="flash-outline" style="font-size: 18px; vertical-align: middle; margin-right: 4px;"></ion-icon>
                    Tek Tıkla Giriş (Demo)
                </a>
            </form>

            <div class="auth-footer">
                <p>Hesabınız yok mu? <a href="{{ route('register') }}">Kayıt Olun</a></p>
            </div>
        </div>
    </div>
</body>
</html>
