<%- include('../shared/_head', { title: title, portalCss: '/platform/merchant/css/portal.css', bodyClass: 'merchant-portal auth-page' }) %>

<div class="auth-shell">
  <div class="auth-card">
    <div class="auth-header">
      <a href="/merchant/login" class="back-link">← Sign in</a>
      <div class="portal-badge portal-badge--merchant">Merchant</div>
    </div>
    <h1 class="auth-title">Reset your password</h1>

    <% if (typeof sent !== 'undefined' && sent) { %>
    <div class="flash flash--success" role="alert">
      If an account exists for <strong><%= email %></strong>, a reset link has been sent. Check your inbox and spam folder.
    </div>
    <p class="auth-sub"><a href="/merchant/login">Return to sign in</a></p>

    <% } else { %>

    <p class="auth-sub">Enter your email and we'll send you a reset link valid for 2 hours.</p>
    <%- include('../shared/_errors') %>

    <form method="POST" action="/merchant/forgot-password" class="auth-form" novalidate>
      <input type="hidden" name="_csrf" value="<%= csrfToken %>">
      <div class="field">
        <label for="email">Email</label>
        <input type="email" id="email" name="email" autocomplete="email" required autofocus>
      </div>
      <button type="submit" class="btn btn-primary btn-block">Send reset link</button>
    </form>

    <% } %>
  </div>
</div>

<%- include('../shared/_foot', {}) %>
