<?php
require __DIR__ . '/../includes/config.php';
$page_title = ($LOCALE === 'de' ? 'Datenschutzerklärung' : 'Privacy Policy') . ' — ' . SITE_NAME;
include __DIR__ . '/../includes/head.php';
include __DIR__ . '/../includes/header.php';
?>

<div class="container legal">
<?php if ($LOCALE === 'de'): ?>
  <h1>Datenschutzerklärung</h1>

  <div class="legal-note">
    <strong>Hinweis (vor Veröffentlichung entfernen):</strong>
    Diese Vorlage deckt häufige DSGVO-Pflichtangaben ab. Verantwortlicher-Daten werden aus
    <code>includes/config.php</code> &rarr; <code>OPERATOR</code> gelesen. Auftragsverarbeiter,
    Speicherfristen und Cookie-Verwendung müssen vor dem Live-Gang von einem Anwalt geprüft
    werden.
  </div>

  <h2>1. Verantwortlicher</h2>
  <p>
    <?= operatorAddressHtml() ?><br>
    E-Mail: <a href="mailto:<?= h(PRIVACY_EMAIL) ?>"><?= h(PRIVACY_EMAIL) ?></a>
  </p>

  <h2>2. Server-Logfiles</h2>
  <p>
    Beim Aufruf werden technische Daten (anonymisierte IP, Datum/Uhrzeit, URL,
    Browser-Typ) für maximal 30 Tage gespeichert (Art.&nbsp;6 Abs.&nbsp;1 lit.&nbsp;f DSGVO).
  </p>

  <h2>3. Kontaktformular</h2>
  <p>
    Daten aus dem Kontaktformular (Name, E-Mail, Betreff, Nachricht, IP, Zeitpunkt) werden
    zur Bearbeitung der Anfrage gespeichert (Art.&nbsp;6 Abs.&nbsp;1 lit.&nbsp;b/f DSGVO).
    Spam-Schutz erfolgt über ein Honeypot-Feld und eine zeitbasierte Plausibilitätsprüfung;
    keine Drittanbieter wie reCAPTCHA.
  </p>

  <h2>4. Auftragsverarbeiter</h2>
  <p>Wir setzen für den Betrieb der SaaS-Anwendung folgende Auftragsverarbeiter ein:</p>
  <ul>
    <li><strong>Stripe Payments Europe Ltd.</strong> (Zahlungsabwicklung), Irland; EU-Standardvertragsklauseln.</li>
    <li><strong>OpenAI Ireland Ltd.</strong> (KI-Funktionen) — verarbeitet pseudonymisierte Trade-Statistiken; im Privacy-Modus werden $-Beträge entfernt. EU-Standardvertragsklauseln + EU-US Data Privacy Framework.</li>
    <li><strong>Resend, Inc.</strong> (transaktionale E-Mails), USA; EU-Standardvertragsklauseln + EU-US DPF.</li>
    <li><strong>Databento, Inc.</strong> (historische Marktdaten) — keine personenbezogenen Daten.</li>
    <li><strong>[Hosting-Anbieter]</strong> — Sitz EU; Auftragsverarbeitungsvertrag (AVV).</li>
  </ul>

  <h2>5. Cookies</h2>
  <p>
    Diese Marketing-Website (<?= h(SITE_URL) ?>) setzt keine Cookies und kein Tracking
    ein, mit Ausnahme eines optionalen Sprach-Cookies (<code>tradelyst_lang</code>),
    welches die Sprachauswahl speichert.
  </p>

  <h2>6. Ihre Rechte</h2>
  <ul>
    <li>Recht auf Auskunft (Art.&nbsp;15 DSGVO)</li>
    <li>Recht auf Berichtigung (Art.&nbsp;16 DSGVO)</li>
    <li>Recht auf Löschung (Art.&nbsp;17 DSGVO)</li>
    <li>Recht auf Einschränkung (Art.&nbsp;18 DSGVO)</li>
    <li>Recht auf Datenübertragbarkeit (Art.&nbsp;20 DSGVO)</li>
    <li>Widerspruchsrecht (Art.&nbsp;21 DSGVO)</li>
    <li>Beschwerderecht bei einer Aufsichtsbehörde (Art.&nbsp;77 DSGVO)</li>
  </ul>
  <p>Anfragen an <a href="mailto:<?= h(PRIVACY_EMAIL) ?>"><?= h(PRIVACY_EMAIL) ?></a>.</p>

  <p style="margin-top:48px; color: var(--text-faint); font-size:13px;">
    Stand: <?= date('d.m.Y') ?>
  </p>
