@page "/login"
@model Nalu.Web.Pages.LoginModel
@{
    ViewData["Title"] = "Entrar — NALU AI";
    ViewData["Description"] = "Entre com sua conta Google, Microsoft ou GitHub para acessar o painel e sua API key.";
    Layout = "_Layout";
}

<section class="min-h-[80vh] flex items-center justify-center bg-gradient-to-b from-slate-50 to-white py-16 px-4">
    <div class="w-full max-w-sm">
        <!-- Logo -->
        <div class="text-center mb-8">
            <a href="/" class="inline-flex items-center gap-1 font-bold text-2xl">
                <span class="text-gray-300">NA</span><span class="text-nalu-600">LU</span>
                <span class="text-gray-500 font-normal text-base ml-1">AI</span>
            </a>
            <p class="text-gray-500 mt-2 text-sm">Entre para acessar seu painel e API key</p>
        </div>

        <!-- Card -->
        <div class="bg-white rounded-2xl border border-gray-100 shadow-sm p-8">
            <h1 class="text-xl font-bold text-gray-900 mb-6 text-center">Entrar na sua conta</h1>

            <div class="space-y-3">
                <!-- Google -->
                <a href="/login?handler=Google&returnUrl=@Uri.EscapeDataString(Model.ReturnUrl ?? "/painel")"
                   class="flex items-center justify-center gap-3 w-full border border-gray-200 rounded-xl px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors">
                    <svg class="w-5 h-5" viewBox="0 0 24 24">
                        <path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/>
                        <path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/>
                        <path fill="#FBBC05" d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"/>
                        <path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"/>
                    </svg>
                    Continuar com Google
                </a>

                <!-- Microsoft -->
                <a href="/login?handler=Microsoft&returnUrl=@Uri.EscapeDataString(Model.ReturnUrl ?? "/painel")"
                   class="flex items-center justify-center gap-3 w-full border border-gray-200 rounded-xl px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors">
                    <svg class="w-5 h-5" viewBox="0 0 23 23">
                        <path fill="#f25022" d="M0 0h11v11H0z"/>
                        <path fill="#00a4ef" d="M12 0h11v11H12z"/>
                        <path fill="#7fba00" d="M0 12h11v11H0z"/>
                        <path fill="#ffb900" d="M12 12h11v11H12z"/>
                    </svg>
                    Continuar com Microsoft
                </a>

                <!-- GitHub -->
                <a href="/login?handler=GitHub&returnUrl=@Uri.EscapeDataString(Model.ReturnUrl ?? "/painel")"
                   class="flex items-center justify-center gap-3 w-full border border-gray-200 rounded-xl px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors">
                    <svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor">
                        <path d="M12 0C5.37 0 0 5.37 0 12c0 5.3 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 21.795 24 17.295 24 12c0-6.63-5.37-12-12-12"/>
                    </svg>
                    Continuar com GitHub
                </a>
            </div>

            <p class="text-center text-xs text-gray-400 mt-6">
                Ao entrar, você concorda com nossos
                <a href="/termos" class="underline hover:text-gray-600">Termos</a> e
                <a href="/privacidade" class="underline hover:text-gray-600">Privacidade</a>.
            </p>
        </div>

        <p class="text-center text-xs text-gray-400 mt-4">
            Novo por aqui? Sua conta é criada automaticamente no primeiro login.
            <br>Você ganha <strong class="text-gray-600">3.000 créditos grátis</strong>.
        </p>
    </div>
</section>
