"use client";

import { ArrowRight } from "lucide-react";
import { useWaitlist } from "@/components/waitlist/WaitlistProvider";

const CTA = () => {
  const { openWaitlist } = useWaitlist();

  return (
    <section className="my-12 sm:my-16 xl:my-17.5">
      <div className="container relative overflow-hidden rounded-3xl bg-brand sm:rounded-4xl xl:rounded-[36px]">
        <div className="px-6 pt-10 pb-8 text-center sm:px-10 sm:pt-14 sm:pb-12 lg:px-16 lg:pt-16 xl:pt-20 xl:pr-110 xl:pb-17 xl:pl-27.5 xl:text-left">
          <h2 className="text-[clamp(1.75rem,4.6vw,3.4375rem)] font-bold leading-[1.15] text-balance text-white">
            Make ChatHiro the center of your customer stack.
          </h2>
          <p className="mx-auto mt-4 max-w-2xl text-base leading-relaxed text-white sm:mt-6 sm:text-xl lg:text-2xl xl:mx-0 xl:mt-8.5 xl:max-w-none">
            Bring your team, AI and customer conversations together in one
            beautifully simple place with ChatHiro.
          </p>
        </div>
        <div className="flex flex-col items-center justify-center rounded-t-[72px] bg-brand-soft px-6 py-8 sm:rounded-t-[120px] sm:py-10 xl:absolute xl:inset-y-0 xl:right-0 xl:w-100 xl:rounded-t-none xl:rounded-l-[500px] xl:px-8">
          <button
            type="button"
            onClick={() => openWaitlist()}
            className="group inline-flex w-full max-w-xs items-center justify-center gap-2 rounded-2xl bg-white px-6 py-3.5 text-base font-semibold leading-tight text-brand-deep shadow-[0_8px_24px_-10px_rgba(4,16,57,0.35)] transition-all duration-300 hover:-translate-y-0.5 hover:bg-brand-pale hover:text-brand-deeper hover:shadow-[0_14px_28px_-10px_rgba(4,16,57,0.5)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white active:translate-y-0 sm:w-auto sm:text-lg"
          >
            Start free
            <ArrowRight className="size-5 transition-transform duration-300 group-hover:translate-x-1 sm:size-6" />
          </button>
          <span className="mt-2 text-center text-[10px] font-semibold text-white sm:text-xs">
            Fast setup · No-code connections
          </span>
        </div>
      </div>
    </section>
  );
};

export default CTA;
