<!doctype html>
<html>
<body style="margin:0;padding:0;background:#f3f6fb;font-family:Segoe UI,Arial,sans-serif;color:#111827;">
  <table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="background:#f3f6fb;padding:28px 12px;">
    <tr><td align="center">
      <table role="presentation" width="640" cellspacing="0" cellpadding="0" style="max-width:640px;width:100%;background:#ffffff;border:1px solid #dfe7f1;border-radius:18px;overflow:hidden;box-shadow:0 18px 48px rgba(15,23,42,.10);">
        <tr>
          <td style="padding:30px;background:linear-gradient(135deg,#111827,#b98218);color:#ffffff;">
            <div style="font-size:12px;font-weight:800;letter-spacing:2px;text-transform:uppercase;color:#f5c84c;">Registration Received</div>
            <h1 style="margin:10px 0 0;font-size:26px;line-height:1.25;color:#ffffff;">{{ 'Team Registration Received' if is_team else 'Registration Received' }}</h1>
            <div style="margin-top:14px;display:inline-block;padding:8px 14px;border-radius:999px;background:rgba(255,255,255,.14);font-size:13px;font-weight:700;">{{ details.ref }}</div>
          </td>
        </tr>
        <tr><td style="padding:28px 30px;">
          <p style="margin:0 0 18px;font-size:15px;line-height:1.7;color:#334155;">
            Dear <strong>{{ recipient.name if recipient is defined else details.name }}</strong>,
            {% if is_team %}
            your team registration has been successfully received and is currently under verification.
            {% else %}
            your registration has been successfully received and is currently under verification.
            {% endif %}
          </p>
          <div style="padding:16px 18px;background:#fff7e6;border:1px solid #f3d388;border-left:5px solid #b98218;border-radius:12px;margin-bottom:20px;">
            <strong style="display:block;color:#8a5a12;font-size:15px;">Status: UNDER VERIFICATION</strong>
            <span style="display:block;color:#6b4a13;font-size:13.5px;line-height:1.6;margin-top:5px;">
              Your registration/payment is currently under verification. Once it is verified, your official ticket will be generated and sent to you by email. You do not need to register again.
            </span>
          </div>
          <table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border:1px solid #dfe7f1;border-radius:12px;overflow:hidden;">
            {% for label, value in [
              ('Game', details.game),
              ('Platform', details.platform),
              ('Nick Name / Team', details.team_name),
              ('Group Leader', details.leader_name),
              ('Registration Reference', details.ref),
              ('Applied Date & Time', details.created_at),
              ('Status', 'UNDER VERIFICATION')
            ] %}
            <tr>
              <td style="padding:12px 16px;border-bottom:1px solid #e8eef6;background:#f8fafc;color:#64748b;font-size:13px;font-weight:700;width:42%;">{{ label }}</td>
              <td style="padding:12px 16px;border-bottom:1px solid #e8eef6;color:#111827;font-size:14px;font-weight:700;text-align:right;">{{ value }}</td>
            </tr>
            {% endfor %}
          </table>
          {% if is_team and roster %}
          <div style="margin-top:20px;padding:16px 18px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;">
            <strong style="display:block;color:#334155;font-size:14px;margin-bottom:8px;">Team Members</strong>
            {% for line in roster %}
            <span style="display:block;color:#475569;font-size:13.5px;line-height:1.8;">{{ line }}</span>
            {% endfor %}
          </div>
          {% endif %}
          <p style="margin:22px 0 0;font-size:13.5px;line-height:1.7;color:#64748b;">
            Event: <strong style="color:#111827;">{{ settings.event_title }}</strong> &middot; <strong style="color:#111827;">{{ settings.event_date | pretty_dt }}</strong><br>
            Venue: {{ settings.event_venue }}{% if settings.event_city %}, {{ settings.event_city }}{% endif %}
          </p>
          <p style="margin:16px 0 0;font-size:12px;color:#94a3b8;text-align:center;">
            For any issues, contact <a href="mailto:nexora.esport.support@gmail.com" style="color:#2563eb;">nexora.esport.support@gmail.com</a> or WhatsApp <a href="https://wa.me/923310314962" style="color:#2563eb;">+92 331 0314962</a>
          </p>
        </td></tr>
        <tr><td style="padding:18px 30px;background:#111827;color:#cbd5e1;font-size:12.5px;text-align:center;">
          {{ settings.event_title }}{% if settings.contact_email %} กค {{ settings.contact_email }}{% endif %} กค WhatsApp: +92 331 0314962
          <br><span style="font-size:11px;color:#64748b;">This is a transactional email regarding your registration. You are receiving this because you registered for {{ settings.event_title }}.</span>
        </td></tr>
      </table>
    </td></tr>
  </table>
</body>
</html>
