<!DOCTYPE html>
<html lang="tr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>Acente Giriş - Acente Pro Max</title>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
        }

        body::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
            opacity: 0.3;
        }

        .login-container {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            border-radius: 24px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
            padding: 50px;
            width: 100%;
            max-width: 480px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            position: relative;
            z-index: 1;
        }

        .login-header {
            text-align: center;
            margin-bottom: 45px;
        }

        .logo-section {
            margin-bottom: 20px;
        }

        .logo-icon {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, #2563eb, #3b82f6);
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 36px;
            margin: 0 auto 15px;
            box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
        }

        .login-header h1 {
            color: #1e293b;
            font-size: 32px;
            font-weight: 800;
            margin-bottom: 8px;
            letter-spacing: -0.5px;
        }

        .login-header p {
            color: #64748b;
            font-size: 16px;
            font-weight: 500;
        }

        .form-group {
            margin-bottom: 28px;
            position: relative;
        }

        .form-group label {
            display: block;
            color: #374151;
            font-weight: 600;
            margin-bottom: 10px;
            font-size: 15px;
        }

        .input-wrapper {
            position: relative;
            transition: all 0.3s ease;
        }

        .form-control {
            width: 100%;
            padding: 18px 22px 18px 55px;
            border: 2px solid #e5e7eb;
            border-radius: 16px;
            font-size: 16px;
            transition: all 0.3s ease;
            background: rgba(255, 255, 255, 0.9);
            color: #374151;
        }

        .form-control:focus {
            outline: none;
            border-color: #3b82f6;
            background: white;
            box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
            transform: translateY(-1px);
        }

        .form-control::placeholder {
            color: #9ca3af;
        }

        .input-icon {
            position: absolute;
            left: 20px;
            top: 50%;
            transform: translateY(-50%);
            color: #9ca3af;
            font-size: 18px;
            transition: all 0.3s ease;
        }

        .form-control:focus + .input-icon {
            color: #3b82f6;
        }

        .btn-login {
            width: 100%;
            background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
            color: white;
            border: none;
            padding: 18px;
            border-radius: 16px;
            font-size: 17px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 15px;
            position: relative;
            overflow: hidden;
        }

        .btn-login::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s;
        }

        .btn-login:hover {
            transform: translateY(-2px);
            box-shadow: 0 15px 35px rgba(37, 99, 235, 0.4);
        }

        .btn-login:hover::before {
            left: 100%;
        }

        .btn-login:active {
            transform: translateY(-1px);
        }

        .alert {
            padding: 16px 20px;
            border-radius: 12px;
            margin-bottom: 25px;
            font-size: 15px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .alert-danger {
            background: rgba(239, 68, 68, 0.1);
            color: #dc2626;
            border: 1px solid rgba(239, 68, 68, 0.2);
        }

        .alert-success {
            background: rgba(16, 185, 129, 0.1);
            color: #059669;
            border: 1px solid rgba(16, 185, 129, 0.2);
        }

        .remember-forgot {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
        }

        .remember-me {
            display: flex;
            align-items: center;
            font-size: 15px;
            color: #64748b;
            font-weight: 500;
        }

        .remember-me input {
            margin-right: 10px;
            width: 18px;
            height: 18px;
        }

        .forgot-password {
            color: #3b82f6;
            text-decoration: none;
            font-size: 15px;
            font-weight: 600;
            transition: color 0.3s ease;
        }

        .forgot-password:hover {
            color: #2563eb;
        }

        .loading {
            display: none;
            width: 22px;
            height: 22px;
            border: 2px solid transparent;
            border-top: 2px solid #fff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-right: 10px;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }
            100% {
                transform: rotate(360deg);
            }
        }

        .btn-login.loading .loading {
            display: inline-block;
        }

        .btn-login.loading .btn-text {
            opacity: 0.7;
        }

        .footer-links {
            text-align: center;
            margin-top: 30px;
            padding-top: 25px;
            border-top: 1px solid #e5e7eb;
        }

        .footer-links a {
            color: #64748b;
            text-decoration: none;
            font-size: 14px;
            margin: 0 15px;
            transition: color 0.3s ease;
        }

        .footer-links a:hover {
            color: #3b82f6;
        }

        @media (max-width: 768px) {
            .login-container {
                margin: 20px;
                padding: 40px 30px;
                max-width: 400px;
            }

            .login-header h1 {
                font-size: 28px;
            }

            .logo-icon {
                width: 70px;
                height: 70px;
                font-size: 32px;
            }
        }

        @media (max-width: 480px) {
            .login-container {
                padding: 30px 25px;
            }

            .remember-forgot {
                flex-direction: column;
                gap: 15px;
                align-items: flex-start;
            }
        }
    </style>
</head>
<body>
<div class="login-container">
    <div class="login-header">
        <div class="logo-section">
            <div class="logo-icon">
                <i class="fas fa-building"></i>
            </div>
        </div>
        <h1>Acente Paneli</h1>
        <p>Acentenizi yönetin, işinizi büyütün</p>
    </div>

    @if (session('success'))
        <div class="alert alert-success">
            <i class="fas fa-check-circle"></i>
            <span>{{ session('success') }}</span>
        </div>
    @endif

    @if ($errors->any())
        <div class="alert alert-danger">
            <i class="fas fa-exclamation-triangle"></i>
            <span>
                @foreach ($errors->all() as $error)
                    {{ $error }}
                @endforeach
            </span>
        </div>
    @endif

    <form method="POST" action="{{ route('agency.login.post') }}" id="loginForm">
        @csrf

        <div class="form-group">
            <label for="email">E-posta Adresi</label>
            <div class="input-wrapper">
                <input type="email"
                       id="email"
                       name="email"
                       class="form-control"
                       value="{{ old('email') }}"
                       placeholder="acente@example.com"
                       required
                       autocomplete="email">
                <i class="fas fa-envelope input-icon"></i>
            </div>
        </div>

        <div class="form-group">
            <label for="password">Şifre</label>
            <div class="input-wrapper">
                <input type="password"
                       id="password"
                       name="password"
                       class="form-control"
                       placeholder="Şifrenizi girin"
                       required
                       autocomplete="current-password">
                <i class="fas fa-lock input-icon"></i>
            </div>
        </div>

        <div class="remember-forgot">
            <div class="remember-me">
                <input type="checkbox" id="remember" name="remember">
                <label for="remember">Beni hatırla</label>
            </div>
            <a href="#" class="forgot-password">Şifremi unuttum</a>
        </div>

        <button type="submit" class="btn-login">
            <span class="loading"></span>
            <span class="btn-text">Giriş Yap</span>
        </button>
    </form>

    <div class="footer-links">
        <a href="#">Yardım</a>
        <a href="#">İletişim</a>
        <a href="#">Gizlilik</a>
    </div>
</div>

<script>
    document.getElementById('loginForm').addEventListener('submit', function (e) {
        const btn = document.querySelector('.btn-login');
        btn.classList.add('loading');
        btn.disabled = true;

        setTimeout(() => {
            if (btn.classList.contains('loading')) {
                btn.classList.remove('loading');
                btn.disabled = false;
            }
        }, 10000);
    });

    // Input focus animations
    document.querySelectorAll('.form-control').forEach(input => {
        input.addEventListener('focus', function () {
            this.closest('.input-wrapper').style.transform = 'scale(1.02)';
        });

        input.addEventListener('blur', function () {
            this.closest('.input-wrapper').style.transform = 'scale(1)';
        });
    });

    // Auto-hide alerts after 5 seconds
    setTimeout(() => {
        const alerts = document.querySelectorAll('.alert');
        alerts.forEach(alert => {
            alert.style.transition = 'opacity 0.5s ease';
            alert.style.opacity = '0';
            setTimeout(() => alert.remove(), 500);
        });
    }, 5000);
</script>
</body>
</html>
