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

  const sections = [
    {
      title: "1. Acceptance of Terms",
      body: `By accessing and using the Tamarack Medical Clinic website (tamarackclinic.ca), you accept and agree to be bound by these Terms and Conditions and our Privacy Policy. If you do not agree to these terms, please do not use this website. These terms apply to all visitors, patients, and others who access or use the website.`
    },
    {
      title: "2. About Tamarack Medical Clinic",
      body: `Tamarack Medical Clinic is a physician-owned and operated family medicine practice located at 2373 Maple Rd NW, Edmonton, Alberta, T6T 0Y3. The clinic is affiliated with the Southside Primary Care Network and provides medical services covered by Alberta Health, as well as private medical care, refugee health services, and WCB injury care.`
    },
    {
      title: "3. Not Medical Advice",
      body: `The information provided on this website is for general informational purposes only and does not constitute professional medical advice, diagnosis, or treatment. Always seek the advice of your physician or other qualified health provider with any questions you may have regarding a medical condition. Never disregard professional medical advice or delay in seeking it because of something you have read on this website.\n\nIn case of a medical emergency, call 911 or go to your nearest emergency room immediately.`
    },
    {
      title: "4. Appointment Booking",
      body: `Booking an appointment through this website does not constitute a confirmed appointment until you receive direct confirmation from the clinic. Appointment requests are subject to availability. Tamarack Medical Clinic reserves the right to cancel or reschedule appointments with reasonable notice.\n\nNew patients are accepted subject to physician availability. The clinic reserves the right to decline appointment requests at its discretion.`
    },
    {
      title: "5. Intellectual Property",
      body: `All content on this website, including but not limited to text, graphics, logos, images, and software, is the property of Tamarack Medical Clinic or its content suppliers and is protected by applicable Canadian intellectual property laws. You may not reproduce, distribute, or create derivative works from any content on this site without express written permission.`
    },
    {
      title: "6. Limitation of Liability",
      body: `To the fullest extent permitted by applicable law, Tamarack Medical Clinic shall not be liable for any indirect, incidental, special, consequential, or punitive damages arising from your use of, or inability to use, this website or its content. The clinic's total liability for any claim arising from use of this website shall not exceed the amount paid by you to the clinic in the twelve months preceding the claim.`
    },
    {
      title: "7. Third-Party Links",
      body: `This website may contain links to third-party websites for your convenience. Tamarack Medical Clinic does not endorse, control, or assume responsibility for the content or privacy practices of any third-party sites. We encourage you to review the terms and privacy policies of any third-party sites you visit.`
    },
    {
      title: "8. Website Availability",
      body: `Tamarack Medical Clinic makes no warranty that this website will be available at all times or that access will be uninterrupted. We reserve the right to modify, suspend, or discontinue any aspect of the website at any time without notice.`
    },
    {
      title: "9. Governing Law",
      body: `These Terms and Conditions are governed by and construed in accordance with the laws of the Province of Alberta and the federal laws of Canada applicable therein. Any disputes arising from these terms shall be subject to the exclusive jurisdiction of the courts of Alberta.`
    },
    {
      title: "10. Changes to These Terms",
      body: `Tamarack Medical Clinic reserves the right to update these Terms and Conditions at any time. Changes will be posted on this page with an updated effective date. Your continued use of the website after any changes constitutes your acceptance of the revised terms.`
    },
    {
      title: "11. Contact Us",
      body: `If you have questions about these Terms and Conditions, please contact us:\n\nTamarack Medical Clinic\n2373 Maple Rd NW, Edmonton, AB T6T 0Y3\nPhone: (780) 244-2873\nEmail: info@tamarackclinic.ca`
    },
  ];

  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" }}>Terms & Conditions</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 }}>
          Please read these Terms and Conditions carefully before using the Tamarack Medical Clinic website.
        </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 to home */}
        <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("privacy")}>Privacy Policy →</TM.Button>
        </div>
      </div>
    </div>
  );
}

Object.assign(window, { TermsAndConditions });
