import{i as l,j as e,k as m,c as o,P as u,l as h}from"./index-D-pl_72i.js";function b({hiddenFields:i={}}){const[c,a]=l.useState(!1),[r,n]=l.useState(!1),d=async t=>{t.preventDefault(),n(!0);const s=new FormData(t.target);try{await fetch("/",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(s).toString()}),a(!0)}catch{a(!0)}finally{n(!1)}};return c?e.jsxs("div",{className:"bg-white rounded-xl border-t-4 border-t-sky-accent shadow-sm p-6 text-center",children:[e.jsx(m,{className:"w-10 h-10 text-green-600 mx-auto mb-3"}),e.jsx("h3",{className:"text-lg font-bold text-steel-blue mb-2",children:"Request Received"}),e.jsx("p",{className:"text-sm text-graphite mb-3",children:"We will contact you shortly — usually within 1 hour during business hours."}),e.jsxs("a",{href:o.phoneHref,className:"inline-flex items-center gap-1.5 text-vivid-red font-bold text-sm",children:[e.jsx(u,{className:"w-4 h-4"}),"Call ",o.phone]})]}):e.jsxs("div",{className:"bg-white rounded-xl border-t-4 border-t-sky-accent shadow-sm p-6",children:[e.jsx("h3",{className:"text-lg font-bold text-steel-blue mb-4",children:"Schedule Your Free On-Site Estimate"}),e.jsxs("form",{name:"quick-contact",method:"POST","data-netlify":"true",onSubmit:d,className:"space-y-4",children:[e.jsx("input",{type:"hidden",name:"form-name",value:"quick-contact"}),Object.entries(i).map(([t,s])=>e.jsx("input",{type:"hidden",name:t,value:s},t)),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"qf-name",className:"block text-sm font-semibold text-graphite mb-1",children:["Name ",e.jsx("span",{className:"text-vivid-red",children:"*"})]}),e.jsx("input",{type:"text",id:"qf-name",name:"name",required:!0,className:"w-full px-3 py-2.5 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-sky-accent/30 focus:border-sky-accent transition-colors",placeholder:"Your name"})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"qf-phone",className:"block text-sm font-semibold text-graphite mb-1",children:["Phone ",e.jsx("span",{className:"text-vivid-red",children:"*"})]}),e.jsx("input",{type:"tel",id:"qf-phone",name:"phone",required:!0,className:"w-full px-3 py-2.5 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-sky-accent/30 focus:border-sky-accent transition-colors",placeholder:"(555) 555-5555"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"qf-help",className:"block text-sm font-semibold text-graphite mb-1",children:"How can we help?"}),e.jsx("input",{type:"text",id:"qf-help",name:"message",className:"w-full px-3 py-2.5 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-sky-accent/30 focus:border-sky-accent transition-colors",placeholder:"Describe your issue..."})]}),e.jsx("button",{type:"submit",disabled:r,className:"btn-primary w-full text-sm py-2.5 disabled:opacity-60 disabled:cursor-not-allowed",children:r?"Sending...":e.jsxs(e.Fragment,{children:[e.jsx(h,{className:"w-4 h-4"}),"Get Free Estimate"]})})]})]})}export{b as Q};