1import{r as e,j as a,m as t,L as s,s as r}from"./index--xynKbZj.js";import{u as i}from"./use-in-view-DYW9W5Qa.js";import{E as o}from"./eye-off-C8VDfwyB.js";import{E as n}from"./eye-DgpKlYxe.js";import{A as l}from"./arrow-right-oQvNihKH.js";import"./createLucideIcon-BmbmbW8R.js";function d(){const[d,c]=e.useState(""),[u,m]=e.useState(""),[p,x]=e.useState(!1),[h,y]=e.useState(!1),[b,g]=e.useState(""),v=e.useRef(null),f=i(v,{once:!0});e.useEffect(()=>{document.title="MyFidelity - Connexion";let e=document.querySelector('meta[name="description"]');return e||(e=document.createElement("meta"),e.name="description",document.getElementsByTagName("head")[0].appendChild(e)),e.content="Connectez-vous à votre tableau de bord MyFidelity pour gérer votre programme de fidélité éco-responsable.",()=>{document.title="MyFidelity - La fidélité écoresponsable"}},[]);return a.jsxs("div",{className:"min-h-screen relative overflow-hidden",style:{background:"linear-gradient(135deg, #FED7AA 0%, #FDBA74 50%, #FB923C 100%)"},children:[a.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[a.jsx(t.div,{animate:{scale:[1,1.15,.95,1.1,1],opacity:[.7,.9,.6,.8,.7],rotate:[0,360],borderRadius:["50%","40%","60%","45%","50%"]},transition:{duration:25,repeat:1/0,ease:"easeInOut"},className:"absolute -top-20 -right-20 w-96 h-96 blur-3xl",style:{background:"linear-gradient(135deg, #F97316 0%, #EA580C 100%)"}}),a.jsx(t.div,{animate:{scale:[1.1,.9,1.2,1,1.1],opacity:[.6,.8,.5,.7,.6],rotate:[-360,0],x:[0,20,-15,10,0],y:[0,-10,15,-5,0]},transition:{duration:30,repeat:1/0,ease:"easeInOut"},className:"absolute -bottom-32 -left-32 w-80 h-80 rounded-full blur-2xl",style:{background:"linear-gradient(135deg, #FDBA74 0%, #F97316 100%)"}}),a.jsx(t.div,{animate:{scale:[1,1.08,.95,1.05,1],opacity:[.5,.7,.4,.6,.5],rotate:[0,180,360],borderRadius:["50%","35%","55%","40%","50%"]},transition:{duration:35,repeat:1/0,ease:"easeInOut"},className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-64 h-64 blur-xl",style:{background:"linear-gradient(135deg, #FED7AA 0%, #FDBA74 100%)"}}),[...Array(12)].map((e,s)=>a.jsx(t.div,{initial:{x:Math.random()*(typeof window<"u"?window.innerWidth:1200),y:Math.random()*(typeof window<"u"?window.innerHeight:800),opacity:0},animate:{y:[0,-40,-20,-60,0],x:[0,15,-10,20,0],opacity:[0,.6,.3,.8,0],scale:[1,1.4,.8,1.2,1],rotate:[0,180,90,270,360]},transition:{duration:20+15*Math.random(),repeat:1/0,delay:10*Math.random(),ease:"easeInOut"},className:"absolute w-2 h-2 rounded-full blur-sm",style:{background:s%3==0?"#F97316":s%3==1?"#FDBA74":"#FED7AA",opacity:.6}},s)),a.jsx(t.div,{animate:{scaleY:[1,1.3,.8,1.2,1],opacity:[.2,.4,.1,.3,.2],skewX:[0,5,-3,2,0]},transition:{duration:28,repeat:1/0,ease:"easeInOut"},className:"absolute top-0 left-1/4 w-px h-full blur-sm",style:{background:"linear-gradient(to bottom, transparent 0%, #F97316 50%, transparent 100%)"}}),a.jsx(t.div,{animate:{scaleX:[1,1.4,.7,1.3,1],opacity:[.15,.35,.1,.25,.15],skewY:[0,-3,4,-2,0]},transition:{duration:32,repeat:1/0,ease:"easeInOut"},className:"absolute top-2/3 left-0 w-full h-px blur-sm",style:{background:"linear-gradient(to right, transparent 0%, #FDBA74 50%, transparent 100%)"}}),a.jsx(t.div,{animate:{scale:[1,1.1,.9,1.05,1],opacity:[.3,.5,.2,.4,.3],rotate:[0,45,-30,60,0],borderRadius:["30% 70% 70% 30% / 30% 30% 70% 70%","70% 30% 30% 70% / 70% 70% 30% 30%","50% 50% 50% 50% / 50% 50% 50% 50%","40% 60% 60% 40% / 60% 40% 40% 60%","30% 70% 70% 30% / 30% 30% 70% 70%"]},transition:{duration:45,repeat:1/0,ease:"easeInOut"},className:"absolute top-1/4 left-1/4 w-32 h-32 opacity-30 blur-lg",style:{background:"linear-gradient(135deg, #F97316 0%, #FDBA74 100%)"}}),a.jsx(t.div,{animate:{scale:[1,.8,1.2,.95,1],opacity:[.25,.4,.15,.35,.25],rotate:[0,-60,40,-45,0],borderRadius:["40% 60% 30% 70% / 60% 30% 70% 40%","60% 40% 70% 30% / 40% 70% 30% 60%","50% 50% 50% 50% / 50% 50% 50% 50%","70% 30% 40% 60% / 30% 70% 60% 40%","40% 60% 30% 70% / 60% 30% 70% 40%"]},transition:{duration:38,repeat:1/0,ease:"easeInOut"},className:"absolute bottom-1/4 right-1/4 w-24 h-24 opacity-25 blur-md",style:{background:"linear-gradient(135deg, #FDBA74 0%, #FED7AA 100%)"}})]}),a.jsx("div",{className:"relative z-10 min-h-screen flex items-center justify-center p-4",children:a.jsx(t.div,{ref:v,initial:{opacity:0,y:50,scale:.9},animate:f?{opacity:1,y:0,scale:1}:{},transition:{duration:.8,ease:"easeOut"},className:"w-full max-w-md",children:a.jsxs(t.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{duration:1,delay:.3},className:"bg-white/80 backdrop-blur-xl rounded-3xl shadow-2xl border border-white/20 p-8 relative overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-orange-50/50 to-blue-50/50 rounded-3xl"}),a.jsxs(t.div,{initial:{opacity:0,y:-30},animate:f?{opacity:1,y:0}:{},transition:{duration:.6,delay:.5},className:"relative z-10 text-center mb-8",children:[a.jsx(t.div,{whileHover:{scale:1.05},transition:{type:"spring",stiffness:300},className:"inline-block mb-4",children:a.jsxs("h1",{className:"text-4xl font-bold tracking-tight",children:[a.jsx("span",{className:"text-black",children:"My"}),a.jsx("span",{className:"bg-gradient-to-r from-orange-500 to-orange-600 bg-clip-text text-transparent",style:{color:"#FFB347"},children:"Fidelity"})]})}),a.jsx(t.h2,{initial:{opacity:0},animate:f?{opacity:1}:{},transition:{duration:.6,delay:.7},className:"text-2xl font-semibold text-gray-800 mb-2",children:"Bon retour !"}),a.jsx(t.p,{initial:{opacity:0},animate:f?{opacity:1}:{},transition:{duration:.6,delay:.9},className:"text-gray-600",children:"Connectez-vous à votre tableau de bord"})]}),a.jsxs(t.form,{initial:{opacity:0,y:20},animate:f?{opacity:1,y:0}:{},transition:{duration:.6,delay:1.1},className:"relative z-10 space-y-6",onSubmit:async e=>{var a;e.preventDefault(),y(!0),g("");const{data:t,error:s}=await r.auth.signInWithPassword({email:d,password:u});return s?(g(s.message),void y(!1)):(null==(a=t.user)?void 0:a.email_confirmed_at)?(y(!1),void(window.location.href="/dashboard")):(g("Veuillez vérifier votre adresse email avant de vous connecter."),void y(!1))},children:[a.jsxs(t.div,{whileFocus:{scale:1.02},className:"space-y-2",children:[a.jsx("label",{className:"block text-sm font-semibold text-gray-700",children:"Adresse email"}),a.jsx(t.input,{whileFocus:{boxShadow:"0 0 0 3px rgba(255, 179, 71, 0.15)",borderColor:"#FFB347"},type:"email",className:"w-full px-4 py-4 border border-gray-200 rounded-2xl bg-white/80 backdrop-blur-sm text-gray-900 placeholder-gray-500 focus:outline-none focus:ring-0 transition-all duration-300",placeholder:"[email protected]",value:d,onChange:e=>c(e.target.value),required:!0})]}),a.jsxs(t.div,{whileFocus:{scale:1.02},className:"space-y-2",children:[a.jsx("label",{className:"block text-sm font-semibold text-gray-700",children:"Mot de passe"}),a.jsxs("div",{className:"relative",children:[a.jsx(t.input,{whileFocus:{boxShadow:"0 0 0 3px rgba(255, 179, 71, 0.15)",borderColor:"#FFB347"},type:p?"text":"password",className:"w-full px-4 py-4 pr-12 border border-gray-200 rounded-2xl bg-white/80 backdrop-blur-sm text-gray-900 placeholder-gray-500 focus:outline-none focus:ring-0 transition-all duration-300",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:u,onChange:e=>m(e.target.value),required:!0,minLength:8}),a.jsx("button",{type:"button",className:"absolute inset-y-0 right-0 pr-4 flex items-center",onClick:()=>x(!p),children:a.jsx(t.div,{whileTap:{scale:.95},className:"text-gray-400 hover:text-gray-600 transition-colors",children:p?a.jsx(o,{className:"h-5 w-5"}):a.jsx(n,{className:"h-5 w-5"})})})]})]}),b&&a.jsx(t.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"bg-betterave-50 border border-betterave-200 rounded-xl p-4",children:a.jsx("p",{className:"text-betterave-600 text-sm font-medium text-center",children:b})}),a.jsx(t.button,{whileHover:{scale:1.02,y:-2},whileTap:{scale:.98},type:"submit",disabled:h,className:"w-full bg-[#FFB347] hover:bg-[#FFA726] text-white font-semibold rounded-2xl py-4 mt-6 shadow-xl hover:shadow-2xl transition-all duration-300 disabled:opacity-70 group",children:a.jsx("div",{className:"flex items-center justify-center gap-2",children:h?a.jsxs(a.Fragment,{children:[a.jsx(t.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-5 h-5 border-2 border-white/30 border-t-white rounded-full"}),a.jsx("span",{children:"Connexion en cours..."})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Se connecter"}),a.jsx(t.div,{className:"group-hover:translate-x-1 transition-transform duration-300",children:a.jsx(l,{className:"w-5 h-5"})})]})})})]}),a.jsxs(t.div,{initial:{opacity:0}
1,animate:f?{opacity:1}:{},transition:{duration:.6,delay:1.3},className:"relative z-10 mt-8 text-center space-y-4",children:[a.jsx(t.div,{whileHover:{scale:1.05},className:"inline-block",children:a.jsxs(s,{to:"/signup",className:"text-gray-600 hover:text-orange-600 font-medium transition-colors duration-200",children:["Pas encore de compte ? ",a.jsx("span",{className:"font-semibold",style:{color:"#F97316"},children:"Créer un compte"})]})}),a.jsx(t.div,{whileHover:{scale:1.05},className:"inline-block",children:a.jsx(s,{to:"/forgot-password",className:"text-sm text-gray-500 hover:text-gray-700 transition-colors duration-200",children:"Mot de passe oublié ?"})})]})]})})})]})}export{d as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.