<?php
require_once __DIR__ . '/../includes/lang.php';
session_start();
if (isset($_SESSION['user_id'])) { header('Location: ../dashboard.php'); exit; }
$dir  = t('dir');
$code = t('lang_code');
?>
<!DOCTYPE html>
<html lang="<?= htmlspecialchars($code) ?>" dir="<?= htmlspecialchars($dir) ?>">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title><?= htmlspecialchars(t('register')) ?> — <?= htmlspecialchars(t('site_name')) ?></title>
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🌴</text></svg>">
  <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="../css/style.css">
  <style>
    body { background: var(--cream); }
    .auth-card { animation: fadeUp .45s ease both; }
    @keyframes fadeUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:none; } }
  </style>
</head>
<body>

<div class="auth-wrap">
  <div class="auth-card">

    <h1 class="auth-title"><?= htmlspecialchars(t('choose_type')) ?></h1>
    <p class="auth-sub"><?= htmlspecialchars(t('choose_desc')) ?></p>

    <div class="type-cards">
      <!-- Tourist -->
      <a href="register_tourist.php<?= $code!=='ar'?'?lang='.$code:'' ?>" class="type-card active-green" style="text-decoration:none">
        <span class="type-icon">👤</span>
        <span class="type-title"><?= htmlspecialchars(t('tourist')) ?></span>
        <span class="type-desc"><?= htmlspecialchars(t('tourist_desc')) ?></span>
      </a>

      <!-- Provider -->
      <a href="choose_activity.php<?= $code!=='ar'?'?lang='.$code:'' ?>" class="type-card active-gold" style="text-decoration:none">
        <span class="type-icon">💼</span>
        <span class="type-title"><?= htmlspecialchars(t('provider')) ?></span>
        <span class="type-desc"><?= htmlspecialchars(t('provider_desc')) ?></span>
      </a>
    </div>

    <div class="auth-link-row">
      <?= htmlspecialchars(t('have_account')) ?>
      <a href="login.php<?= $code!=='ar'?'?lang='.$code:'' ?>"><?= htmlspecialchars(t('login')) ?></a>
    </div>

  </div>
</div>

</body>
</html>
