// Privacy / Terms / Refund — long-form documents
// Legal documents are English-only. The website navigation can be EN/zh/ja
// but the binding text of these policies is the English version.

const Privacy = ({ lang }) => {
  return (
    <div className="doc">
      <div className="doc-eyebrow">Legal</div>
      <h1>Privacy Policy</h1>
      <div className="updated">Last updated: April 27, 2026</div>

      <p>This Privacy Policy describes how <strong>Parleur</strong> ("we", "us") handles personal data when you use the Parleur macOS application and the parleur.app website (collectively, the "Service").</p>
      <h2>1. Who we are</h2>
      <p>Parleur is an independent product based in Taiwan. You can reach us at <a href="mailto:support@parleur.app">support@parleur.app</a>.</p>
      <h2>2. What we collect</h2>
      <ul>
        <li><strong>Apple Sign-In identifier</strong> — a unique, opaque user ID issued by Apple when you sign in. We do not receive your email unless you choose to share it.</li>
        <li><strong>Subscription status</strong> — whether you have an active trial or paid subscription, and your billing tier.</li>
        <li><strong>Translation request metadata</strong> — timestamp, source/target language pair, model used, token counts, and approximate device locale. This is used for billing reconciliation and abuse detection. <strong>We do not store the source text or translated output.</strong></li>
        <li><strong>Crash and diagnostic logs</strong> — opt-in only. If you enable crash reports, we receive macOS-supplied stack traces with no document content attached.</li>
      </ul>
      <h2>3. What we do not collect</h2>
      <ul>
        <li>Your translated text or its source — these are forwarded to the LLM provider and discarded.</li>
        <li>Your contacts, browsing history, clipboard contents outside of an active translation request, or any text you type that you have not asked Parleur to translate.</li>
        <li>Marketing identifiers, ad IDs, fingerprints, or third-party trackers. The website uses Cloudflare Web Analytics, which is cookie-less.</li>
      </ul>
      <h2>4. Sub-processors</h2>
      <p>To deliver the Service, we share necessary data with the following sub-processors:</p>
      <ul>
        <li><strong>Apple Inc.</strong> — Sign in with Apple, App Store distribution.</li>
        <li><strong>OpenAI, OpenAI Ireland Ltd.</strong> — translation model provider. Requests are sent under our zero-retention agreement.</li>
        <li><strong>Anthropic PBC</strong> — translation model provider. Requests are sent under our zero-retention agreement.</li>
        <li><strong>Google LLC (Gemini API)</strong> — translation model provider. Requests are sent under our zero-retention agreement.</li>
        <li><strong>Fly.io</strong> — backend hosting (US, Tokyo regions).</li>
        <li><strong>Neon</strong> — managed Postgres for account and billing records.</li>
        <li><strong>Paddle.com Market Ltd.</strong> — Merchant of Record for subscription billing, invoicing, and tax handling.</li>
      </ul>
      <h2>5. How we use your data</h2>
      <p>We use the data we collect to operate the Service, authenticate you, deliver translations, bill you correctly, prevent abuse, and respond to support requests. We do not use your data to train models, build advertising profiles, or sell to third parties.</p>
      <h2>6. Data retention</h2>
      <p>Account records are retained for as long as your account is active. Billing records are retained for seven (7) years per applicable tax law. Translation request metadata (without content) is retained for 90 days, then aggregated and anonymized. You can request deletion of your account at any time.</p>
      <h2>7. Your rights</h2>
      <p>You may, at any time, request access to, correction of, or deletion of your personal data, or export of all data associated with your account. Contact <a href="mailto:support@parleur.app">support@parleur.app</a>. We respond within 30 days.</p>
      <h2>8. Security</h2>
      <p>All traffic is encrypted in transit (TLS 1.3). Database backups are encrypted at rest. Translation content is held in memory only for the duration of a request.</p>
      <h2>9. Children</h2>
      <p>Parleur is not directed at children under 13, and we do not knowingly collect data from children.</p>
      <h2>10. Changes to this policy</h2>
      <p>We may update this Privacy Policy from time to time. Material changes will be announced in-app and at parleur.app. The "Last updated" date above reflects the most recent revision.</p>
      <h2>11. Contact</h2>
      <p>Questions, requests, or privacy complaints: <a href="mailto:support@parleur.app">support@parleur.app</a>.</p>
    </div>
  );
};

