(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,7296,e=>{"use strict";var a=e.i(43476),t=e.i(71645),s=e.i(17927),i=e.i(18566),n=e.i(46932);function r(){let[e,r]=(0,t.useState)(""),[o,l]=(0,t.useState)(""),[c,d]=(0,t.useState)(""),[u,p]=(0,t.useState)(!1),m=(0,i.useRouter)(),b=async a=>{a.preventDefault(),p(!0),d("");try{if("admin@uniafic.edu.co"===e&&"admin2026"===o){console.log("Acceso administrativo provisional concedido."),localStorage.setItem("isProvisionalAdmin","true"),m.push("/gestion-corpadein");return}let{error:a}=await s.supabase.auth.signInWithPassword({email:e,password:o});if(a)throw a;let{data:t}=await s.supabase.from("profiles").select("role").eq("id",(await s.supabase.auth.getUser()).data.user?.id).single();t?.role==="estudiante"||t?.role==="candidato"?m.push("/estudiante"):m.push("/gestion-corpadein")}catch(e){e.message?.includes("Email not confirmed")?d("Email no confirmado. Por favor, ve a tu panel de Supabase > Authentication > Users y selecciona 'Confirm User' manualmente para este usuario."):d(e.message||"Error al iniciar sesión")}finally{p(!1)}};return(0,a.jsxs)("div",{className:"min-h-screen bg-navy flex items-center justify-center p-4",children:[(0,a.jsx)("div",{className:"absolute inset-0 opacity-10 bg-[url('/hero-bg.png')] bg-cover bg-center"}),(0,a.jsxs)(n.motion.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"w-full max-w-md bg-white p-12 shadow-2xl relative z-10 border-t-8 border-yellow",children:[(0,a.jsxs)("div",{className:"text-center mb-10",children:[(0,a.jsx)("h1",{className:"text-3xl font-serif font-bold text-navy mb-2 tracking-tight",children:"Panel Administrativo"}),(0,a.jsx)("p",{className:"text-sm font-bold text-navy/40 tracking-[0.2em] uppercase",children:"Control Institucional"})]}),(0,a.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-[10px] font-bold text-navy uppercase tracking-widest mb-2 px-1",children:"Email Institucional"}),(0,a.jsx)("input",{type:"email",required:!0,value:e,onChange:e=>r(e.target.value),className:"w-full px-4 py-4 bg-gray-50 border-2 border-transparent focus:border-navy focus:bg-white outline-none transition-all font-sans",placeholder:"admin@corpadein.com"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-[10px] font-bold text-navy uppercase tracking-widest mb-2 px-1",children:"Contraseña"}),(0,a.jsx)("input",{type:"password",required:!0,value:o,onChange:e=>l(e.target.value),className:"w-full px-4 py-4 bg-gray-50 border-2 border-transparent focus:border-navy focus:bg-white outline-none transition-all font-sans"})]}),c&&(0,a.jsx)("p",{className:"text-red-600 text-[11px] font-bold uppercase tracking-wider text-center bg-red-50 p-3",children:c}),(0,a.jsx)("button",{type:"submit",disabled:u,className:"w-full bg-navy text-white py-5 font-bold tracking-widest uppercase hover:bg-navy/90 transition-all shadow-[6px_6px_0px_#FFC72C] disabled:opacity-50",children:u?"AUTENTICANDO...":"INGRESAR AL PANEL"})]})]})]})}e.s(["default",()=>r])}]);