import{i as e,n as t,r as n,t as r}from"./app-Cl8XxplU.js";import{t as i}from"./GuestLayout-CLB6iWnB.js";var a=r();function o({message:e}){return e?(0,a.jsx)(`p`,{className:`mt-1 text-sm text-red-600`,children:e}):null}function s({status:r}){let{data:s,setData:c,post:l,processing:u,errors:d,reset:f}=e({email:``,password:``,remember:!1});return(0,a.jsxs)(i,{children:[(0,a.jsx)(t,{title:`تسجيل الدخول`}),(0,a.jsx)(`h2`,{className:`text-xl font-bold text-gray-900 mb-6 text-center`,children:`تسجيل الدخول`}),r&&(0,a.jsx)(`div`,{className:`mb-4 rounded-lg bg-green-50 border border-green-200 px-4 py-3 text-sm text-green-700`,children:r}),(0,a.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),l(route(`login`),{onFinish:()=>f(`password`)})},className:`space-y-4`,children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`label`,{htmlFor:`email`,className:`block text-sm font-medium text-gray-700 mb-1`,children:`البريد الإلكتروني`}),(0,a.jsx)(`input`,{id:`email`,type:`email`,value:s.email,onChange:e=>c(`email`,e.target.value),className:`w-full rounded-lg border border-gray-300 px-4 py-2.5 text-sm focus:border-amber-500 focus:outline-none focus:ring-1 focus:ring-amber-500`,autoFocus:!0,autoComplete:`email`,dir:`ltr`}),(0,a.jsx)(o,{message:d.email})]}),(0,a.jsxs)(`div`,{children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,a.jsx)(`label`,{htmlFor:`password`,className:`block text-sm font-medium text-gray-700`,children:`كلمة المرور`}),route().has(`password.request`)&&(0,a.jsx)(n,{href:route(`password.request`),className:`text-xs text-amber-700 hover:underline`,children:`نسيت كلمة المرور؟`})]}),(0,a.jsx)(`input`,{id:`password`,type:`password`,value:s.password,onChange:e=>c(`password`,e.target.value),className:`w-full rounded-lg border border-gray-300 px-4 py-2.5 text-sm focus:border-amber-500 focus:outline-none focus:ring-1 focus:ring-amber-500`,autoComplete:`current-password`}),(0,a.jsx)(o,{message:d.password})]}),(0,a.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,a.jsx)(`input`,{id:`remember`,type:`checkbox`,checked:s.remember,onChange:e=>c(`remember`,e.target.checked),className:`h-4 w-4 rounded border-gray-300 text-amber-700 focus:ring-amber-500`}),(0,a.jsx)(`label`,{htmlFor:`remember`,className:`text-sm text-gray-600`,children:`تذكرني`})]}),(0,a.jsx)(`button`,{type:`submit`,disabled:u,className:`w-full rounded-lg bg-amber-700 text-white py-3 text-sm font-semibold hover:bg-amber-800 transition-colors disabled:opacity-60 disabled:cursor-not-allowed`,children:u?`جارٍ تسجيل الدخول...`:`تسجيل الدخول`}),(0,a.jsxs)(`p`,{className:`text-center text-sm text-gray-500`,children:[`ليس لديك حساب؟`,` `,(0,a.jsx)(n,{href:route(`register`),className:`text-amber-700 font-medium hover:underline`,children:`إنشاء حساب جديد`})]})]})]})}export{s as default};