<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Reset Password • FinFlow</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css"/>
  <link rel="stylesheet" href="/css/style.css"/>
  <style>
    /* Base reset */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: "Segoe UI", Roboto, sans-serif;
    }

    body.auth-body {
      background: #f5f7ff;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      padding: 1rem;
    }

    .auth-container {
      width: 100%;
      max-width: 420px;
    }

    .auth-card {
      background: #fff;
      padding: 2rem;
      border-radius: 1rem;
      box-shadow: 0 6px 20px rgba(0,0,0,0.08);
      display: flex;
      flex-direction: column;
      gap: 1.2rem;
    }

    .auth-title {
      font-size: 1.8rem;
      font-weight: 700;
      color: #333;
    }

    .auth-subtitle {
      font-size: 1rem;
      color: #666;
    }

    .auth-form {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .form-input {
      width: 100%;
      padding: 0.8rem 1rem;
      border: 1px solid #ccc;
      border-radius: 0.6rem;
      font-size: 1rem;
      transition: border-color 0.2s ease;
    }

    .form-input:focus {
      border-color: #2563eb;
      outline: none;
    }

    .btn {
      cursor: pointer;
      padding: 0.9rem 1rem;
      border-radius: 0.6rem;
      border: none;
      font-size: 1rem;
      font-weight: 600;
      background: #2563eb;
      color: #fff;
      transition: 0.3s ease;
    }

    .btn:hover {
      background: #1e4fcc;
    }

    .message {
      text-align: center;
      font-size: 0.95rem;
    }

    .message.success {
      color: green;
    }

    .message.error {
      color: red;
    }

    @media (max-width: 480px) {
      .auth-card {
        padding: 1rem;
        border-radius: 0.8rem;
      }

      .auth-title {
        font-size: 1.3rem;
      }

      .auth-subtitle {
        font-size: 0.9rem;
      }

      .btn {
        font-size: 0.95rem;
        padding: 0.8rem;
      }
    }
  </style>
</head>
<body class="auth-body">
  <main class="auth-container">
    <section class="auth-card">
      <h1 class="auth-title">Reset Password</h1>
      <p class="auth-subtitle">for <%= email %></p>

      <%- include("./partials/messages") %>

      <form action="/reset-password" method="POST" class="auth-form">
        <input type="hidden" name="email" value="<%= email %>">
        <input class="form-input" type="password" name="password" placeholder="New Password" required>
        <input class="form-input" type="password" name="password2" placeholder="Confirm Password" required>
        <button class="btn w-100" type="submit">Update Password</button>
      </form>
    </section>
  </main>
</body>
</html>
