/* global React */

const LEGAL_UPDATED = '2 September 2026';

function LegalPageLayout({ locator, title, intro, children }) {
  return (
    <div className="page-enter legal-page" data-screen-label="Legal">
      <header className="legal-header">
        <div className="container legal-header-inner">
          <span className="label page-locator">IDELIGO · Legal</span>
          <h1 className="display-1" dangerouslySetInnerHTML={{ __html: title }} />
          <p className="legal-intro">{intro}</p>
          <p className="legal-meta">{locator} · Last updated {LEGAL_UPDATED}</p>
        </div>
      </header>

      <div className="section legal-content-section">
        <div className="container legal-content">
          <aside className="legal-review-note" aria-label="Draft status">
            <strong>First draft for review.</strong> Confirm the contracting legal entity, business identifiers and actual information-handling practices with an Australian legal adviser before production publication.
          </aside>
          {children}
        </div>
      </div>
    </div>
  );
}

function PrivacyPage() {
  return (
    <LegalPageLayout
      locator="Privacy policy"
      title={'Privacy <em>policy.</em>'}
      intro="This policy explains how IDELIGO handles personal information received through this website and related enquiries."
    >
      <section>
        <h2>Our approach</h2>
        <p>
          IDELIGO respects privacy and aims to handle personal information openly, carefully and only for legitimate business purposes. Where Australian privacy laws apply, we manage personal information in accordance with those requirements.
        </p>
      </section>

      <section>
        <h2>Information we may collect</h2>
        <p>Depending on how you interact with us, we may collect:</p>
        <ul>
          <li>your name, organisation, email address and enquiry topic;</li>
          <li>the information you choose to include in an enquiry or subsequent correspondence;</li>
          <li>professional contact information made available through direct conversations or professional platforms; and</li>
          <li>standard technical information processed to deliver and secure the website, such as an IP address, browser type, requested page, date and time.</li>
        </ul>
        <p>Please do not send sensitive information through the website unless we have agreed that it is necessary and appropriate.</p>
      </section>

      <section>
        <h2>How information is collected</h2>
        <p>
          Information is collected when you contact us by email, use the website enquiry form, communicate through a professional platform or otherwise provide it directly. The current enquiry form prepares an email in your own email application; it does not submit the form to a separate IDELIGO database.
        </p>
        <p>
          Website hosting, content delivery and security providers may also process limited technical information when you visit the site.
        </p>
      </section>

      <section>
        <h2>How we use information</h2>
        <p>We may use personal information to:</p>
        <ul>
          <li>respond to enquiries and decide whether we may be able to assist;</li>
          <li>discuss, establish and manage professional engagements or relationships;</li>
          <li>operate, protect and improve the website and our business systems;</li>
          <li>maintain appropriate business, legal and financial records; and</li>
          <li>meet legal, regulatory and professional obligations.</li>
        </ul>
      </section>

      <section>
        <h2>Disclosure and service providers</h2>
        <p>
          We do not sell personal information. We may disclose limited information to trusted providers that support website hosting, email, information technology and professional services, or where disclosure is required or authorised by law. Providers are given only the information reasonably needed for their function.
        </p>
        <p>
          Some providers may process information outside Australia. Where applicable, we take reasonable steps to select reputable providers and address relevant privacy obligations.
        </p>
      </section>

      <section>
        <h2>Cookies and external resources</h2>
        <p>
          The current website does not use advertising cookies or behavioural advertising. It loads limited third-party technical resources, including web fonts and application libraries, whose providers may receive standard request information. If analytics or materially different tracking is introduced, this policy will be updated.
        </p>
      </section>

      <section>
        <h2>Storage, security and retention</h2>
        <p>
          We use reasonable administrative and technical measures to protect information from misuse, interference, loss and unauthorised access, modification or disclosure. No internet transmission or storage system can be guaranteed completely secure.
        </p>
        <p>
          Information is retained only for as long as reasonably needed for the purpose for which it was collected, for legitimate business records, or to meet legal and professional obligations.
        </p>
      </section>

      <section>
        <h2>Access, correction and concerns</h2>
        <p>
          You may ask to access or correct personal information we hold about you, or raise a privacy concern. We will respond within a reasonable period and may need to verify your identity. Some legal exceptions may apply.
        </p>
        <p>
          Contact <a href="mailto:office@ideligoconsulting.com">office@ideligoconsulting.com</a>. If a concern is not resolved, you may be entitled to contact the Office of the Australian Information Commissioner.
        </p>
      </section>

      <section>
        <h2>Changes to this policy</h2>
        <p>
          We may update this policy when our services, website practices or legal obligations change. The current version and its last-updated date will remain available on this page.
        </p>
      </section>
    </LegalPageLayout>
  );
}