const Terms = ({ lang }) => {
  return (
    <div className="doc">
      <div className="doc-eyebrow">Legal</div>
      <h1>Terms of Service</h1>
      <div className="updated">Last updated: April 27, 2026</div>

      <p>These Terms of Service ("Terms") govern your access to and use of the Parleur macOS application and parleur.app website (the "Service") provided by Parleur ("we", "us").</p>
      <h2>1. Acceptance of terms</h2>
      <p>By creating an account, downloading the application, or otherwise using the Service, you agree to be bound by these Terms. If you do not agree, do not use the Service.</p>
      <h2>2. Description of service</h2>
      <p>Parleur is a macOS application that translates text shown on your screen and rewrites text you are composing, using third-party large language models routed through our backend. Translations are produced by AI and may contain errors; you are responsible for reviewing important communications.</p>
      <h2>3. Account registration</h2>
      <p>Accounts are created via Sign in with Apple. You are responsible for maintaining the confidentiality of your Apple ID and for all activity under your account. You must be at least 13 years old (or the age of digital consent in your jurisdiction).</p>
      <h2>4. Subscriptions, billing, auto-renewal</h2>
      <p>Paid plans are billed monthly or annually in advance via Paddle, our Merchant of Record. Subscriptions auto-renew at the then-current price unless cancelled before the renewal date. Applicable taxes are added at checkout.</p>
      <h2>5. Free trial</h2>
      <p>New accounts are eligible for a 7-day free trial with full feature access. Daily translation limits apply during trial. The trial does not auto-convert; you must explicitly subscribe to continue after it ends.</p>
      <h2>6. Cancellation and refunds</h2>
      <p>You may cancel anytime from your account settings; access continues until the end of the paid period. Refund eligibility is described in the <a href="#/refund">Refund Policy</a>.</p>
      <h2>7. Acceptable use</h2>
      <p>You agree not to: (a) use the Service for bulk machine translation pipelines or to resell translation API access; (b) attempt to extract underlying model weights or system prompts; (c) use the Service to translate content that is illegal where you reside; (d) circumvent rate limits or use multiple accounts to evade fair-use caps; (e) use the Service in any way that violates Apple's, OpenAI's, Anthropic's, or Google's acceptable use policies.</p>
      <h2>8. Intellectual property</h2>
      <p>The Parleur application, website, branding, and source code are the property of Parleur. We grant you a personal, non-transferable, revocable license to use the Service for your own purposes.</p>
      <h2>9. User content</h2>
      <p>You retain all rights to text you translate. We do not claim any ownership of your input or output. You grant us a transient, in-memory license to process your text solely to deliver translations.</p>
      <h2>10. Disclaimers and limitation of liability</h2>
      <p>The Service is provided "as is", without warranties of any kind. To the fullest extent permitted by law, our aggregate liability for any claim arising from your use of the Service is limited to the amount you paid us in the 12 months prior to the claim.</p>
      <h2>11. Termination</h2>
      <p>We may suspend or terminate your account if you breach these Terms or use the Service abusively. You may close your account at any time. Refunds for prepaid periods follow the Refund Policy.</p>
      <h2>12. Governing law</h2>
      <p>These Terms are governed by the laws of Taiwan, R.O.C., without regard to conflict-of-law principles. Disputes will be resolved in the Taipei District Court.</p>
      <h2>13. Changes to terms</h2>
      <p>We may revise these Terms. We will notify subscribers of material changes at least 14 days before they take effect. Continued use after the effective date constitutes acceptance.</p>
      <h2>14. Contact</h2>
      <p>Questions: <a href="mailto:support@parleur.app">support@parleur.app</a>.</p>
    </div>
  );
};

const Refund = ({ lang }) => {
  return (
    <div className="doc">
      <div className="doc-eyebrow">Legal</div>
      <h1>Refund Policy</h1>
      <div className="updated">Last updated: April 27, 2026</div>

      <p>We want Parleur to feel like the right tool for you. If it doesn't, you should be able to get your money back without arguing about it. This policy describes when and how.</p>
      <h2>1. 14-day unconditional refund (new subscribers)</h2>
      <p>If you are subscribing to Parleur for the first time, you may request a full refund within <strong>14 days</strong> of your initial payment, for any reason — no questions asked.</p>
      <h2>2. Annual plans (after the 14-day window)</h2>
      <p>If you cancel an annual subscription after the 14-day window, we offer a <strong>pro-rated refund</strong> for unused months, less any monthly-equivalent rate already consumed. Example: 4 months into a $129/year plan, the refund is $129 − (4 × $12.99) = $77.04.</p>
      <h2>3. Monthly plans (after the 14-day window)</h2>
      <p>Monthly plans cancelled after the 14-day window are not refunded for the current period; access continues until the end of the paid period and does not auto-renew.</p>
      <h2>4. Refund method</h2>
      <p>Refunds are issued to the original payment method through Paddle, our Merchant of Record. Bank-side processing typically takes 3–10 business days.</p>
      <h2>5. How to request a refund</h2>
      <p>Refunds are handled by <strong>Paddle</strong>, our payment processor and Merchant of Record. The fastest way is the receipt:</p>
      <ul>
        <li>Open the email receipt Paddle sent when you subscribed.</li>
        <li>Click <em>“Manage subscription”</em> → <em>“Request a refund”</em>.</li>
        <li>Paddle approves eligible requests automatically and refunds your original payment method.</li>
      </ul>
      <p>If you can’t find your receipt or your case isn’t straightforward (pro-rated annual refunds, billing errors, anything we should know), email <a href="mailto:support@parleur.app">support@parleur.app</a> from the address tied to your subscription. We respond within 2 business days.</p>
      <h2>6. Cases where refunds are not granted</h2>
      <ul>
        <li>Repeated subscribe-then-refund patterns we judge to be abuse.</li>
        <li>Accounts terminated for breach of the <a href="#/terms">Terms of Service</a>.</li>
        <li>Charges older than the periods described in sections 1–3.</li>
      </ul>
      <h2>7. Statutory rights</h2>
      <p>Nothing in this policy limits your statutory consumer rights under applicable law (including, where relevant, EU/UK distance-selling rules). Where statutory rights exceed what we offer here, the statutory rights apply.</p>
    </div>
  );
};

window.Privacy = Privacy;
window.Terms = Terms;
window.Refund = Refund;
