import type { ReactElement } from 'react';
import Head from 'next/head';
import LayoutGuest from '../layouts/Guest';
import { getPageTitle } from '../config';

const policyVersion = '2026-07-22-draft';

export default function TermsOfUse() {
  return (
    <main className='prose prose-slate mx-auto max-w-none'>
      <Head>
        <title>{getPageTitle('Terms of Use')}</title>
      </Head>
      <div className='flex justify-center'>
        <div className='z-10 my-4 rounded border border-pavitra-400 bg-white md:w-10/12'>
          <div className='p-8 lg:px-12 lg:py-10'>
            <h1>Terms of Use</h1>
            <p><strong>Version:</strong> {policyVersion}. This draft must be reviewed by counsel and configured for the workspace owner before production publication.</p>

            <h2>1. The service</h2>
            <p>This workspace helps a coaching practice manage intake, client records, session material, coach-reviewed follow-up, commitments, resources, and a client portal. It is not a medical, therapy, emergency, legal, or financial service.</p>

            <h2>2. Confidential content and limited license</h2>
            <p>You retain ownership of content you provide. You grant the workspace operator and its contracted service providers only the limited, non-exclusive, revocable rights needed to host, process, back up, secure, and deliver that content at your direction. This permission does not allow unrelated publication, sale, advertising use, or model training.</p>

            <h2>3. Coach responsibility</h2>
            <p>The coach or practice controls the client relationship and decides what information may be collected, processed, retained, or shared. AI output is a private draft until a coach reviews and explicitly approves it. The coach is responsible for obtaining any consent required for recording or AI-assisted processing.</p>

            <h2>4. Acceptable use</h2>
            <p>Do not use the workspace unlawfully, attempt unauthorized access, upload malicious files, impersonate another person, or use the service for emergency or clinical care.</p>

            <h2>5. Access and deletion</h2>
            <p>Access may be suspended to protect the service or other users. Data access, correction, export, and deletion requests are handled according to the Privacy Notice and applicable law.</p>

            <h2>6. Availability</h2>
            <p>The service may change or be temporarily unavailable. No provision limits rights or remedies that cannot lawfully be limited.</p>

            <h2>7. Contact and governing terms</h2>
            <p>The production workspace owner must publish its legal name, contact address, governing law, and dispute terms here before accepting real client data.</p>
          </div>
        </div>
      </div>
    </main>
  );
}

TermsOfUse.getLayout = function getLayout(page: ReactElement) {
  return <LayoutGuest>{page}</LayoutGuest>;
};
