// Legal.jsx — five legal/compliance pages as data + a shared LegalPage renderer.
// NOTE: boilerplate templates. Review with legal counsel before publishing.
const LEGAL = {
  privacy: {
    title: 'Privacy Policy',
    lead: 'How Peaceful Hearts collects, uses, and protects your information.',
    updated: 'June 1, 2026',
    sections: [
      { h: 'Overview', body: ['Peaceful Hearts Direct Primary Care (“Peaceful Hearts,” “we,” “us”) respects your privacy. This policy explains how we handle information collected through this website. It is separate from the Notice of Privacy Practices that governs your protected health information as a patient.'] },
      { h: 'Information we collect', body: ['When you contact us or enroll, we may collect your name, email address, phone number, and any details you choose to share in a message or form. We also collect basic, non-identifying usage data to keep the site working well.'] },
      { h: 'How we use it', body: ['We use your information to respond to your inquiry, set up and manage your membership, and improve the website. We do not sell your information.'] },
      { h: 'Health information', body: ['Please do not send sensitive medical details through the website contact form. Members should use the secure patient portal for medical questions. Health information you share as a patient is protected under our Notice of Privacy Practices and applicable law.'] },
      { h: 'Sharing', body: ['We share information only with service providers who help us operate (for example, our enrollment and portal platform), and only as needed to provide care and run the practice, or where required by law.'] },
      { h: 'Security', body: ['We use reasonable administrative, technical, and physical safeguards to protect your information. No method of transmission over the internet is fully secure.'] },
      { h: 'Your choices', body: ['You may ask us to access, correct, or delete the information you have provided through the website by contacting us using the details below.'] },
    ],
  },
  terms: {
    title: 'Terms of Use',
    lead: 'The terms that govern your use of this website.',
    updated: 'June 1, 2026',
    sections: [
      { h: 'Acceptance', body: ['By using this website, you agree to these Terms of Use. If you do not agree, please do not use the site.'] },
      { h: 'Not medical advice', body: ['The content on this website is for general information only and is not medical advice. Using the site does not create a provider-patient relationship. That relationship begins only when you enroll as a member and establish care.'] },
      { h: 'In an emergency', body: ['If you are experiencing a medical emergency, call 911 or go to the nearest emergency room. Do not use this website for emergencies.'] },
      { h: 'Intellectual property', body: ['The text, logo, and design of this site belong to Peaceful Hearts or its licensors and may not be copied or reused without permission.'] },
      { h: 'Third-party links', body: ['The site may link to third-party services, such as our enrollment and patient portal platform. We are not responsible for the content or practices of those services.'] },
      { h: 'Limitation of liability', body: ['The website is provided “as is.” To the extent permitted by law, Peaceful Hearts is not liable for damages arising from your use of the site.'] },
      { h: 'Governing law', body: ['These terms are governed by the laws of the State of Florida.'] },
    ],
  },
  membership: {
    title: 'Membership Agreement',
    lead: 'A plain-language summary of how membership works.',
    updated: 'June 1, 2026',
    sections: [
      { h: 'Summary', body: ['This page summarizes the Peaceful Hearts membership. The binding agreement is the one you review and sign during enrollment. If anything here differs from the signed agreement, the signed agreement controls.'] },
      { h: 'Membership fee', body: ['You pay a flat monthly fee for your membership: Individual $85/month, or Founding Member $70/month for life for the first 20 patients. Fees are billed monthly unless agreed otherwise.'] },
      { h: 'What’s included', body: ['Membership covers the primary care services described on our Services and Membership pages, including office and telemedicine visits, care coordination, and direct messaging.'] },
      { h: 'What costs extra', body: ['Some items are not covered by the membership fee, including labs (offered at discounted, near-cost pricing), medications, and imaging or specialist visits outside the practice.'] },
      { h: 'Not insurance', body: ['Membership is not health insurance and does not replace it. See our Notice of Non-Insurance for details.'] },
      { h: 'Cancellation', body: ['Membership is month-to-month. You may cancel with 30 days’ written notice. We may also end a membership with notice as described in the signed agreement.'] },
      { h: 'HSA / FSA', body: ['HSA and FSA funds may cover many qualified costs, though rules on membership fees vary. Please check with your HSA provider or tax advisor.'] },
    ],
  },
  noninsurance: {
    title: 'Notice of Non-Insurance',
    lead: 'An important disclosure about what Direct Primary Care is — and is not.',
    updated: 'June 1, 2026',
    sections: [
      { h: 'This is not insurance', body: ['Peaceful Hearts Direct Primary Care is a direct primary care membership. It is NOT health insurance, is NOT a health plan, and is NOT a substitute for health insurance.'] },
      { h: 'What that means for you', body: ['Your membership covers primary care services provided by Peaceful Hearts. It does not pay for or reimburse care received elsewhere, such as hospital stays, emergency care, specialists, imaging, or prescription medications.'] },
      { h: 'Keep your coverage', body: ['We strongly recommend you maintain a high-deductible or catastrophic health insurance plan for hospital, emergency, and specialist needs. Direct Primary Care works alongside that coverage.'] },
      { h: 'Regulatory note', body: ['Direct primary care agreements are recognized under Florida law as distinct from insurance. This notice is provided so you understand the nature of your membership.'] },
    ],
  },
  accessibility: {
    title: 'Accessibility Statement',
    lead: 'Our commitment to a website everyone can use.',
    updated: 'June 1, 2026',
    sections: [
      { h: 'Our commitment', body: ['Peaceful Hearts is committed to making this website accessible to as many people as possible, including people who use assistive technology.'] },
      { h: 'Standards', body: ['We aim to conform to the Web Content Accessibility Guidelines (WCAG) 2.1 at Level AA. Accessibility is an ongoing effort, and we continue to improve the site over time.'] },
      { h: 'Need help?', body: ['If you have trouble accessing any part of this site, or need information in a different format, please contact us using the details below and we will do our best to help.'] },
    ],
  },
};

function LegalPage({ docKey }) {
  const doc = LEGAL[docKey];
  if (!doc) return <Page active={null}><PageHead variant="warm" title="Page not found" /></Page>;
  return (
    <Page active={null}>
      <PageHead variant="warm" eyebrow="Legal" title={doc.title} lead={doc.lead} />
      <section className="ph-section">
        <div className="ph-container">
          <div className="ph-legal">
            <div className="ph-legal-meta">
              <span>Last updated: {doc.updated}</span>
              <span className="ph-legal-flag"><Icon name="shield" size={15} color="#B5862E" /> Template — review with legal counsel before publishing</span>
            </div>
            {doc.sections.map((s, i) => (
              <div className="ph-legal-sec" key={i}>
                {s.h && <h2>{s.h}</h2>}
                {s.body.map((p, j) => <p key={j}>{p}</p>)}
              </div>
            ))}
            <p className="ph-legal-contact">Questions? Contact us at{' '}
              <a href="mailto:info@peacefulheartsdirect.com">info@peacefulheartsdirect.com</a>.</p>
          </div>
        </div>
      </section>
    </Page>
  );
}
renderApp(
  <LegalPage docKey={document.body.getAttribute('data-legal')} />
);
Object.assign(window, { LEGAL, LegalPage });
