// app/admin/login/page.tsx
// Admin login. Email + password against the ADMIN_ALLOWLIST (email allowlist +
// per-admin scrypt hash). On success the loginAction issues an HMAC-signed
// session cookie and redirects to /admin. Accessible, no em-dashes, no emojis.
//
// This page is intentionally OUTSIDE the requireRole gate in app/admin/layout
// would normally apply, but the admin layout redirects unauthenticated users
// here; to avoid a redirect loop the login route renders its own minimal shell.

import * as React from "react";
import { LoginForm } from "@/components/admin/LoginForm";

export const dynamic = "force-dynamic";

export const metadata = {
  title: "Acceso administración | Rifa Teletón",
  robots: { index: false, follow: false },
};

export default function AdminLoginPage() {
  return (
    <main className="flex min-h-screen items-center justify-center bg-canvas px-5 py-10">
      <section
        aria-labelledby="login-title"
        className="w-full max-w-[420px] rounded-xl border border-hairline bg-canvas p-xxl shadow-drop"
      >
        <h1
          id="login-title"
          className="font-impact text-heading-lg font-bold text-primary"
        >
          Administración de la Rifa
        </h1>
        <p className="mt-2 font-body text-body-md text-muted">
          Acceso restringido. Ingresa con tu cuenta autorizada.
        </p>
        <LoginForm />
      </section>
    </main>
  );
}
