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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>SSO Admin Login — Synergo</title>
    <meta name="description" content="Sign in to Synergo SSO Admin Panel">
    <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@400;500;600;700&display=swap" rel="stylesheet">
    <style>
        *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            min-height: 100vh; display: flex; align-items: center; justify-content: center;
            background: #f0f4f8; overflow: hidden; position: relative;
        }
        body::before {
            content: ''; position: fixed; top: -80px; right: -80px;
            width: 280px; height: 280px; background: rgba(59, 130, 246, 0.06);
            border-radius: 50%; z-index: 0;
        }
        body::after {
            content: ''; position: fixed; bottom: -60px; left: -60px;
            width: 220px; height: 220px; background: rgba(59, 130, 246, 0.05);
            border-radius: 50%; z-index: 0;
        }
        .blob-accent { position: fixed; width: 160px; height: 160px; background: rgba(16, 185, 129, 0.05); border-radius: 50%; z-index: 0; }
        .blob-accent-1 { top: 30%; left: -40px; }
        .blob-accent-2 { bottom: 20%; right: 10%; }
        .blob-accent-3 { top: 10%; left: 40%; width: 100px; height: 100px; background: rgba(251, 191, 36, 0.06); }
        .dots { position: fixed; z-index: 0; opacity: 0.4; }
        .dots-1 { top: 15%; right: 8%; }
        .dots-2 { bottom: 12%; left: 5%; }
        .login-card {
            position: relative; z-index: 1; background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
            border-radius: 24px; padding: 48px 40px; width: 100%; max-width: 400px;
            box-shadow: 0 4px 6px -1px rgba(0,0,0,0.04), 0 10px 40px -4px rgba(0,0,0,0.08);
            border: 1px solid rgba(255,255,255,0.6); animation: cardSlideUp 0.6s ease-out;
        }
        @keyframes cardSlideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
        .illustration-wrapper { text-align: center; margin-bottom: 24px; }
        .illustration-wrapper img { width: 200px; height: auto; animation: floatIllustration 4s ease-in-out infinite; }
        @keyframes floatIllustration { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
        .admin-badge {
            display: inline-flex; align-items: center; gap: 6px;
            background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #1e40af;
            padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
            margin: 0 auto 16px; text-transform: uppercase; letter-spacing: 0.5px;
        }
        .admin-badge svg { width: 14px; height: 14px; }
        .login-card h1 { font-size: 26px; font-weight: 700; color: #111827; text-align: center; margin-bottom: 8px; }
        .login-card .subtitle { font-size: 14px; color: #6b7280; text-align: center; margin-bottom: 32px; line-height: 1.5; }
        .alert-error {
            background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px;
            padding: 12px 16px; margin-bottom: 20px; animation: shake 0.4s ease-in-out;
        }
        @keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
        .alert-error ul { list-style: none; padding: 0; margin: 0; }
        .alert-error li { font-size: 13px; color: #dc2626; display: flex; align-items: center; gap: 6px; }
        .alert-error li::before { content: ''; width: 6px; height: 6px; background: #dc2626; border-radius: 50%; flex-shrink: 0; }
        .input-group { position: relative; margin-bottom: 16px; }
        .input-group .input-icon {
            position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
            color: #9ca3af; pointer-events: none; transition: color 0.2s;
        }
        .input-group input {
            width: 100%; padding: 14px 16px 14px 48px; border: 1.5px solid #e5e7eb;
            border-radius: 12px; font-size: 15px; font-family: 'Inter', sans-serif;
            color: #374151; background: #fff; transition: all 0.25s ease; outline: none;
        }
        .input-group input::placeholder { color: #9ca3af; }
        .input-group input:focus { border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }
        .input-group input:focus ~ .input-icon { color: #3b82f6; }
        .password-toggle {
            position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
            background: none; border: none; cursor: pointer; color: #9ca3af; padding: 4px; transition: color 0.2s;
        }
        .password-toggle:hover { color: #6b7280; }
        .form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; margin-top: 4px; }
        .remember-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #6b7280; cursor: pointer; }
        .remember-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: #3b82f6; cursor: pointer; }
        .btn-login {
            width: 100%; padding: 14px 24px; background: #2563eb; color: #fff;
            border: none; border-radius: 12px; font-size: 16px; font-weight: 600;
            font-family: 'Inter', sans-serif; cursor: pointer; transition: all 0.3s ease;
        }
        .btn-login:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.4); }
        .btn-login:active { transform: translateY(0); }
        .card-footer { text-align: center; margin-top: 28px; font-size: 13px; color: #9ca3af; }
        @media (max-width: 480px) {
            .login-card { margin: 16px; padding: 36px 24px; border-radius: 20px; }
            .illustration-wrapper img { width: 160px; }
        }
    </style>
</head>

<body>
    <div class="blob-accent blob-accent-1"></div>
    <div class="blob-accent blob-accent-2"></div>
    <div class="blob-accent blob-accent-3"></div>

    <svg class="dots dots-1" width="48" height="48" viewBox="0 0 48 48" fill="none">
        <circle cx="4" cy="4" r="3" fill="#d1d5db"/><circle cx="16" cy="4" r="3" fill="#d1d5db"/>
        <circle cx="28" cy="4" r="3" fill="#d1d5db"/><circle cx="40" cy="4" r="3" fill="#d1d5db"/>
        <circle cx="4" cy="16" r="3" fill="#d1d5db"/><circle cx="16" cy="16" r="3" fill="#d1d5db"/>
        <circle cx="28" cy="16" r="3" fill="#d1d5db"/><circle cx="40" cy="16" r="3" fill="#d1d5db"/>
        <circle cx="4" cy="28" r="3" fill="#d1d5db"/><circle cx="16" cy="28" r="3" fill="#d1d5db"/>
        <circle cx="28" cy="28" r="3" fill="#d1d5db"/><circle cx="40" cy="28" r="3" fill="#d1d5db"/>
    </svg>

    <div class="login-card">
        <div class="illustration-wrapper">
            <img src="{{ asset('images/login-illustration.png') }}" alt="Admin Sign In">
        </div>

        <div style="text-align: center;">
            <span class="admin-badge">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
                </svg>
                Admin Panel
            </span>
        </div>

        <h1>Sign In</h1>
        <p class="subtitle">Enter admin credentials to continue</p>

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

        <form method="POST" action="{{ route('admin.login.submit') }}">
            @csrf
            @if(isset($redirect) || request('redirect'))
                <input type="hidden" name="redirect" value="{{ $redirect ?? request('redirect') }}">
            @endif

            <div class="input-group">
                <input type="email" id="email" name="email" placeholder="Email address" required
                    value="{{ old('email') }}" autocomplete="email">
                <svg class="input-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
                    <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>
                </svg>
            </div>

            <div class="input-group">
                <input type="password" id="password" name="password" placeholder="Password" required
                    autocomplete="current-password">
                <svg class="input-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
                    <rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>
                </svg>
                <button type="button" class="password-toggle" onclick="togglePassword()">
                    <svg id="eyeIcon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>
                    </svg>
                </button>
            </div>

            <div class="form-options">
                <label class="remember-label">
                    <input type="checkbox" id="remember" name="remember">
                    Remember me
                </label>
            </div>

            <button type="submit" class="btn-login">Login</button>
        </form>

        <div class="card-footer">Synergy Partner Prima</div>
    </div>

    <script>
        function togglePassword() {
            const p = document.getElementById('password');
            const i = document.getElementById('eyeIcon');
            if (p.type === 'password') {
                p.type = 'text';
                i.innerHTML = '<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/>';
            } else {
                p.type = 'password';
                i.innerHTML = '<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>';
            }
        }
    </script>
</body>

</html>