<?php

require __DIR__ . '/bootstrap.php';

use KeyLair\Helpers;
use KeyLair\Settings;

$legal = Settings::legalAll();
$pageTitle = 'Imprint';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= Helpers::e($pageTitle) ?> — <?= Helpers::e(Settings::siteName()) ?></title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/assets/css/tokens.css">
<?= Settings::faviconTag() ?>
<style>
  body{
    background:var(--bg-void); color:var(--text-primary); font-family:var(--font-body);
    min-height:100vh; display:flex; justify-content:center; padding:48px 20px 80px;
  }
  .page{width:100%; max-width:640px;}
  .back-link{
    display:inline-flex; align-items:center; gap:6px; color:var(--text-faint);
    text-decoration:none; font-size:12.5px; margin-bottom:24px;
  }
  .back-link:hover{color:var(--text-muted);}
  h1{font-family:var(--font-display); font-size:24px; font-weight:600; margin:0 0 24px; letter-spacing:-0.01em;}
  h2{font-family:var(--font-display); font-size:15px; font-weight:600; margin:28px 0 10px;}
  p{font-size:13.5px; line-height:1.65; color:var(--text-muted); margin:0 0 4px;}
  .card{
    background:var(--bg-panel); border:1px solid var(--line); border-radius:var(--radius-md);
    padding:20px 22px; margin-bottom:4px;
  }
  a{color:var(--signal);}
  .legal-footer{text-align:center; margin-top:36px; font-size:11.5px; color:var(--text-faint); line-height:1.6;}
</style>
</head>
<body>
<div class="page">
  <a class="back-link" href="/">
    <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 18l-6-6 6-6"/></svg>
    Back
  </a>

  <h1>Imprint</h1>

  <div class="card">
    <h2 style="margin-top:0;">Information pursuant to Sec. 5 DDG (German Digital Services Act)</h2>
    <p><?= Helpers::e($legal['legal_company_name']) ?></p>
    <p><?= Helpers::e($legal['legal_street']) ?></p>
    <p><?= Helpers::e($legal['legal_zip']) ?> <?= Helpers::e($legal['legal_city']) ?></p>
    <p><?= Helpers::e($legal['legal_country']) ?></p>

    <h2>Represented by</h2>
    <p><?= Helpers::e($legal['legal_managing_director']) ?></p>

    <?php if ($legal['legal_register_number'] !== '' || $legal['legal_register_court'] !== ''): ?>
    <h2>Commercial register</h2>
    <?php if ($legal['legal_register_court'] !== ''): ?><p>Register court: <?= Helpers::e($legal['legal_register_court']) ?></p><?php endif; ?>
    <?php if ($legal['legal_register_number'] !== ''): ?><p>Register number: <?= Helpers::e($legal['legal_register_number']) ?></p><?php endif; ?>
    <?php endif; ?>

    <?php if ($legal['legal_vat_id'] !== ''): ?>
    <h2>VAT ID</h2>
    <p>VAT identification number pursuant to Sec. 27a of the German VAT Act (UStG): <?= Helpers::e($legal['legal_vat_id']) ?></p>
    <?php endif; ?>

    <h2>Contact</h2>
    <p>Email: <a href="mailto:<?= Helpers::e($legal['legal_email']) ?>"><?= Helpers::e($legal['legal_email']) ?></a></p>
    <?php if ($legal['legal_phone'] !== ''): ?><p>Phone: <?= Helpers::e($legal['legal_phone']) ?></p><?php endif; ?>

    <h2>Responsible for content pursuant to Sec. 18(2) MStV (German Interstate Media Treaty)</h2>
    <p><?= Helpers::e($legal['legal_managing_director']) ?></p>
    <p><?= Helpers::e($legal['legal_street']) ?>, <?= Helpers::e($legal['legal_zip']) ?> <?= Helpers::e($legal['legal_city']) ?></p>

    <h2>EU dispute resolution</h2>
    <p>The European Commission provides a platform for online dispute resolution (ODR): <a href="https://ec.europa.eu/consumers/odr/" target="_blank" rel="noopener">https://ec.europa.eu/consumers/odr/</a>. Our email address is listed above. We are not obliged and not willing to participate in dispute resolution proceedings before a consumer arbitration board.</p>
  </div>

  <p class="legal-footer">
    Structure and layout are based on common German imprint templates, including e-recht24.de.<br>
    See also: <a href="/privacy">Privacy Policy</a>
  </p>
</div>
</body>
</html>
