<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Login – 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('register') }}">Sign Up</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>Welcome Back</h1>
      <p class="auth-subtitle">Sign in to access your image processing workspace</p>

      <form method="POST" action="{{ url_for('login') }}">
        <div class="form-group">
          <label class="form-label" for="username">Username</label>
          <input class="form-input" type="text" id="username" name="username" placeholder="Enter username" required 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="Enter password" required>
        </div>
        <button type="submit" class="btn btn-primary" style="width:100%;">Sign In</button>
      </form>

      <p class="auth-footer">
        Don't have an account? <a href="{{ url_for('register') }}">Create one</a>
      </p>
    </div>
  </main>
</body>
</html>
