<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>NDUTH WiFi — Reset Password</title>
  <style>
    * { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      min-height: 100vh;
      background: linear-gradient(135deg, #0a2540 0%, #1a4a7a 50%, #0d3b6e 100%);
      font-family: 'Segoe UI', Arial, sans-serif;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .card {
      background: white;
      border-radius: 20px;
      width: 100%;
      max-width: 420px;
      overflow: hidden;
      box-shadow: 0 24px 60px rgba(0,0,0,0.3);
    }

    .header {
      background: linear-gradient(135deg, #0a2540, #1a4a7a);
      padding: 32px;
      text-align: center;
    }

    .header .logo {
      width: 64px; height: 64px;
      background: rgba(255,255,255,0.15);
      border-radius: 16px; margin: 0 auto 14px;
      display: flex; align-items: center;
      justify-content: center; font-size: 28px;
    }

    .header h1 { color: white; font-size: 18px; font-weight: 700; }
    .header p  { color: rgba(255,255,255,0.7); font-size: 12px; margin-top: 6px; }

    .body { padding: 32px; }

    .intro {
      font-size: 14px; color: #4b5563;
      line-height: 1.6; margin-bottom: 22px;
      background: #eff6ff; border: 1px solid #bfdbfe;
      border-radius: 10px; padding: 14px 16px;
    }

    .flash-error {
      background: #fef2f2; border: 1px solid #fca5a5;
      border-radius: 10px; padding: 10px 14px;
      margin-bottom: 18px; color: #dc2626; font-size: 13px;
    }
    .flash-success {
      background: #f0fdf4; border: 1px solid #86efac;
      border-radius: 10px; padding: 10px 14px;
      margin-bottom: 18px; color: #16a34a; font-size: 13px;
    }

    .field { margin-bottom: 18px; }

    label {
      display: block; font-size: 12px; font-weight: 600;
      color: #374151; margin-bottom: 6px;
      text-transform: uppercase; letter-spacing: 0.05em;
    }

    input {
      width: 100%; padding: 12px 14px;
      border: 1.5px solid #e5e7eb; border-radius: 10px;
      font-size: 14px; color: #111; outline: none;
      transition: border-color 0.2s;
    }
    input:focus { border-color: #1a4a7a; }

    .btn {
      width: 100%; padding: 14px;
      background: linear-gradient(135deg, #0a2540, #1a4a7a);
      color: white; border: none; border-radius: 12px;
      font-size: 15px; font-weight: 700; cursor: pointer;
      transition: opacity 0.2s;
    }
    .btn:hover { opacity: 0.9; }

    .links {
      text-align: center; margin-top: 20px;
      font-size: 13px; color: #6b7280;
    }
    .links a { color: #1a4a7a; text-decoration: none; font-weight: 600; }

    .footer {
      background: #0a2540; padding: 12px 32px; text-align: center;
    }
    .footer p { color: rgba(255,255,255,0.5); font-size: 11px; }
  </style>
</head>
<body>
  <div class="card">
    <div class="header">
      <div class="logo">🔑</div>
      <h1>Reset Your Password</h1>
      <p>NDUTH WiFi — Niger Delta University Teaching Hospital</p>
    </div>

    <div class="body">
      {% with messages = get_flashed_messages(with_categories=true) %}
        {% for category, message in messages %}
          <div class="flash-{{ category }}">{{ message }}</div>
        {% endfor %}
      {% endwith %}

      <div class="intro">
        Enter the email address you registered with. We'll send you a reset
        link — your email app will be temporarily accessible through the hotspot.
      </div>

      <form method="POST" action="/nduth/forgot-password">
        <div class="field">
          <label>Registered Email Address</label>
          <input type="email" name="email" required
                 placeholder="your@email.com" autofocus>
        </div>

        <button type="submit" class="btn">
          📧 &nbsp;Send Reset Link
        </button>
      </form>

      <div class="links">
        Remembered it?
        <a href="/nduth/login">Back to login</a>
      </div>
    </div>

    <div class="footer">
      <p>Powered by Collnetwork Technology LTD &nbsp;·&nbsp; © 2026</p>
    </div>
  </div>
</body>
</html>
