/* BoatsFun — Page Contact. Expose window.BFPageContact. */

(function () {
  const { I } = window.BF;

  const styles = `
/* ===== HERO ===== */
.bf .ct-hero {
  background: #F0F8FF;
  padding: 56px 20px 48px;
  text-align: center;
}
.bf .ct-hero-inner {
  max-width: 640px;
  margin: 0 auto;
}
.bf .ct-hero h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 40px;
  font-weight: 800;
  color: #002244;
  margin: 0 0 14px;
  line-height: 1.15;
}
.bf .ct-hero .ct-sub {
  font-size: 17px;
  color: #6B7A8C;
  margin: 0 0 10px;
  line-height: 1.6;
}
.bf .ct-hero .ct-intro {
  font-size: 14px;
  color: #8A9BAC;
  line-height: 1.7;
}

/* ===== LAYOUT ===== */
.bf .ct-main {
  background: #F0F8FF;
  padding: 0 20px 80px;
}
.bf .ct-layout {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}

/* ===== CARDS (shared) ===== */
.bf .ct-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px -12px rgba(0,34,68,.13);
  padding: 36px 40px;
}
.bf .ct-card h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #002244;
  margin: 0 0 28px;
  padding-bottom: 14px;
  border-bottom: 2px solid #E8F2FF;
}

/* ===== FORM ===== */
.bf .ct-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.bf .ct-grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.bf .ct-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bf .ct-field label {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #002244;
}
.bf .ct-field label .ct-opt {
  font-weight: 400;
  color: #9AAABB;
  font-size: 12px;
  margin-left: 4px;
}
.bf .ct-field input,
.bf .ct-field select,
.bf .ct-field textarea {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #111;
  background: #fff;
  border: 1px solid #D5DEE8;
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  box-sizing: border-box;
}
.bf .ct-field input:focus,
.bf .ct-field select:focus,
.bf .ct-field textarea:focus {
  border-color: #00B5E2;
  box-shadow: 0 0 0 3px rgba(0,181,226,.12);
}
.bf .ct-field textarea {
  resize: vertical;
  min-height: 120px;
}

/* ===== CONSENT ===== */
.bf .ct-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 6px 0 24px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #002244;
  line-height: 1.5;
  cursor: pointer;
}
.bf .ct-consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #FF8200;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}

/* ===== SUBMIT ===== */
.bf .ct-submit {
  display: inline-block;
  background: #FF8200;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 40px;
  border-radius: 40px;
  border: none;
  cursor: pointer;
  transition: background .2s;
}
.bf .ct-submit:hover { background: #E56F00; }

/* ===== CONFIRMATION ===== */
.bf .ct-confirm {
  text-align: center;
  padding: 16px 0 8px;
}
.bf .ct-confirm .ct-conf-icon {
  width: 52px;
  height: 52px;
  background: #F0FFF8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
}
.bf .ct-confirm h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #002244;
  margin: 0 0 10px;
}
.bf .ct-confirm p {
  font-size: 14px;
  color: #6B7A8C;
  line-height: 1.7;
}

/* ===== INFO CARDS ===== */
.bf .ct-info-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bf .ct-info-item {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px -8px rgba(0,34,68,.10);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.bf .ct-info-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #EAF6FF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #00B5E2;
}
.bf .ct-info-text h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #002244;
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.bf .ct-info-text p,
.bf .ct-info-text a {
  font-size: 14px;
  color: #6B7A8C;
  margin: 0;
  text-decoration: none;
  transition: color .15s;
}
.bf .ct-info-text a:hover { color: #00B5E2; }

/* ===== FAQ BLOCK ===== */
.bf .ct-faq {
  background: #EAF6FF;
  border-radius: 16px;
  padding: 24px;
  margin-top: 4px;
}
.bf .ct-faq h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #002244;
  margin: 0 0 8px;
}
.bf .ct-faq p {
  font-size: 13.5px;
  color: #6B7A8C;
  line-height: 1.6;
  margin: 0 0 16px;
}
.bf .ct-faq-btn {
  display: inline-block;
  background: #002244;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 22px;
  border-radius: 40px;
  text-decoration: none;
  transition: background .2s;
}
.bf .ct-faq-btn:hover { background: #003366; }

/* ===== SOCIAL ===== */
.bf .ct-social {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px -8px rgba(0,34,68,.10);
  padding: 20px 24px;
  margin-top: 4px;
}
.bf .ct-social h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #002244;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.bf .ct-social-note {
  font-size: 13.5px;
  color: #8A9BAC;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .bf .ct-layout { grid-template-columns: 1fr; }
  .bf .ct-card { padding: 28px 24px; }
}
@media (max-width: 720px) {
  .bf .ct-hero h1 { font-size: 28px; }
  .bf .ct-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .bf .ct-card { padding: 22px 16px; }
}
`;

  function BFPageContact() {
    const [submitted, setSubmitted] = React.useState(false);

    function handleSubmit(e) {
      e.preventDefault();
      setSubmitted(true);
      window.scrollTo({ top: 0, behavior: "smooth" });
    }

    return (
      <div className="bf">
        <style>{styles}</style>
        <window.BFHeader />

        {/* ===== HERO ===== */}
        <section className="ct-hero">
          <div className="ct-hero-inner">
            <h1>Contactez BoatsFun</h1>
            <p className="ct-sub">Une question sur une réservation, une offre ou un partenariat ? Écrivez-nous, on vous répond rapidement.</p>
            <p className="ct-intro">Notre équipe vous accompagne pour les réservations, les demandes propriétaires, les offres et les questions générales.</p>
          </div>
        </section>

        {/* ===== MAIN ===== */}
        <section className="ct-main">
          <div className="ct-layout">

            {/* ─── COLONNE GAUCHE : FORMULAIRE ─── */}
            <div className="ct-card">
              <h2>Envoyer un message</h2>
              {submitted ? (
                <div className="ct-confirm">
                  <div className="ct-conf-icon">✓</div>
                  <h3>Message reçu !</h3>
                  <p>Merci. Votre message est prêt à être envoyé. Le branchement du formulaire sera ajouté à la prochaine étape.</p>
                </div>
              ) : (
                <form onSubmit={handleSubmit} encType="multipart/form-data">
                  <div className="ct-grid-2">
                    <div className="ct-field">
                      <label htmlFor="prenom">Prénom</label>
                      <input type="text" id="prenom" name="prenom" required placeholder="Alexandre" />
                    </div>
                    <div className="ct-field">
                      <label htmlFor="nom">Nom</label>
                      <input type="text" id="nom" name="nom" required placeholder="Tremblay" />
                    </div>
                    <div className="ct-field">
                      <label htmlFor="email">Courriel</label>
                      <input type="email" id="email" name="email" required placeholder="alexandre@exemple.com" />
                    </div>
                    <div className="ct-field">
                      <label htmlFor="telephone">Téléphone <span className="ct-opt">(optionnel)</span></label>
                      <input type="tel" id="telephone" name="telephone" placeholder="514-000-0000" />
                    </div>
                  </div>
                  <div className="ct-grid-1">
                    <div className="ct-field">
                      <label htmlFor="sujet">Sujet</label>
                      <select id="sujet" name="sujet" required>
                        <option value="">Sélectionner…</option>
                        <option value="question_generale">Question générale</option>
                        <option value="reservation">Réservation</option>
                        <option value="faire_une_offre">Faire une offre</option>
                        <option value="devenir_hote">Devenir hôte / propriétaire</option>
                        <option value="probleme_reservation">Problème avec une réservation</option>
                        <option value="partenariat">Partenariat</option>
                        <option value="autre">Autre</option>
                      </select>
                    </div>
                    <div className="ct-field">
                      <label htmlFor="message">Message</label>
                      <textarea id="message" name="message" required placeholder="Décrivez votre demande…" />
                    </div>
                  </div>
                  <label className="ct-consent">
                    <input type="checkbox" name="consentement_contact" required />
                    J'accepte d'être contacté par BoatsFun au sujet de ma demande.
                  </label>
                  <button type="submit" className="ct-submit">Envoyer le message</button>
                </form>
              )}
            </div>

            {/* ─── COLONNE DROITE : COORDONNÉES ─── */}
            <div>
              <div className="ct-info-stack">

                <div className="ct-info-item">
                  <div className="ct-info-icon"><I.mail width="18" /></div>
                  <div className="ct-info-text">
                    <h4>Email</h4>
                    <a href="mailto:support@boatsfun.com">support@boatsfun.com</a>
                  </div>
                </div>

                <div className="ct-info-item">
                  <div className="ct-info-icon"><I.phone width="18" /></div>
                  <div className="ct-info-text">
                    <h4>Téléphone</h4>
                    <p>Téléphone à confirmer</p>
                  </div>
                </div>

                <div className="ct-info-item">
                  <div className="ct-info-icon"><I.pin width="18" /></div>
                  <div className="ct-info-text">
                    <h4>Zone</h4>
                    <p>Montréal, Québec</p>
                  </div>
                </div>

                <div className="ct-info-item">
                  <div className="ct-info-icon"><I.cal width="18" /></div>
                  <div className="ct-info-text">
                    <h4>Disponibilité</h4>
                    <p>Assistance 7 jours / 7 pendant la saison</p>
                  </div>
                </div>

                <div className="ct-faq">
                  <h4>Besoin d'aide rapidement ?</h4>
                  <p>Consultez la FAQ pour les questions fréquentes sur les réservations, les dépôts, les remboursements et les offres.</p>
                  <a href="/faq" className="ct-faq-btn">Voir la FAQ →</a>
                </div>

                <div className="ct-social">
                  <h4>Suivez BoatsFun</h4>
                  <p className="ct-social-note">Réseaux sociaux à venir.</p>
                </div>

              </div>
            </div>

          </div>
        </section>

        <window.BFFooter />
      </div>
    );
  }

  window.BFPageContact = BFPageContact;
})();
