/* Aevitan website — Legal pages: Return Policy, Terms & Conditions, Privacy Policy. */
const DSl = window.AevitanDesignSystem_6a042d;
// B39 (a11y): the legal side-nav links get a real root-relative href for keyboard focus + link
// semantics; onClick still drives SPA nav. Uniquely named — Babel scripts share one lexical scope.
const RP_LEGAL = (window.AEV_ROUTES || {}).paths || {};

const LEGAL = {
  returns: {
    kicker: 'Legal',
    title: 'Return Policy',
    updated: 'Version 2026-08-04 · Last updated 4 August 2026',
    intro: 'Aevitan does not sell products. Each order is agreed directly between you and the independent consultant who assists you, and the return terms that govern it are the terms of that consultant and of the manufacturer who supplies the product. This page explains where to look and what Aevitan can and cannot do.',
    sections: [
      ['Who your return is with', 'Your purchase contract is with the consultant who arranged it, not with Aevitan. Returns, replacements, refunds and their deadlines follow the policy of that consultant and the manufacturer whose product you received. Ask your consultant for their return terms before you order; they are required to make them available to you.'],
      ['What Aevitan does', 'Aevitan operates the platform your consultant records the order in. We can show you the order record, the tracking your consultant entered, and the curation report for the product. We do not take payment, hold stock, ship, receive returns, or issue refunds, and we cannot decide a return on your consultant\u2019s behalf.'],
      ['If you cannot reach your consultant', 'Open Support from your member area and tell us what happened. We will contact the consultant and, where a consultant repeatedly fails to honour their own published terms, we may suspend their access to the platform. That is a membership sanction, not a refund: only the consultant or manufacturer can refund you.'],
      ['Sealed products and safety', 'Products supplied through Club consultants are sealed and serialized. Most manufacturers will not accept a return once a tamper-evident seal is broken, for authenticity and safety reasons. Never accept a product whose seal is damaged on arrival \u2014 photograph it and contact your consultant the same day.'],
      ['Authenticity', 'If a unit fails verification on our platform, report it through Support. We investigate the serialization record and share our findings with you, the consultant and the manufacturer. Any replacement or refund that follows is theirs to make.'],
      ['Customs and personal imports', 'Where a product is supplied on a personal-import basis, you are the importer of record. Duties, taxes and any customs outcome are your responsibility and your consultant\u2019s to explain. Items held, returned or destroyed by customs are handled under your consultant\u2019s terms.'],
    ],
  },
  terms: {
    kicker: 'Legal',
    title: 'Terms & Conditions',
    updated: 'Version 2026-08-04 · Last updated 4 August 2026',
    intro: 'Aevitan operates the Longevity Club: a members\u2019 space for scientific curation, and the software independent consultants use to record their own client relationships. Aevitan does not sell products, does not take payment for products, and is not a party to any purchase you make. This is a plain-language summary; the full Terms & Conditions govern.',
    sections: [
      ['What Aevitan is \u2014 and is not', 'Aevitan is a technology and curation company. It publishes the scientific board\u2019s evaluation of products, hosts the Longevity Club and its member directory, and licenses order-management software to independent consultants. Aevitan is not a manufacturer, pharmacy, clinic, distributor or healthcare provider. It does not prescribe, does not practise medicine, does not sell or ship products, and does not process payment for products.'],
      ['Your purchase is with the consultant', 'When you send a wishlist, it goes to the independent consultant assigned to you. Any sale that follows is agreed between you and that consultant, on their terms and the terms of the manufacturer they represent, outside this platform. The consultant is not an employee, agent or representative of Aevitan and cannot bind Aevitan to anything. Prices, availability, delivery, returns and refunds are theirs to set and honour.'],
      ['Curation, not advice', 'The scientific board\u2019s curation is scientific and educational information. It is not medical, diagnostic or treatment advice, not a recommendation to acquire or use any product, and not a substitute for a licensed professional. Nothing published here claims that a product diagnoses, treats, cures or prevents any disease. Always consult a qualified professional before use.'],
      ['Package inserts and certificates', 'Package inserts shown in the platform are transcribed by Aevitan from documents the manufacturer supplies, and are labelled as such. Certificates of analysis are issued by independent laboratories. Aevitan does not author, originate or independently verify either; the manufacturer remains responsible for its own product information.'],
      ['Curation report access', 'The basic curation opinion is available to every member. The professional curation report opens when your consultant confirms a paid order, and stays open while your Club standing holds. Access can lapse: standing is derived from recorded activity over a rolling period, and a returned order withdraws the report that order opened. Reports are read on screen and are not downloadable.'],
      ['Club standing', 'Club standing reflects sustained activity within the Longevity Club. It is recalculated continuously and may rise or fall. Standing may qualify you for preferential pricing with participating consultants; whether a given consultant honours it is between you and that consultant.'],
      ['Membership and your declarations', 'Longevity Club membership is open to eligible individuals, health professionals, clinics and resellers. You provide your own profile information and, where applicable, a separate self-declaration about your role or purchase purpose. Aevitan records that declaration but does not verify or approve professional or business status. You remain responsible for the accuracy of your account and for compliance with the laws applicable to your activities. Aevitan may refuse, suspend or cancel access for false information or compliance risk.'],
      ['Verification and serialization', 'Units supplied through Club consultants are serialized and traceable; verification confirms authenticity only. Misuse of serials or verification data is prohibited.'],
      ['Limits of Aevitan\u2019s responsibility', 'Aevitan is responsible for operating the platform and for the curation content it publishes under its own name. It is not responsible for the acts or omissions of consultants, manufacturers or other members, for the information a consultant enters into the platform, for the products themselves, or for the performance of any purchase agreed outside it. The platform, services and curated content are provided \u201cas is\u201d, without warranties. To the fullest extent permitted by law Aevitan is not liable for indirect or consequential damages, or for health outcomes, regulatory action or customs seizure. Rights that cannot be waived under applicable law are unaffected.'],
      ['Governing law', 'Aevitan is a United States company. The platform, these terms and your relationship with Aevitan are governed by the laws of the United States, regardless of your country of residence. This does not relieve you of responsibility for your own country\u2019s import and possession rules.'],
      ['Changes', 'We may update these terms; material changes are noted here and ask for renewed acceptance. Continued use after a non-material change constitutes acceptance.'],
    ],
  },
  privacy: {
    kicker: 'Legal',
    title: 'Privacy Policy',
    updated: 'Version 2026-08-04 · Last updated 4 August 2026',
    intro: 'Aevitan is a U.S. company. We collect the minimum data needed to operate your membership, publish curation, and pass your own requests to the consultant you chose, and we process it under U.S. law. We do not sell your personal data.',
    sections: [
      ['What we collect', 'Account and self-declared profile details (such as name, member type, business information and professional registration information), contact information, the version and time of declarations you accept, the products you add to your wishlist, order records your consultant enters, curation reports you open, and product-verification activity (serials checked, timestamps and approximate location for clone detection).'],
      ['How we use it', 'To operate your membership, record your declarations, pass your wishlist to the consultant assigned to you, determine which curation reports you may open, operate the authenticity and serialization platform, and meet legal obligations. Aevitan does not use your profile declarations to approve or certify your professional or business status.'],
      ['We do not sell your data', 'We never sell personal data, and we do not pass your identity or your wishlist to manufacturers or to any consultant other than the one you are assigned to. When you send a wishlist, you are directing us to share it with that consultant \u2014 that disclosure happens because you asked for it, and you can ask us to stop at any time through Support.'],
      ['Health-related information', 'The products you add to your wishlist can reveal health-related interests. We treat that as sensitive: it is visible to you, to the consultant you send it to, and to Aevitan staff who operate the platform. It is not used for advertising, not shared with third parties for their own purposes, and not sold.'],
      ['Sensitive documents', 'Documents requested for a specific product, destination or import (such as prescriptions or medical reports) are used only for that purpose, shared only with the parties needed to complete it, and retained only as long as required for compliance.'],
      ['Sharing', 'We share data only with processors that help us operate (such as hosting, email and storage providers), with the consultant you have been assigned to when you direct us to, and with authorities where legally required.'],
      ['Your rights and contact', 'You may request access, correction or deletion of your personal data, subject to records we must retain for legal and safety reasons. To exercise these rights, sign in and open Support, choosing Privacy as the reason.'],
      ['Security', 'Data is encrypted in transit and at rest, with access restricted to staff who need it. No system is perfectly secure; report concerns from your member area under Support, choosing Security as the reason.'],
    ],
  },
};

