/* ==========================================================================
   FinalCTA.jsx | 12 Final CTA
   Purple closing panel with Dusty, restrained orange accents and the quote
   form. Both CTAs set the form's intent and move focus into it.
   ========================================================================== */

function MCFinalCTA({ intent, onIntent, onIntentChange, service, onServiceChange }) {
  const handleIntent = (value) => (event) => {
    event.preventDefault();
    onIntent(value);
  };

  return (
    <section className="mc-section mc-final" id="contact" aria-labelledby="mc-final-title">
      <div className="mc-wrap">
        <div className="mc-final__panel mc-on-lead">
          <div className="mc-final__copy" data-reveal>
            <MCEyebrow>Get in touch</MCEyebrow>
            <h2 className="mc-final__title" id="mc-final-title">
              Ready to call in Dusty?
            </h2>
            <p className="mc-final__lede">
              Tell us what needs cleaning. We’ll help you find the right service for your space.
            </p>
            <div className="mc-final__ctas">
              <a href="#quote" className="mc-btn mc-btn--fluid" onClick={handleIntent('book')}>
                Book a clean
                <MCIcon name="sparkle" className="mc-btn__spark" />
              </a>
              <a href="#quote" className="mc-btn mc-btn--ghost mc-btn--fluid" onClick={handleIntent('quote')}>
                Get a free quote
              </a>
            </div>

            <div className="mc-final__art" aria-hidden="true">
              <MCDusty className="mc-final__dusty" decorative />
              <MCSparkle className="mc-final__spark mc-final__spark--1" />
              <MCSparkle className="mc-final__spark mc-final__spark--2" optional />
              <MCIcon name="moon" className="mc-final__moon mc-deco mc-deco-optional" />
            </div>

            <p className="mc-final__tagline">
              Are you ready to make
              <br />the mess disappear?
            </p>
          </div>

          <div className="mc-final__formwrap mc-on-base" id="quote">
            <MCQuoteForm
              intent={intent}
              onIntentChange={onIntentChange}
              service={service}
              onServiceChange={onServiceChange}
            />
          </div>
        </div>
      </div>
    </section>
  );
}

Object.assign(window, { MCFinalCTA });
