<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Register – PixelSage</title>
  <script src="https://cdn.tailwindcss.com"></script>
  <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
  <nav class="navbar">
    <div class="container navbar-inner">
      <a href="{{ url_for('index') }}" class="logo">Pixel<span>Sage</span></a>
      <ul class="nav-links">
        <li><a href="{{ url_for('login') }}">Login</a></li>
      </ul>
    </div>
  </nav>

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

  <main class="auth-page">
    <div class="auth-card glass-strong">
      <h1>Create Account</h1>
      <p class="auth-subtitle">Join PixelSage and start processing images in real time</p>

      <form method="POST" action="{{ url_for('register') }}">
        <div class="form-group">
          <label class="form-label" for="username">Username</label>
          <input class="form-input" type="text" id="username" name="username" placeholder="Choose a username" required minlength="3" autofocus>
        </div>
        <div class="form-group">
          <label class="form-label" for="password">Password</label>
          <input class="form-input" type="password" id="password" name="password" placeholder="At least 6 characters" required minlength="6">
        </div>
        <div class="form-group">
          <label class="form-label" for="confirm_password">Confirm Password</label>
          <input class="form-input" type="password" id="confirm_password" name="confirm_password" placeholder="Repeat password" required>
        </div>
        <button type="submit" class="btn btn-primary" style="width:100%;">Create Account</button>
      </form>

      <p class="auth-footer">
        Already have an account? <a href="{{ url_for('login') }}">Sign in</a>
      </p>
    </div>
  </main>
</body>
</html>
