// CourtiersLanding — Route #/courtiers
// Vague 1 PR 1.1 — Landing publique qui vend le plan Pro 59$/mois aux courtiers OACIQ
// et fait le pont vers le dashboard existant #/courtier (gating Pro).
//
// Conventions Vestora vanilla : aucun import/export ES,
// composant exposé via window.CourtiersLanding, React/hooks accédés via le global.

(function () {
  const { useState, useEffect } = React;

  // ---------- Helpers stubs (auth / billing absents en dev) ----------
  function showToast(msg) {
    const el = document.createElement('div');
    el.textContent = msg;
    Object.assign(el.style, {
      position: 'fixed', bottom: '24px', left: '50%', transform: 'translateX(-50%)',
      background: 'oklch(0.18 0.012 85)', color: '#fff',
      padding: '12px 24px', borderRadius: '8px', zIndex: 9999,
      fontSize: '14px', fontFamily: 'Inter, sans-serif',
      boxShadow: '0 4px 16px rgba(0,0,0,0.25)',
    });
    document.body.appendChild(el);
    setTimeout(() => el.remove(), 3500);
  }

  function getCurrentUser() {
    const auth = window.vestora && window.vestora.auth;
    if (!auth) return null;
    if (typeof auth.getUser === 'function') return auth.getUser();
    return auth.currentUser || null;
  }

  function openLoginModal(intent) {
    // On stocke l'intent dans une variable globale lue par l'effet de continuation
    // (la LoginModal existante ne prend pas de prop intent — Sprint 1 garde l'API stable).
    if (intent) window.__vestoraIntent = intent;
    const auth = window.vestora && window.vestora.auth;
    if (auth && typeof auth.openModal === 'function') {
      auth.openModal();
    } else {
      showToast('Connexion bientôt disponible.');
    }
  }

  function startCheckout(planKey) {
    const billing = window.vestora && window.vestora.billing;
    if (billing && typeof billing.startCheckout === 'function') {
      billing.startCheckout(planKey);
    } else {
      showToast('Paiement bientôt disponible (Stripe).');
    }
  }

  // ---------- Données plan Pro (extrait de PricingPage) ----------
  // On garde une définition locale minimale pour rester découplé de PricingPage,
  // afin d'éviter un refactor cross-PR. Si PricingPage change, ajuster ici.
  const PRO_PLAN = {
    id: 'pro',
    name: 'Pro',
    monthlyPrice: 59,
    annualPrice: 564,
    annualPerMonth: 47,
    features: [
      'Tableau de bord courtier (marché, opportunités, clients, fiche rapide)',
      'Matching automatique clients ↔ listings',
      'Alertes nouvelles annonces illimitées',
      'Analyse complète avec 3 scénarios + projection 10 ans',
      'Fiche PDF brandée à partager (client, banquier)',
      'Module fiscalité QC (CCA, gain en capital)',
      'Test de sensibilité 6 variables + export CSV',
      'Historique cloud + favoris multi-appareils',
    ],
  };

  // ---------- FAQ ----------
  const FAQ = [
    {
      q: 'Vestora est-il conforme aux exigences de l\'OACIQ ?',
      a: 'Vestora est un outil d\'aide à la décision destiné aux investisseurs et aux courtiers. Les analyses présentées ne constituent pas un avis professionnel et ne remplacent pas le devoir de conseil du courtier. Vous restez en tout temps responsable de la conformité des transactions présentées à vos clients.',
    },
    {
      q: 'D\'où proviennent les données affichées ?',
      a: 'Les listings proviennent du scrape public Centris (mise à jour quotidienne). Un partenariat MLS direct (feed Matrix via courtier OACIQ partenaire) est en cours d\'intégration pour des données live et exhaustives. Les calculs financiers (cap rate, DSCR, cash-flow) sont effectués en temps réel selon vos hypothèses.',
    },
    {
      q: 'Comment Vestora respecte-t-il la Loi 25 (protection des renseignements personnels) ?',
      a: 'Les données de vos clients (préférences, alertes, notes) sont hébergées au Canada (Supabase région Montréal), chiffrées en transit (TLS) et au repos. Vous gardez le contrôle total : export et suppression à tout moment depuis votre espace courtier. Notre politique de confidentialité détaille les durées de conservation.',
    },
    {
      q: 'Puis-je partager les analyses à mes clients sans qu\'ils aient un compte ?',
      a: 'Oui. Le plan Pro inclut l\'export PDF de l\'analyse complète brandée Vestora. Vous le partagez par courriel, en visite ou en présentation banque — votre client n\'a besoin d\'aucun compte pour le consulter.',
    },
    {
      q: 'Comment Vestora calcule-t-il les dépenses d\'opération (OpEx) ?',
      a: 'Les vendeurs sous-déclarent souvent les OpEx sur Centris (cap rate gonflé). Quand les dépenses déclarées sont absentes OU inférieures à 30 % des revenus bruts, Vestora applique un benchmark normalisé par ville × taille × ère de construction. Catégories couvertes : taxes municipales (priorité MAMH), taxes scolaires (taux MEQ), assurances, entretien, gestion (5-7 % si >5 portes), déneigement, énergie communs, GER (réserve de remplacement). Sources : SCHL (CMHC), APCHQ, StatCan Income Property Survey, recensement MAMH 2024. Un badge ⚖️ « OpEx normalisée » apparaît à côté du cap rate concerné, avec le détail du calcul.',
    },
    {
      q: 'Que se passe-t-il après les 7 jours d\'essai ?',
      a: 'Aucun débit automatique. À la fin du trial Pro, votre compte revient en mode Découverte (gratuit). Si vous souhaitez continuer, vous activez l\'abonnement Pro 59$/mois (ou 47$/mois en facturation annuelle) en un clic depuis votre espace compte. Annulation en un clic à tout moment.',
    },
  ];

  // ---------- CTA logic ----------
  function ctaLabelForUser(user) {
    if (!user) return 'Essayer 7 jours gratuits';
    const plan = user.plan || (user.user_metadata && user.user_metadata.plan);
    if (plan === 'pro' || plan === 'agent') return 'Ouvrir mon dashboard';
    return 'Activer mon essai Pro 7 jours';
  }

  function handleCTA(user) {
    if (!user) {
      if (window.vestora && window.vestora.analytics) {
        window.vestora.analytics.track('Lead', { plan: 'pro', surface: 'courtiers_landing' });
      }
      openLoginModal('broker_trial');
      return;
    }
    const plan = user.plan || (user.user_metadata && user.user_metadata.plan);
    if (plan === 'pro' || plan === 'agent') {
      window.location.hash = '#/courtier';
      return;
    }
    startCheckout('pro_monthly');
  }

  // ---------- Sub-components ----------
  function BenefitIcon({ kind }) {
    const common = { width: 28, height: 28, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 1.6, strokeLinecap: 'round', strokeLinejoin: 'round' };
    if (kind === 'match') {
      return (
        <svg {...common}>
          <circle cx="7" cy="8" r="3" />
          <circle cx="17" cy="8" r="3" />
          <path d="M4 20c0-2.8 1.8-5 3-5s3 2.2 3 5" />
          <path d="M14 20c0-2.8 1.8-5 3-5s3 2.2 3 5" />
          <path d="M10 8h4" />
        </svg>
      );
    }
    if (kind === 'bell') {
      return (
        <svg {...common}>
          <path d="M6 8a6 6 0 0112 0c0 7 3 9 3 9H3s3-2 3-9" />
          <path d="M10.3 21a1.94 1.94 0 003.4 0" />
        </svg>
      );
    }
    if (kind === 'pdf') {
      return (
        <svg {...common}>
          <path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" />
          <path d="M14 2v6h6" />
          <path d="M8 13h8M8 17h5" />
        </svg>
      );
    }
    return null;
  }

  function FAQItem({ q, a }) {
    const [open, setOpen] = useState(false);
    return (
      <div style={{ borderBottom: '1px solid var(--line)' }}>
        <button
          onClick={() => setOpen(o => !o)}
          style={{
            width: '100%', textAlign: 'left', background: 'none', border: 'none',
            padding: '16px 0', display: 'flex', justifyContent: 'space-between',
            alignItems: 'center', gap: 12, cursor: 'pointer',
            fontSize: 14, fontWeight: 500, color: 'var(--ink-1)',
            fontFamily: 'inherit',
          }}
        >
          <span>{q}</span>
          <span style={{
            fontSize: 18, color: 'var(--ink-3)', flexShrink: 0,
            transform: open ? 'rotate(45deg)' : 'none', transition: 'transform 0.2s',
          }}>+</span>
        </button>
        {open && (
          <div style={{ fontSize: 14, color: 'var(--ink-2)', lineHeight: 1.65, paddingBottom: 16 }}>
            {a}
          </div>
        )}
      </div>
    );
  }

  function ProPlanCard({ user, annual }) {
    const price = annual ? PRO_PLAN.annualPerMonth : PRO_PLAN.monthlyPrice;
    const note = annual
      ? `Facturé ${PRO_PLAN.annualPrice}$/an — 2 mois offerts`
      : 'Facturé mensuellement';
    const label = ctaLabelForUser(user);

    return (
      <div style={{
        background: 'var(--bg-elev)',
        border: '2px solid var(--accent)',
        borderRadius: 'var(--radius-lg)',
        padding: '32px 28px',
        boxShadow: 'var(--shadow-lg)',
        maxWidth: 420, margin: '0 auto',
        position: 'relative',
      }}>
        <div style={{
          position: 'absolute', top: -14, left: '50%', transform: 'translateX(-50%)',
          background: 'var(--accent)', color: 'var(--accent-fg)',
          borderRadius: 20, padding: '4px 14px',
          fontSize: 12, fontWeight: 700, whiteSpace: 'nowrap',
        }}>
          Recommandé pour courtiers
        </div>
        <div style={{
          fontFamily: 'var(--serif)', fontSize: 22, fontWeight: 500,
          color: 'var(--ink-1)', marginBottom: 6,
        }}>
          Vestora Pro
        </div>
        <div style={{ display: 'flex', alignItems: 'flex-end', gap: 6, marginBottom: 4 }}>
          <span style={{
            fontFamily: 'var(--mono)', fontSize: 44,
            fontWeight: 700, color: 'var(--accent-ink)', lineHeight: 1,
          }}>
            {price}$/mo
          </span>
        </div>
        <div style={{ fontSize: 12, color: 'var(--ink-3)', marginBottom: 16 }}>
          {note}
        </div>
        <button
          onClick={() => handleCTA(user)}
          style={{
            width: '100%', padding: '14px 16px',
            borderRadius: 'var(--radius)',
            border: 'none',
            background: 'var(--accent)',
            color: 'var(--accent-fg)',
            fontWeight: 700, fontSize: 15, cursor: 'pointer',
            fontFamily: 'inherit',
            marginBottom: 10,
          }}
        >
          {label}
        </button>
        <div style={{
          textAlign: 'center', fontSize: 12, color: 'var(--ink-3)',
          marginBottom: 20,
        }}>
          Sans carte requise · Annule en 1 clic
        </div>
        <div style={{ borderTop: '1px solid var(--line)', margin: '8px 0 16px' }} />
        <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 10 }}>
          {PRO_PLAN.features.map((f, i) => (
            <li key={i} style={{
              display: 'flex', alignItems: 'flex-start', gap: 10,
              fontSize: 13, color: 'var(--ink-1)', lineHeight: 1.45,
            }}>
              <span style={{ color: 'oklch(0.42 0.13 150)', fontWeight: 700, flexShrink: 0 }}>✓</span>
              <span>{f}</span>
            </li>
          ))}
        </ul>
        <div style={{
          marginTop: 16, padding: '10px 12px',
          background: 'var(--bg-warm)', borderRadius: 8,
          fontSize: 12, color: 'var(--ink-2)', textAlign: 'center',
        }}>
          Plan d'équipe (149$/siège/mois) ? <a
            href="mailto:contact@vestora.ca?subject=Vestora Pro — équipe courtiers"
            style={{ color: 'var(--accent-ink)', textDecoration: 'none', fontWeight: 600 }}
          >Nous écrire</a>
        </div>
      </div>
    );
  }

  // ---------- Main ----------
  function CourtiersLanding({ lang, onBack, currentUser }) {
    const [annual, setAnnual] = useState(true);
    const [pendingTrial, setPendingTrial] = useState(false);

    // Si on revient ici déjà loggué avec une intent en attente (post-LoginModal),
    // on relance la CTA automatiquement.
    useEffect(() => {
      if (currentUser && window.__vestoraIntent === 'broker_trial') {
        window.__vestoraIntent = null;
        handleCTA(currentUser);
      }
    }, [currentUser]);

    return (
      <div style={{
        height: '100vh',
        background: 'var(--bg)',
        overflowY: 'auto',
        fontFamily: 'var(--sans)',
      }}>
        {/* Nav back */}
        <div style={{
          position: 'sticky', top: 0, zIndex: 40,
          borderBottom: '1px solid var(--line)',
          background: 'var(--bg-elev)',
          padding: '0 24px',
          height: 56,
          display: 'flex', alignItems: 'center', justifyContent: 'space-between',
        }}>
          <button
            onClick={onBack || (() => window.navigateTo('#/'))}
            style={{
              display: 'flex', alignItems: 'center', gap: 6,
              background: 'none', border: 'none', cursor: 'pointer',
              color: 'var(--ink-2)', fontSize: 14, fontFamily: 'inherit',
              padding: '4px 0',
            }}
          >
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none">
              <path d="M10 3L5 8l5 5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
            </svg>
            Retour
          </button>
          <a href="#/" style={{ textDecoration: 'none', color: 'var(--ink-1)', fontWeight: 600, fontSize: 15, letterSpacing: '-0.01em' }}>
            Vestora
          </a>
          <a
            href="#/tarifs"
            onClick={(e) => { e.preventDefault(); window.navigateTo('#/tarifs'); }}
            style={{
              color: 'var(--ink-3)', textDecoration: 'none',
              fontSize: 13, fontWeight: 500,
            }}
          >
            Tarifs particuliers →
          </a>
        </div>

        {/* 1. Hero */}
        <section style={{
          textAlign: 'center',
          padding: '64px 24px 48px',
          maxWidth: 760, margin: '0 auto',
        }}>
          <div style={{
            display: 'inline-block',
            background: 'var(--accent-soft)',
            color: 'var(--accent-ink)',
            borderRadius: 20, padding: '4px 14px',
            fontSize: 12, fontWeight: 600, letterSpacing: '0.04em',
            marginBottom: 20, textTransform: 'uppercase',
          }}>
            Pour courtiers OACIQ
          </div>
          <h1 style={{
            fontFamily: 'var(--serif)', fontSize: 'clamp(28px, 5vw, 46px)',
            fontWeight: 500, margin: '0 0 16px', color: 'var(--ink-1)',
            lineHeight: 1.15, letterSpacing: '-0.02em',
          }}>
            Outillez vos clients investisseurs en quelques clics.<br />
            <em style={{ fontStyle: 'italic', color: 'var(--accent-ink)' }}>Économisez 10 h par semaine.</em>
          </h1>
          <p style={{
            fontSize: 17, color: 'var(--ink-2)', margin: '0 0 32px',
            lineHeight: 1.6, maxWidth: 560, marginLeft: 'auto', marginRight: 'auto',
          }}>
            Vestora Pro vous donne un tableau de bord courtier branché sur les analyses cap rate, DSCR et cash-flow de chaque plex au Québec. Matching client automatique, alertes illimitées, fiche PDF brandée.
          </p>
          <button
            onClick={() => handleCTA(currentUser)}
            style={{
              padding: '14px 28px',
              borderRadius: 'var(--radius)',
              border: 'none',
              background: 'var(--accent)',
              color: 'var(--accent-fg)',
              fontWeight: 700, fontSize: 15, cursor: 'pointer',
              fontFamily: 'inherit',
              boxShadow: 'var(--shadow-md)',
            }}
          >
            {ctaLabelForUser(currentUser)}
          </button>
          <div style={{ fontSize: 12, color: 'var(--ink-3)', marginTop: 12 }}>
            Sans carte requise · Annule en 1 clic
          </div>
        </section>

        {/* 2. Bénéfices */}
        <section style={{
          maxWidth: 1080, margin: '0 auto', padding: '0 24px 64px',
        }}>
          <div style={{
            display: 'grid',
            gridTemplateColumns: 'repeat(auto-fit, minmax(260px, 1fr))',
            gap: 24,
          }}>
            {[
              {
                kind: 'match',
                title: 'Matching client ↔ listings',
                desc: 'Vos clients investisseurs déclarent leurs critères (budget, rendement cible, ville). Vestora propose en continu les plex qui matchent — vous reprenez la main pour qualifier.',
              },
              {
                kind: 'bell',
                title: 'Alertes nouveautés illimitées',
                desc: 'Soyez le premier à signaler une nouvelle annonce qui colle au profil de votre client. Notifications par email, regroupement quotidien, historique des alertes envoyées.',
              },
              {
                kind: 'pdf',
                title: 'Fiche PDF brandée',
                desc: 'Exportez l\'analyse complète (3 scénarios, projection 10 ans, fiscalité QC) en PDF brandé Vestora. Partagez à votre client, à son banquier ou à son comptable.',
              },
            ].map((b) => (
              <div key={b.kind} style={{
                background: 'var(--bg-elev)',
                border: '1px solid var(--line)',
                borderRadius: 'var(--radius-lg)',
                padding: '24px 22px',
              }}>
                <div style={{
                  width: 44, height: 44, borderRadius: 10,
                  background: 'var(--accent-soft)',
                  color: 'var(--accent-ink)',
                  display: 'flex', alignItems: 'center', justifyContent: 'center',
                  marginBottom: 14,
                }}>
                  <BenefitIcon kind={b.kind} />
                </div>
                <h3 style={{
                  fontFamily: 'var(--serif)', fontSize: 18, fontWeight: 600,
                  margin: '0 0 8px', color: 'var(--ink-1)', letterSpacing: '-0.01em',
                }}>
                  {b.title}
                </h3>
                <p style={{ fontSize: 14, color: 'var(--ink-2)', margin: 0, lineHeight: 1.55 }}>
                  {b.desc}
                </p>
              </div>
            ))}
          </div>
        </section>

        {/* 3. Comment ça marche */}
        <section style={{
          background: 'var(--bg-warm)',
          borderTop: '1px solid var(--line)',
          borderBottom: '1px solid var(--line)',
          padding: '64px 24px',
        }}>
          <div style={{ maxWidth: 1000, margin: '0 auto' }}>
            <h2 style={{
              fontFamily: 'var(--serif)', fontSize: 30, fontWeight: 500,
              textAlign: 'center', marginBottom: 40, color: 'var(--ink-1)',
              letterSpacing: '-0.02em',
            }}>
              Comment ça marche
            </h2>
            <div style={{
              display: 'grid',
              gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))',
              gap: 28,
            }}>
              {[
                {
                  step: '1',
                  title: 'Vous activez votre trial Pro',
                  desc: '7 jours d\'accès complet — sans carte. Configurez votre profil courtier en 2 minutes.',
                },
                {
                  step: '2',
                  title: 'Vous ajoutez vos clients investisseurs',
                  desc: 'Importez votre liste, configurez budget / rendement / ville pour chacun. Vestora fait le matching en continu.',
                },
                {
                  step: '3',
                  title: 'Vous envoyez la fiche PDF',
                  desc: 'Sur les biens qui matchent, exportez l\'analyse complète brandée et envoyez-la à votre client. C\'est tout.',
                },
              ].map((s) => (
                <div key={s.step} style={{ textAlign: 'center' }}>
                  <div style={{
                    width: 48, height: 48, borderRadius: '50%',
                    background: 'var(--accent)', color: 'var(--accent-fg)',
                    display: 'flex', alignItems: 'center', justifyContent: 'center',
                    fontFamily: 'var(--mono)', fontSize: 20, fontWeight: 700,
                    margin: '0 auto 16px',
                  }}>
                    {s.step}
                  </div>
                  <h3 style={{
                    fontFamily: 'var(--serif)', fontSize: 17, fontWeight: 600,
                    margin: '0 0 8px', color: 'var(--ink-1)',
                  }}>
                    {s.title}
                  </h3>
                  <p style={{ fontSize: 14, color: 'var(--ink-2)', margin: 0, lineHeight: 1.55 }}>
                    {s.desc}
                  </p>
                </div>
              ))}
            </div>
          </div>
        </section>

        {/* 4. Prix — Pro plan card */}
        <section style={{ padding: '64px 24px' }}>
          <h2 style={{
            fontFamily: 'var(--serif)', fontSize: 30, fontWeight: 500,
            textAlign: 'center', marginBottom: 12, color: 'var(--ink-1)',
            letterSpacing: '-0.02em',
          }}>
            Un plan, tout inclus
          </h2>
          <p style={{
            textAlign: 'center', fontSize: 14, color: 'var(--ink-3)',
            marginBottom: 28, maxWidth: 520, marginLeft: 'auto', marginRight: 'auto',
            lineHeight: 1.6,
          }}>
            Pas de paliers. Pas de surprise. Le plan Pro donne accès à l'ensemble du dashboard courtier et aux analyses complètes de tous les plex publiés au Québec.
          </p>

          {/* Toggle annuel/mensuel */}
          <div style={{ textAlign: 'center', marginBottom: 28 }}>
            <div style={{
              display: 'inline-flex', alignItems: 'center', gap: 12,
              background: 'var(--bg-warm)', borderRadius: 40,
              padding: '4px', border: '1px solid var(--line)',
            }}>
              <button
                onClick={() => setAnnual(false)}
                style={{
                  padding: '8px 20px', borderRadius: 36, border: 'none',
                  background: !annual ? 'var(--bg-elev)' : 'transparent',
                  color: !annual ? 'var(--ink-1)' : 'var(--ink-3)',
                  fontWeight: !annual ? 600 : 400, fontSize: 14,
                  cursor: 'pointer', fontFamily: 'inherit',
                  boxShadow: !annual ? 'var(--shadow-sm)' : 'none',
                }}
              >
                Mensuel
              </button>
              <button
                onClick={() => setAnnual(true)}
                style={{
                  padding: '8px 20px', borderRadius: 36, border: 'none',
                  background: annual ? 'var(--accent)' : 'transparent',
                  color: annual ? 'var(--accent-fg)' : 'var(--ink-3)',
                  fontWeight: annual ? 600 : 400, fontSize: 14,
                  cursor: 'pointer', fontFamily: 'inherit',
                  display: 'flex', alignItems: 'center', gap: 6,
                }}
              >
                Annuel
                <span style={{
                  background: annual ? 'rgba(255,255,255,0.2)' : 'var(--accent-soft)',
                  color: annual ? 'var(--accent-fg)' : 'var(--accent-ink)',
                  fontSize: 11, fontWeight: 700, borderRadius: 10,
                  padding: '2px 7px',
                }}>
                  −20%
                </span>
              </button>
            </div>
          </div>

          <ProPlanCard user={currentUser} annual={annual} />
        </section>

        {/* 4b. Bandeau Pro Commercial 129$/mo (Vague 5 PR 5.1) */}
        <section style={{
          maxWidth: 880, margin: '0 auto 24px', padding: '0 24px',
        }}>
          <div style={{
            background: 'linear-gradient(135deg, oklch(0.45 0.10 250 / 0.08), oklch(0.45 0.10 250 / 0.02))',
            border: '1.5px solid oklch(0.45 0.10 250)',
            borderRadius: 'var(--radius-lg)',
            padding: '24px 28px',
            display: 'flex', alignItems: 'center', justifyContent: 'space-between',
            gap: 20, flexWrap: 'wrap',
          }}>
            <div style={{ flex: '1 1 320px', minWidth: 280 }}>
              <div style={{
                display: 'inline-block',
                background: 'oklch(0.45 0.10 250)', color: '#fff',
                borderRadius: 16, padding: '3px 10px',
                fontSize: 11, fontWeight: 700, letterSpacing: '0.04em',
                textTransform: 'uppercase', marginBottom: 10,
              }}>
                Nouveau · Pro Commercial
              </div>
              <div style={{
                fontFamily: 'var(--serif)', fontSize: 20, fontWeight: 500,
                color: 'var(--ink-1)', marginBottom: 8, letterSpacing: '-0.01em',
              }}>
                Vous courtez du multilog 6+ ou du mixte résidentiel+commercial ?
              </div>
              <div style={{ fontSize: 14, color: 'var(--ink-2)', lineHeight: 1.55, marginBottom: 4 }}>
                Pro Commercial inclut tout le plan Pro <strong>+ 1 Dossier IA Commercial / mois</strong>,
                comps cap rate par sous-marché, IRR 5/10 ans, pro forma normalisée 12+ portes.
              </div>
              <div style={{ fontSize: 12, color: 'var(--ink-3)', fontStyle: 'italic' }}>
                129$/mois — pour courtiers commerciaux spécialisés.
              </div>
            </div>
            <div style={{ display: 'flex', flexDirection: 'column', gap: 8, flexShrink: 0 }}>
              <a
                href="#/tarifs"
                onClick={(e) => {
                  e.preventDefault();
                  if (window.vestora && window.vestora.analytics) {
                    window.vestora.analytics.track('Lead', { plan: 'pro_commercial', surface: 'courtiers_landing' });
                  }
                  window.location.hash = '#/tarifs';
                }}
                style={{
                  display: 'inline-block', padding: '11px 22px',
                  background: 'oklch(0.45 0.10 250)', color: '#fff',
                  borderRadius: 'var(--radius)', textDecoration: 'none',
                  fontSize: 14, fontWeight: 700, whiteSpace: 'nowrap',
                  textAlign: 'center',
                }}
              >
                Voir Pro Commercial
              </a>
              <a
                href="mailto:contact@vestora.ca?subject=Vestora Pro Commercial — demande d'info"
                style={{
                  fontSize: 12, color: 'var(--ink-3)', textDecoration: 'none',
                  textAlign: 'center',
                }}
              >
                Questions ? Nous écrire
              </a>
            </div>
          </div>
        </section>

        {/* 5. FAQ */}
        <section style={{ maxWidth: 720, margin: '0 auto', padding: '32px 24px 64px' }}>
          <h2 style={{
            fontFamily: 'var(--serif)', fontSize: 28, fontWeight: 500,
            textAlign: 'center', marginBottom: 32, color: 'var(--ink-1)',
            letterSpacing: '-0.02em',
          }}>
            Questions fréquentes
          </h2>
          {FAQ.map((item, i) => (
            <FAQItem key={i} q={item.q} a={item.a} />
          ))}
        </section>

        {/* 6. Footer disclaimer (inline — pas de composant partagé pour l'instant) */}
        <footer style={{
          borderTop: '1px solid var(--line)',
          background: 'var(--bg-elev)',
          padding: '32px 24px',
          fontSize: 12, color: 'var(--ink-3)',
          lineHeight: 1.7,
          textAlign: 'center',
        }}>
          <p style={{ margin: '0 0 8px', maxWidth: 760, marginLeft: 'auto', marginRight: 'auto' }}>
            Vestora est un outil d'aide à la décision à des fins informatives uniquement. Les scores, verdicts et analyses présentés ne constituent pas un conseil financier, fiscal, juridique ou d'investissement et ne remplacent pas le devoir de conseil du courtier OACIQ. Données fournies « telles quelles » sans garantie d'exactitude.
          </p>
          <p style={{ margin: '8px 0 0' }}>
            © {new Date().getFullYear()} Vestora ·{' '}
            <a href="#/confidentialite" style={{ color: 'var(--ink-2)', textDecoration: 'none' }}>Confidentialité</a>{' · '}
            <a href="#/conditions" style={{ color: 'var(--ink-2)', textDecoration: 'none' }}>Conditions</a>{' · '}
            <a href="mailto:contact@vestora.ca" style={{ color: 'var(--ink-2)', textDecoration: 'none' }}>contact@vestora.ca</a>
          </p>
        </footer>
      </div>
    );
  }

  window.CourtiersLanding = CourtiersLanding;
})();
