// src/footer.jsx — V2 comprehensive legal-compliance footer
// Per 10-FOOTER-LEGAL-COMPLIANCE.md (operator-authorized rebrand 2026-05-23 NIGHT)
// + NN-5 from 11-VISUAL-OVERHAUL-NON-NEGOTIABLES.md
//
// Operator pre-flight items inline-commented per section. Operator owns final
// legal review before public traffic.

function LegalFooter() {
  return (
    <footer className="cohort-shift" style={{
      borderTop: '1px solid var(--brand-border)',
      background: 'var(--brand-bg-sunken)',
      marginTop: 'var(--gap-12)',
    }}>
      <div className="container" style={{ paddingTop: 40, paddingBottom: 28 }}>

        {/* ===== SECTION A — CONTACT + TRUST BADGES ============================== */}
        <div className="footer-contact-row" style={{
          display: 'grid', gridTemplateColumns: '1.4fr 1fr', gap: 28,
          paddingBottom: 28, borderBottom: '1px solid var(--brand-border)',
          alignItems: 'center',
        }}>
          <style>{`
            @media (max-width: 768px) {
              .footer-contact-row { grid-template-columns: 1fr !important; gap: 20px !important; }
              .footer-trust-badges { justify-content: flex-start !important; }
            }
          `}</style>
          <div>
            <div className="eyebrow">CONTACT US</div>
            <a href="mailto:hello@fujirx.com" className="hero-display" style={{
              fontSize: 'clamp(24px, 3vw, 36px)', color: 'var(--brand-text)',
              display: 'inline-block', marginTop: 6, lineHeight: 1.1,
              textDecoration: 'none',
            }}>{'hello@fujirx.com'}</a>
            <p style={{ marginTop: 10, color: 'var(--brand-text-muted)', fontSize: 14 }}>
              Patient Portal launches with Phase 2. Your reservation is held — check email for updates.
            </p>
            {/* H5 (audit50): removed the deceptive "Go To Your Portal ->" mailto (the portal
                is Phase 2, not built; the line above already conveys it). */}
          </div>
          <div className="footer-trust-badges" style={{
            display: 'flex', flexWrap: 'wrap', gap: 10, justifyContent: 'flex-end',
          }}>
            {/* LegitScript omitted until certified (operator-action) */}
            <TrustBadge icon="leaf"    label="Made in USA"   />
            <TrustBadge icon="shield"  label="HIPAA-Aligned" />
            <TrustBadge icon="beaker"  label="503A Pharmacy" />
          </div>
        </div>

        {/* ===== SECTION B — BRAND + NAV + PAYMENT BADGES ========================= */}
        <div className="footer-brand-row" style={{
          display: 'flex', justifyContent: 'space-between', alignItems: 'center',
          padding: '22px 0', borderBottom: '1px solid var(--brand-border)',
          flexWrap: 'wrap', gap: 16,
        }}>
          <ZeraLogo size={22} />
          <nav style={{
            display: 'flex', gap: 18, flexWrap: 'wrap', fontSize: 13.5,
            color: 'var(--brand-text-muted)',
          }}>
            {/* M4: removed the deceptive "About" mailto (no About page; real Contact kept). */}
            <a href="#safety">Safety Information</a>
            <a href="#protocols">Treatment</a>
            {/* M3: removed "Reviews" -> #testimonials (intentional empty state, no consented reviews). */}
            <a href="#faq">FAQs</a>
            <a href="mailto:hello@fujirx.com">Contact</a>
          </nav>
          <div style={{ display: 'flex', gap: 6, alignItems: 'center' }}>
            {['VISA', 'MC', 'AMEX', 'DISC'].map(b => (
              <span key={b} className="mono" style={{
                fontSize: 9.5, fontWeight: 600,
                padding: '4px 7px',
                border: '1px solid var(--brand-border)',
                borderRadius: 4, color: 'var(--brand-text-muted)',
                letterSpacing: '0.06em',
                background: 'var(--brand-bg-elev)',
              }}>{b}</span>
            ))}
          </div>
        </div>

        {/* ===== SECTIONS C-F — LEGAL DISCLAIMERS (REBRANDED FROM TRIMRX) ========= */}
        <div style={{
          fontSize: 12, color: 'var(--brand-text-muted)', lineHeight: 1.65,
          padding: '22px 0', display: 'flex', flexDirection: 'column', gap: 14,
        }}>
          {/* Section C — Medication Options */}
          <p>
            <strong style={{ color: 'var(--brand-text)' }}>Medication Options:</strong> The {'Fuji'} platform connects you with licensed
            medical providers who can prescribe medication based on their professional judgment.
            This may include: <strong>• Compounded Medication Program:</strong> Our primary program provides access to compounded
            medications, which are prepared and shipped by a state-licensed sterile compounding pharmacy. These compounded drugs are not FDA-approved.
            This means the FDA has not reviewed them for safety, effectiveness, or quality. <strong>• Prescriptions for Branded Medications:</strong>
            Alternatively, your provider may write a prescription for an FDA-approved branded medication (e.g., Ozempic®, Wegovy®).
            {'Fuji'} does not sell, dispense, or ship any branded medications. If you are prescribed a branded medication, you are responsible
            for filling the prescription at your chosen pharmacy and for all associated costs. <strong>No Guarantees:</strong> Individual
            results may vary. Weight loss is not guaranteed and is influenced by many factors, including diet, exercise, and individual biology.
            The information on this website is for educational purposes only and does not constitute medical advice. Always consult a
            healthcare professional before starting any new medication or weight loss program. Ozempic®, Wegovy®, Zepbound®, and Mounjaro®
            are trademarks of their respective owners and are not affiliated with {'Fuji'}.
          </p>

          {/* Section D — Medical practice */}
          <p>
            {'Fuji'} is not a medical practice and the assessment available on the {'Fuji'} website does not create a doctor-patient relationship.
            Clinical services are provided by third party networks of U.S.-licensed clinicians who determine eligibility for peptide protocol
            treatment based on medical history and provider assessment. Providers make the final determination as to whether to prescribe
            any medication. Compounded medications offered by providers accessed through the {'Fuji'} website are produced in FDA-registered
            facilities but are not FDA-approved and have not been evaluated by the FDA for safety, efficacy, or quality. Results may vary
            depending on individual adherence, provider guidance, and lifestyle changes. {'Fuji'} does not produce, manufacture, or prescribe
            any medications, and product appearance may differ from website images. {'Fuji'} associates with certified U.S. pharmacies to
            ensure high standards of safety and quality. Medication costs are included in the fees collected by {'Fuji'} and {'Fuji'} pays
            the pharmacies. Unless otherwise noted, results reflect patient experiences related to {'Fuji'} by medical providers, rather
            than public clinical studies.
          </p>

          {/* Section E REMOVED (F1 / PEP-G-039): deleted the "User results reflect recent
              internal statistics from paid orders" claim — the brand has shipped ZERO paid orders,
              so the stat is fabricated. Re-add a truthful results disclaimer only when real
              outcome data exists (pending-counsel). */}

          {/* Section F — Product depiction */}
          <p>
            {'Fuji'} is not a medical practice or a pharmacy. We do not employ health care providers, nor do we directly provide medication
            of any kind. Depictions of products on this website do not represent actual products that you will receive. Products will not
            bear the {'Fuji'} name or logo.
          </p>
        </div>

        {/* ===== SECTION G — MEDICAL CITATIONS (peer-reviewed; no press logos) ===== */}
        <div style={{
          padding: '18px 0', borderTop: '1px solid var(--brand-border)',
          fontSize: 12, color: 'var(--brand-text-muted)',
        }}>
          <div className="eyebrow" style={{ marginBottom: 8 }}>MEDICAL CITATIONS</div>
          <div style={{ display: 'flex', gap: 14, flexWrap: 'wrap' }}>
            <a href="https://pubmed.ncbi.nlm.nih.gov/" target="_blank" rel="noopener noreferrer" style={{ textDecoration: 'underline' }}>NIH PubMed</a>
            <span>·</span>
            <a href="https://www.endocrine.org/clinical-practice-guidelines" target="_blank" rel="noopener noreferrer" style={{ textDecoration: 'underline' }}>Endocrine Society</a>
            <span>·</span>
            <a href="https://onlinelibrary.wiley.com/journal/10991387" target="_blank" rel="noopener noreferrer" style={{ textDecoration: 'underline' }}>Journal of Peptide Science</a>
            <span>·</span>
            <a href="https://www.a4m.com/" target="_blank" rel="noopener noreferrer" style={{ textDecoration: 'underline' }}>A4M</a>
            <span>·</span>
            <a href="https://www.fda.gov/drugs/development-approval-process-drugs/compounded-drugs" target="_blank" rel="noopener noreferrer" style={{ textDecoration: 'underline' }}>FDA Compounded Drugs Guidelines</a>
          </div>
        </div>

        {/* ===== SECTION H — LEGAL POLICY LINKS ============================== */}
        <div style={{
          padding: '18px 0', borderTop: '1px solid var(--brand-border)',
          display: 'flex', flexDirection: 'column', gap: 12,
        }}>
          <div style={{ display: 'flex', gap: 14, flexWrap: 'wrap', fontSize: 12, color: 'var(--brand-text-muted)' }}>
            <a href="/legal/hipaa-privacy.html" style={{ textDecoration: 'underline' }}>HIPAA Privacy Policy</a>
            <span>·</span>
            <a href="/legal/sms-privacy.html" style={{ textDecoration: 'underline' }}>SMS Privacy Policy</a>
            <span>·</span>
            <a href="/legal/privacy.html" style={{ textDecoration: 'underline' }}>Privacy Policy</a>
            <span>·</span>
            <a href="/legal/terms.html" style={{ textDecoration: 'underline' }}>Terms and Conditions</a>
            <span>·</span>
            <a href="/legal/shipping.html" style={{ textDecoration: 'underline' }}>Shipping Policy</a>
          </div>

          {/* ===== SECTION I — COPYRIGHT ====================================== */}
          <div style={{
            display: 'flex', justifyContent: 'space-between', alignItems: 'center',
            flexWrap: 'wrap', gap: 8, fontSize: 11.5, color: 'var(--brand-text-soft)',
          }}>
            <span>© 2026 {'Fuji'}. All rights reserved. {'Fuji'} is a service mark of <span className="mono" style={{ opacity: 0.6 }}>{'Fuji RX LLC, Delaware'}</span>.</span>
            <span className="mono">build · v2.0.0 · {new Date().toISOString().slice(0, 10)}</span>
          </div>
        </div>
      </div>
    </footer>
  );
}

function TrustBadge({ icon, label }) {
  return (
    <div className="cohort-shift" style={{
      display: 'inline-flex', alignItems: 'center', gap: 8,
      padding: '10px 14px',
      background: 'var(--brand-bg-elev)',
      border: '1px solid var(--brand-border)',
      borderRadius: 10,
      fontSize: 12.5, fontWeight: 600, color: 'var(--brand-text)',
      whiteSpace: 'nowrap',
    }}>
      <span style={{
        width: 26, height: 26, borderRadius: 8,
        background: 'var(--brand-secondary-soft)',
        color: 'var(--brand-secondary)',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        flexShrink: 0,
      }}>
        <Icon kind={icon} size={14} />
      </span>
      {label}
    </div>
  );
}

Object.assign(window, { LegalFooter });
