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 PrivacyPolicy() {
  return (
    <main className='prose prose-slate mx-auto max-w-none'>
      <Head>
        <title>{getPageTitle('Privacy Notice')}</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>Privacy Notice</h1>
            <p><strong>Version:</strong> {policyVersion}. This draft must be completed by the workspace owner and reviewed by counsel before production publication.</p>

            <h2>1. Who controls the data</h2>
            <p>The coaching practice operating this deployment determines why and how client data is used. AppWizzy and configured infrastructure or AI providers may process data only to provide the workspace under their applicable agreements.</p>

            <h2>2. Data used by the workspace</h2>
            <p>The workspace may hold account and contact details, intake answers, goals, session dates, manual notes, transcripts or audio when separately authorized, AI-assisted drafts, commitments, reflections, resources, and limited security/audit metadata. It does not require payment-card or demographic data unless the workspace owner separately adds those features.</p>

            <h2>3. Purposes and sharing</h2>
            <p>Data is used to operate the coaching relationship, authenticate users, protect the service, produce coach-requested drafts, and deliver coach-approved material to the correct client. Coaching content is not sold, published, used for advertising, or used for model training by this application. The production owner must list every actual hosting, email, storage, monitoring, and AI subprocessor, including region and transfer mechanism.</p>

            <h2>4. Recording and AI processing</h2>
            <p>Recording consent and AI-processing consent are stored separately. Recording, upload, transcription, and AI generation are blocked when the required authorization is absent or withdrawn. A coach may continue with permitted manual notes. Contact the workspace owner to withdraw consent or request deletion.</p>

            <h2>5. Visibility</h2>
            <p>Private coach notes, raw transcripts, audio, emotional-theme analysis, and internal AI annotations are private by default. A client portal shows only material the coach explicitly approves for that client.</p>

            <h2>6. Retention and deletion</h2>
            <p>The production owner must publish configured retention periods for raw audio, transcripts, generated memory, private notes, shared notes, audit metadata, and backups. Authorized users may request access, correction, export, restriction, or deletion where applicable. Deleted active files must become inaccessible immediately; backup expiry follows the documented infrastructure schedule.</p>

            <h2>7. Security and incidents</h2>
            <p>Access controls and deployment isolation are used to limit data access. No absolute security guarantee is made. The production owner must publish an incident and privacy contact before accepting real client data.</p>

            <h2>8. Contact</h2>
            <p>The workspace owner must replace this paragraph with its legal entity, privacy email, postal address, launch jurisdictions, and effective date before production publication.</p>
          </div>
        </div>
      </div>
    </main>
  );
}

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