<?php else: ?>
  <h1>Privacy Policy</h1>

  <div class="legal-note">
    <strong>Note (remove before going live):</strong>
    Common GDPR disclosure obligations covered. Controller data is read from
    <code>includes/config.php</code> &rarr; <code>OPERATOR</code>. Concrete list of
    processors, retention periods, and cookie usage must be reviewed by a lawyer.
  </div>

  <h2>1. Controller</h2>
  <p>
    <?= operatorAddressHtml() ?><br>
    Email: <a href="mailto:<?= h(PRIVACY_EMAIL) ?>"><?= h(PRIVACY_EMAIL) ?></a>
  </p>

  <h2>2. Server log files</h2>
  <p>
    Technical data (anonymised IP, timestamp, URL, browser type) is stored for at most
    30 days (Art.&nbsp;6(1)(f) GDPR).
  </p>

  <h2>3. Contact form</h2>
  <p>
    Data submitted via the contact form (name, email, subject, message, IP, timestamp) is
    stored to process the request (Art.&nbsp;6(1)(b)/(f) GDPR). Spam protection uses a
    honeypot field and a time-based plausibility check; no third-party services like reCAPTCHA.
  </p>

  <h2>4. Processors</h2>
  <p>For the SaaS application we engage the following processors:</p>
  <ul>
    <li><strong>Stripe Payments Europe Ltd.</strong> (payments), Ireland; EU SCCs.</li>
    <li><strong>OpenAI Ireland Ltd.</strong> (AI features) — processes pseudonymised trade statistics; privacy mode strips dollar amounts. EU SCCs + EU&ndash;US Data Privacy Framework.</li>
    <li><strong>Resend, Inc.</strong> (transactional email), USA; EU SCCs + EU&ndash;US DPF.</li>
    <li><strong>Databento, Inc.</strong> (historical market data) — no personal data processed.</li>
    <li><strong>[Hosting provider]</strong> — EU-based; data processing agreement (DPA) in place.</li>
  </ul>

  <h2>5. Cookies</h2>
  <p>
    This marketing site (<?= h(SITE_URL) ?>) sets no cookies or tracking, with the
    exception of one optional language cookie (<code>tradelyst_lang</code>) that
    remembers your language choice.
  </p>

  <h2>6. Your rights</h2>
  <ul>
    <li>Right of access (Art.&nbsp;15 GDPR)</li>
    <li>Right to rectification (Art.&nbsp;16 GDPR)</li>
    <li>Right to erasure (Art.&nbsp;17 GDPR)</li>
    <li>Right to restriction of processing (Art.&nbsp;18 GDPR)</li>
    <li>Right to data portability (Art.&nbsp;20 GDPR)</li>
    <li>Right to object (Art.&nbsp;21 GDPR)</li>
    <li>Right to lodge a complaint with a supervisory authority (Art.&nbsp;77 GDPR)</li>
  </ul>
  <p>Requests to <a href="mailto:<?= h(PRIVACY_EMAIL) ?>"><?= h(PRIVACY_EMAIL) ?></a>.</p>

  <p style="margin-top:48px; color: var(--text-faint); font-size:13px;">
    Last updated: <?= date('Y-m-d') ?>
  </p>
<?php endif; ?>
</div>

<?php include __DIR__ . '/../includes/footer.php'; ?>
