{% extends "base.html" %}

{% block title %}Login - StarPunk Admin{% endblock %}

{% block content %}
<div class="login-container">
  <h2>Admin Login</h2>
  <p>Sign in with your personal website using IndieLogin</p>

  <form action="{{ url_for('auth.login_initiate') }}" method="POST" class="login-form">
    <div class="form-group">
      <label for="me">Your Website URL</label>
      <input
        type="url"
        id="me"
        name="me"
        placeholder="https://example.com"
        required
        autofocus
      >
      <small>Enter your website URL (must match admin configuration)</small>
    </div>

    <button type="submit" class="button button-primary">Sign in with IndieLogin</button>
  </form>

  {% if config.DEV_MODE %}
  <div class="dev-login-option">
    <hr>
    <p class="dev-warning">Development mode active</p>
    <a href="{{ url_for('dev_auth.dev_login') }}" class="button button-warning">
      Quick Dev Login (No Auth)
    </a>
  </div>
  {% endif %}

  <div class="login-help">
    <h3>What is IndieLogin?</h3>
    <p>
      IndieLogin allows you to sign in using your own website.
      No password required - just authenticate with your domain.
    </p>
    <a href="https://indielogin.com/api" target="_blank" rel="noopener">
      Learn more about IndieLogin
    </a>
  </div>
</div>
{% endblock %}
