<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Invitation to {{tenant.longName}}</title>
    <style>
      body {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
          line-height: 1.6;
          color: #333;
          max-width: 600px;
          margin: 0 auto;
          padding: 20px;
          background-color: {{tenant.backgroundColor}};
      }
      .email-container {
          background-color: white;
          padding: 30px;
          border-radius: 8px;
          box-shadow: 0 2px 4px rgba(0,0,0,0.1);
      }
      .header {
          text-align: center;
          border-bottom: 1px solid #eee;
          padding-bottom: 20px;
          margin-bottom: 30px;
      }
      .logo {
          font-size: 24px;
          font-weight: bold;
          color: {{tenant.primaryColor}};
      }
      h1 {
          color: #1f2937;
          font-size: 24px;
          margin-bottom: 20px;
      }
      .button {
          display: inline-block;
          background-color: {{tenant.primaryColor}};
          color: white !important;
          padding: 12px 24px;
          text-decoration: none;
          border-radius: 6px;
          font-weight: 500;
          margin: 10px 0;
      }
      .button:hover {
          background-color: #1d4ed8;
      }
      .role-info {
          background-color: #f9fafb;
          padding: 20px;
          border-radius: 6px;
          margin: 20px 0;
          border-left: 4px solid: {{tenant.primaryColor}};
      }
      .footer {
          margin-top: 30px;
          padding-top: 20px;
          border-top: 1px solid #eee;
          font-size: 14px;
          color: #6b7280;
          text-align: center;
      }
    </style>
  </head>
  <body>
    <div class="email-container">
      <div class="header">
        {{#if tenant.logo}}
        <img
          src="data:image/png;base64,{{tenant.logo}}"
          alt="{{tenant.longName}}"
          style="max-height: 60px; margin-bottom: 10px"
        />
        {{/if}}
        <div class="logo">{{tenant.longName}}</div>
      </div>

      <h1>You've been invited!</h1>

      <p>Hello {{recipient.name}},</p>

      <p>You have been invited to join {{tenant.longName}}!</p>

      <div class="role-info">
        <h3>📧 Your registration details:</h3>
        <p><strong>Email:</strong> {{recipient.email}}</p>
        <p><strong>Organization:</strong> {{tenant.longName}}</p>
        <p>
          <em>Your role and permissions will be automatically assigned during registration.</em>
        </p>
      </div>

      <p><strong>Register now to get started:</strong></p>

      <p><a href="{{registrationUrl}}" class="button">Register Now</a></p>

      <p>
        If the button doesn't work, copy this link into your browser:<br />
        {{registrationUrl}}
      </p>

      <div class="footer">
        <p>
          This invitation is valid for 7 days. If you didn't request this email, you can ignore it.
        </p>
        <p>{{tenant.longName}} Team</p>
      </div>
    </div>
  </body>
</html>
