import type { Metadata } from "next";
import Link from "next/link";
import { SitePage } from "@/app/(site)/_components/SitePage";
import { LoginError, LoginForm, LoginSubmit } from "@/app/(site)/_components/LoginForm";

export const metadata: Metadata = {
  title: "Login (Classic) — Unionists Group",
};

export default function Page() {
  return (
    <SitePage className="login-alt-page">
      <header
        className="site-header flex items-center justify-between px-7 py-[14px] border-b shrink-0 z-10"
        style={{ borderColor: "rgba(255,255,255,0.08)" }}
      >
        <Link
          href="/"
          className="text-white font-black text-[19px] tracking-[0.01em] hover:opacity-90 transition-opacity"
        >
          {" "}
          Unionists{" "}
        </Link>{" "}
        <Link
          href="/signup"
          className="text-white text-[12px] font-bold tracking-[0.08em] uppercase px-[18px] py-[7px] rounded transition-all hover:bg-white/10"
          style={{ border: "1.5px solid #00FFC7" }}
        >
          {" "}
          SIGNUP{" "}
        </Link>
      </header>
      <div className="auth-page-layout flex flex-1 flex-col lg:flex-row">
        <div className="auth-globe-panel relative overflow-hidden shrink-0">
          <img
            src="/assets/images/globe-bg.png"
            alt=""
            className="absolute inset-0 w-full h-full object-cover object-center login-globe-image"
            width="885"
            height="1024"
            fetchPriority="high"
            decoding="async"
          />
        </div>
        <div className="auth-form-panel flex-1 flex flex-col items-center justify-center px-8 lg:px-16 bg-geometric-navy">
          <div className="w-full max-w-[380px]">
            <h1 className="text-white text-[22px] font-bold text-center mb-[10px] leading-snug">
              Login In To Your Account
            </h1>
            <p className="text-center text-[13px] mb-8 leading-[1.55] text-white">
              Access your global trade intelligence network securely.
            </p>
            <LoginForm id="login-form" className="flex flex-col gap-[14px]">
              <input
                type="email"
                name="email"
                placeholder="Enter Email"
                autoComplete="email"
                required
                className="w-full px-4 py-[13px] rounded text-white text-sm outline-none border-none transition-shadow focus:ring-2 focus:ring-blue-500/40"
                style={{ background: "#0d2a58" }}
              />{" "}
              <div className="relative">
                <input
                  type="password"
                  id="login-pwd"
                  name="password"
                  placeholder="Enter Password"
                  autoComplete="current-password"
                  required
                  className="w-full px-4 py-[13px] pr-11 rounded text-white text-sm outline-none border-none transition-shadow focus:ring-2 focus:ring-blue-500/40"
                  style={{ background: "#0d2a58" }}
                />{" "}
                <button
                  type="button"
                  data-legacy-onclick="togglePwd('login-pwd', this)"
                  aria-label="Toggle password"
                  className="absolute right-[13px] top-1/2 -translate-y-1/2 transition-colors"
                  style={{ color: "rgba(255,255,255,0.35)" }}
                >
                  {" "}
                  <svg
                    className="eye-open w-[18px] h-[18px]"
                    fill="none"
                    viewBox="0 0 24 24"
                    stroke="currentColor"
                    strokeWidth="1.7"
                  >
                    <path strokeLinecap="round" strokeLinejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
                    <path
                      strokeLinecap="round"
                      strokeLinejoin="round"
                      d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
                    ></path>
                  </svg>{" "}
                  <svg
                    className="eye-closed hidden w-[18px] h-[18px]"
                    fill="none"
                    viewBox="0 0 24 24"
                    stroke="currentColor"
                    strokeWidth="1.7"
                  >
                    <path
                      strokeLinecap="round"
                      strokeLinejoin="round"
                      d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88L6.59 6.59m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"
                    ></path>
                  </svg>{" "}
                </button>
              </div>
              <div className="flex justify-end -mt-1">
                <Link href="/forgot-password" className="text-[13px] font-medium hover:underline" style={{ color: "#00FFC7" }}>
                  Recover Password ?
                </Link>
              </div>
<LoginError className="text-[13px] leading-[1.5] text-red-400 -mt-1" />
              <LoginSubmit
                type="submit"
                className="w-full py-[13px] mt-1 text-white font-bold text-[13px] tracking-[0.1em] uppercase rounded transition-all duration-150 active:scale-[0.99]"
                style={{ background: "#1f63d6" }}
              >
                {" "}
                LOGIN{" "}
              </LoginSubmit>{" "}
              <p className="text-[12px] text-center mt-2 text-white">
                Don&apos;t have an account?{" "}
                <Link href="/signup" className="hover:underline font-medium" style={{ color: "#00FFC7" }}>
                  Create one
                </Link>
              </p>
            </LoginForm>
            <p className="text-center mt-6">
              <Link
                href="/login"
                className="login-screen-switch text-[11px] font-medium tracking-[0.04em] hover:underline text-white"
              >
                {" "}
                Login screen 2 →{" "}
              </Link>
            </p>
          </div>
        </div>
      </div>
    </SitePage>
  );
}