function TermsPage({ go }) {
  return (
    <LegalPageLayout
      locator="Terms of use"
      title={'Terms of <em>use.</em>'}
      intro="These terms govern access to and use of the IDELIGO website and its public content."
    >
      <section>
        <h2>Using this website</h2>
        <p>
          By accessing this website, you agree to use it lawfully and in accordance with these terms. If you do not agree, please do not use the website.
        </p>
      </section>

      <section>
        <h2>General information only</h2>
        <p>
          Website content is provided for general information and professional discussion. It does not constitute legal, financial, technical or other professional advice, and should not be relied on as a substitute for advice tailored to your circumstances.
        </p>
        <p>
          An enquiry, email exchange or use of this website does not create a client, advisory, fiduciary or other professional relationship. Any engagement is established only through a separate written agreement.
        </p>
      </section>

      <section>
        <h2>Engagements and proposals</h2>
        <p>
          The scope, deliverables, responsibilities, fees, confidentiality and other terms of any IDELIGO engagement are governed by the applicable proposal, statement of work or services agreement, not by this website.
        </p>
      </section>

      <section>
        <h2>Intellectual property</h2>
        <p>
          Unless otherwise stated, IDELIGO owns or licenses the website design, text, diagrams, frameworks, graphics, branding and other content. You may view and print reasonable extracts for personal use or internal business evaluation.
        </p>
        <p>
          You must not reproduce, adapt, publish, distribute, commercialise or present website content as your own without prior written permission, except where permitted by law. IDELIGO names, marks and visual identity may not be used without permission.
        </p>
      </section>

      <section>
        <h2>Accuracy and availability</h2>
        <p>
          We aim to keep the website useful and current, but do not warrant that all content is complete, accurate, suitable for a particular purpose or continuously available. Content and availability may change without notice.
        </p>
      </section>

      <section>
        <h2>External links</h2>
        <p>
          Links to third-party websites or platforms are provided for convenience. IDELIGO does not control and is not responsible for their content, availability, security or privacy practices. A link does not necessarily imply endorsement.
        </p>
      </section>

      <section>
        <h2>Acceptable use</h2>
        <p>You must not:</p>
        <ul>
          <li>use the website for unlawful, misleading or harmful activity;</li>
          <li>attempt to interfere with, damage or gain unauthorised access to the website or related systems;</li>
          <li>introduce malicious code or use automated means that place an unreasonable load on the site; or</li>
          <li>misrepresent your affiliation with IDELIGO or your authority to use its content.</li>
        </ul>
      </section>

      <section>
        <h2>Liability</h2>
        <p>
          To the extent permitted by law, IDELIGO is not liable for loss arising from reliance on general website content, inability to access the site, or use of third-party links. Nothing in these terms excludes, restricts or modifies rights or remedies that cannot lawfully be excluded, including applicable rights under the Australian Consumer Law.
        </p>
      </section>

      <section>
        <h2>Privacy</h2>
        <p>
          Personal information is handled as described in the <a href="/privacy" onClick={(event) => { event.preventDefault(); go('/privacy'); }}>Privacy policy</a>. Please review that policy before sending personal information.
        </p>
      </section>

      <section>
        <h2>Governing law and changes</h2>
        <p>
          These terms are governed by the laws of Victoria, Australia. We may update them when the website, our practices or relevant laws change. The current version and last-updated date will remain available here.
        </p>
      </section>

      <section>
        <h2>Contact</h2>
        <p>Questions about these terms may be sent to <a href="mailto:office@ideligoconsulting.com">office@ideligoconsulting.com</a>.</p>
      </section>
    </LegalPageLayout>
  );
}

Object.assign(window, { PrivacyPage, TermsPage });
