function PrivacyPolicy({ onNav }) {
  const TM = window.TamarackMedicalDesignSystem_c56b47;
  const LAST_UPDATED = "June 7, 2026";

  const sections = [
    {
      title: "1. Our Commitment to Privacy",
      body: `Tamarack Medical Clinic ("we", "us", "our") is committed to protecting your personal information in accordance with the Personal Information Protection and Electronic Documents Act (PIPEDA), Alberta's Personal Information Protection Act (PIPA), and the Health Information Act (HIA) of Alberta. This Privacy Policy explains how we collect, use, disclose, and safeguard your personal and health information.`
    },
    {
      title: "2. Information We Collect",
      body: `We may collect the following categories of personal information:\n\nIdentification Information: Full name, date of birth, Alberta Health Care number, address, phone number, and email address.\n\nHealth Information: Medical history, diagnoses, treatment records, prescriptions, referrals, and other clinical information as required to provide medical care.\n\nAppointment & Booking Information: Appointment requests, scheduling preferences, and visit history submitted through our website or by phone.\n\nBilling & Payment Information: Alberta Health billing records, private pay invoices, WCB claim numbers, and payment details where applicable.\n\nWebsite Usage Data: IP address, browser type, pages visited, and interaction data collected through cookies and analytics tools including Meta Pixel (Facebook Pixel) for website improvement and marketing purposes.\n\nMarketing Preferences: Email address and communication preferences if you opt in to receive clinic updates or newsletters.`
    },
    {
      title: "3. How We Use Your Information",
      body: `We use your personal information only for the purposes for which it was collected, including:\n\n• Providing, coordinating, and managing your medical care\n• Processing appointment bookings and reminders\n• Billing Alberta Health, WCB, insurance providers, or directly to you\n• Communicating with you about your care, test results, or referrals\n• Complying with legal and regulatory obligations under Alberta law\n• Improving our website and understanding how patients find and use our services\n• Sending marketing communications where you have provided explicit consent\n\nWe do not sell, rent, or trade your personal information to third parties for their marketing purposes.`
    },
    {
      title: "4. Legal Basis for Processing (PIPEDA / PIPA)",
      body: `We collect and process your personal information based on:\n\n• Your express or implied consent at the time of collection\n• Our contractual obligation to provide medical services\n• Legal obligations under the Health Information Act (HIA), PIPA, and PIPEDA\n• Legitimate interests in operating and improving our clinic and website\n\nYou may withdraw consent at any time, subject to legal and contractual restrictions, by contacting our Privacy Officer.`
    },
    {
      title: "5. Disclosure of Your Information",
      body: `We may disclose your personal information to:\n\n• Other healthcare providers involved in your care (with your consent or as permitted by the HIA)\n• Alberta Health Services and the Southside Primary Care Network as required for care coordination\n• WCB Alberta for injury claim processing\n• Third-party service providers who assist us in operating our website and clinic, bound by confidentiality agreements\n• Law enforcement or regulatory bodies where required by law\n• Successor entities in the event of a clinic sale or merger, with continued privacy protections\n\nWe do not disclose health information to employers, insurers, or family members without your explicit written consent, except as required by law.`
    },
    {
      title: "6. Cookies and Website Analytics",
      body: `When you first visit our website, a cookie banner asks you to accept or decline non-essential cookies before anything is set.\n\nMeta Pixel (Facebook Pixel): If you accept, we use Meta Pixel (ID: 1407763097781968) to measure the effectiveness of our advertising and understand how patients interact with our website. This may result in targeted advertising on Facebook and Instagram. You can opt out of Meta's data use at facebook.com/privacy. If you decline, the Meta Pixel does not load.\n\nEssential Cookies: Required for basic website functionality and are not subject to the consent banner.\n\nYou can change your choice at any time using "Cookie preferences" in the website footer, or through your browser's cookie settings.`
    },
    {
      title: "7. Data Retention",
      body: `We retain personal health information for a minimum of 10 years from the date of last treatment, or until a patient reaches the age of 28, whichever is later, as required by the College of Physicians and Surgeons of Alberta (CPSA).\n\nWebsite usage and marketing data is retained for no longer than 26 months unless you request deletion earlier.\n\nYou may request deletion of non-health personal data at any time by contacting our Privacy Officer, subject to our legal retention obligations.`
    },
    {
      title: "8. Security of Your Information",
      body: `We implement appropriate technical and organizational measures to protect your personal information against unauthorized access, disclosure, alteration, or destruction. These include:\n\n• Encrypted transmission of data via HTTPS\n• Access controls limiting staff access to information on a need-to-know basis\n• Secure storage of physical and electronic records\n• Regular staff training on privacy obligations\n\nDespite these measures, no transmission over the internet is completely secure. We cannot guarantee absolute security of information transmitted to our website.`
    },
    {
      title: "9. Your Rights",
      body: `Under PIPEDA and Alberta's PIPA, you have the right to:\n\n• Access your personal information held by us\n• Request correction of inaccurate or incomplete information\n• Withdraw consent to certain uses of your information\n• Request deletion of non-health personal data where legally permissible\n• File a complaint with the Office of the Information and Privacy Commissioner of Alberta (OIPC) at oipc.ab.ca\n\nTo exercise any of these rights, contact our Privacy Officer using the details below.`
    },
    {
      title: "10. Children's Privacy",
      body: `We do not knowingly collect personal information from children under 18 through our website without parental or guardian consent. Parents or guardians managing healthcare for minors may contact us directly to discuss how their child's information is handled.`
    },
    {
      title: "11. Changes to This Policy",
      body: `We may update this Privacy Policy from time to time. Changes will be posted on this page with an updated effective date. Your continued use of our website or services after changes are posted constitutes acceptance of the revised policy. For significant changes affecting your health information, we will notify you directly where possible.`
    },
    {
      title: "12. Contact Our Privacy Officer",
      body: `For questions, concerns, or requests regarding this Privacy Policy or your personal information, please contact:\n\nPrivacy Officer\nTamarack Medical Clinic\n2373 Maple Rd NW, Edmonton, AB T6T 0Y3\nPhone: (780) 244-2873\nEmail: info@tamarackclinic.ca\n\nIf you are not satisfied with our response, you may contact the Office of the Information and Privacy Commissioner of Alberta:\nOIPC Alberta: oipc.ab.ca | 1-888-878-4044`
    },
  ];

  return (
    <div style={{ background: "var(--color-canvas)", minHeight: "100vh" }}>
      {/* Hero */}
      <div style={{ background: "var(--color-navy)", padding: "var(--space-section) var(--space-lg)" }}>
        <div style={{ maxWidth: "var(--container-grid)", margin: "0 auto" }}>
          <p style={{ fontFamily: "var(--font-text)", fontSize: 13, fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", color: "var(--color-green)", marginBottom: 12 }}>Legal</p>
          <h1 style={{ fontFamily: "var(--font-display)", fontSize: "clamp(28px, 5vw, 48px)", fontWeight: 700, letterSpacing: "-0.5px", color: "#fff", margin: "0 0 12px" }}>Privacy Policy</h1>
          <p style={{ fontFamily: "var(--font-text)", fontSize: 16, color: "rgba(255,255,255,0.7)", margin: 0 }}>Last updated: {LAST_UPDATED}</p>
        </div>
      </div>

      {/* Content */}
      <div style={{ maxWidth: 780, margin: "0 auto", padding: "var(--space-section) var(--space-lg)" }}>
        <p style={{ fontFamily: "var(--font-text)", fontSize: 17, lineHeight: 1.7, letterSpacing: "-0.3px", color: "var(--color-ink-muted-80)", marginBottom: "var(--space-xl)", borderLeft: "4px solid var(--color-green)", paddingLeft: 20 }}>
          Your privacy matters to us. This policy explains how Tamarack Medical Clinic collects, uses, and protects your personal information in compliance with Alberta and Canadian law.
        </p>

        {sections.map((s) => (
          <div key={s.title} style={{ marginBottom: "var(--space-xl)" }}>
            <h2 style={{ fontFamily: "var(--font-display)", fontSize: 20, fontWeight: 700, letterSpacing: "-0.3px", color: "var(--color-navy)", marginBottom: 12 }}>{s.title}</h2>
            {s.body.split("\n\n").map((para, i) => (
              <p key={i} style={{ fontFamily: "var(--font-text)", fontSize: 16, lineHeight: 1.75, letterSpacing: "-0.2px", color: "var(--color-ink-muted-80)", marginBottom: 12 }}>{para}</p>
            ))}
            <hr style={{ border: "none", borderTop: "1px solid var(--color-hairline)", marginTop: "var(--space-xl)" }} />
          </div>
        ))}

        {/* Back links */}
        <div style={{ marginTop: "var(--space-section)", display: "flex", gap: 16 }}>
          <TM.Button variant="secondary" onClick={() => onNav && onNav("home")}>← Back to Home</TM.Button>
          <TM.Button variant="secondary" onClick={() => onNav && onNav("terms")}>Terms & Conditions →</TM.Button>
        </div>
      </div>
    </div>
  );
}

Object.assign(window, { PrivacyPolicy });