function Legal({ page, go }) {
  const { Kicker } = DSl;
  const data = LEGAL[page] || LEGAL.terms;
  return (
    <section className="aevsite-band aevsite-band--top">
      <div className="aevsite-wrap aevsite-reveal aevsite-legal">
        <Kicker>{data.kicker}</Kicker>
        <h1 className="aevsite-h2 big">{data.title}</h1>
        <div className="aevsite-legal__meta">{data.updated}</div>
        <p className="aevsite-legal__intro">{data.intro}</p>
        <div className="aevsite-legal__body">
          {data.sections.map(([h, p], i) => (
            <div key={i} className="aevsite-legal__sec">
              <h2 className="aevsite-legal__h">{h}</h2>
              <p>{p}</p>
            </div>
          ))}
        </div>
        <div className="aevsite-legal__nav">
          <a className={page === 'returns' ? 'on' : ''} href={RP_LEGAL.returns} onClick={(e) => { e.preventDefault(); go('returns'); }}>Return Policy</a>
          <a className={page === 'terms' ? 'on' : ''} href={RP_LEGAL.terms} onClick={(e) => { e.preventDefault(); go('terms'); }}>Terms &amp; Conditions</a>
          <a className={page === 'privacy' ? 'on' : ''} href={RP_LEGAL.privacy} onClick={(e) => { e.preventDefault(); go('privacy'); }}>Privacy Policy</a>
        </div>
        <p className="aevsite-legal__fine">This is a plain-language summary, not legal advice; the full Terms &amp; Conditions apply. Aevitan is a U.S. company and these terms are governed by U.S. law.</p>
      </div>
    </section>
  );
}

window.Legal = Legal;
