<section class="login-card" aria-labelledby="login-title">
  <header class="login-header">
    <p class="login-badge"><?= $e($t('brand.name_full')) ?></p>
    <h1 id="login-title"><?= $e($t('auth.login.heading')) ?></h1>
    <p class="login-subtitle"><?= $e($t('auth.login.subtitle')) ?></p>
  </header>

  <?php if (!empty($errorMessage)): ?>
    <div class="alert alert--danger login-alert" role="alert">
      <?= $e($errorMessage) ?>
    </div>
  <?php else: ?>
    <div class="alert alert--danger login-alert login-alert-placeholder" aria-hidden="true">
      <?= $e($t('auth.login.error_placeholder')) ?>
    </div>
  <?php endif; ?>

  <form class="login-form" action="/login" method="post" novalidate>
    <input type="hidden" name="_token" value="<?= $e($csrfToken ?? '') ?>">

    <label class="form-field">
      <span class="field-label"><?= $e($t('auth.login.email_label')) ?></span>
      <input
        type="email"
        class="form-control"
        name="email"
        autocomplete="email"
        required
        placeholder="<?= $e($t('auth.login.email_placeholder')) ?>"
        value="<?= $e($oldEmail ?? '') ?>"
      >
    </label>

    <label class="form-field">
      <span class="field-label"><?= $e($t('auth.login.password_label')) ?></span>
      <input
        type="password"
        class="form-control"
        name="password"
        autocomplete="current-password"
        required
        placeholder="<?= $e($t('auth.login.password_placeholder')) ?>"
      >
    </label>

    <button type="submit" class="btn btn--primary btn--block login-submit"><?= $e($t('actions.login')) ?></button>
  </form>
</section>
