{% extends 'base.html' %}

{% block title %}Reset Password - Quizzical Beats{% endblock %}

{% block content %}
<div class="flex min-h-screen items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
  <div class="w-full max-w-md space-y-8">
    <div class="text-center">
      <h2 class="mt-6 text-center text-3xl font-bold tracking-tight text-navy-800 font-montserrat">
        Reset Your Password
      </h2>
      <p class="mt-2 text-center text-sm text-gray-600">
        Please enter your new password below
      </p>
    </div>
      <div class="mt-8 bg-white py-8 px-6 shadow-md rounded-lg">
      <form class="space-y-6" action="{{ url_for('users.reset_password', token=token) }}" method="POST">
        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
        
        <div>
          <label for="password" class="block text-sm font-medium text-gray-700">New Password</label>
          <div class="mt-1">
            <input id="password" name="password" type="password" autocomplete="new-password" required
                   class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-orange-500 focus:border-orange-500"
                   minlength="8">
            <p class="text-xs text-gray-500 mt-1">Password must be at least 8 characters</p>
          </div>
        </div>
        
        <div>
          <label for="confirm_password" class="block text-sm font-medium text-gray-700">Confirm Password</label>
          <div class="mt-1">
            <input id="confirm_password" name="confirm_password" type="password" autocomplete="new-password" required
                   class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-orange-500 focus:border-orange-500"
                   minlength="8">
          </div>
        </div>

        <div>
          <button type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-orange-500 hover:bg-orange-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500">
            Reset Password
          </button>
        </div>
      </form>
      
      <div class="mt-6">
        <div class="text-center">
          <a href="{{ url_for('users.login') }}" class="text-sm text-orange-600 hover:text-orange-500">
            Return to login page
          </a>
        </div>
      </div>
    </div>
    
    <div class="text-center mt-4 text-sm text-gray-500">
      <p>Need a new reset link? <a href="{{ url_for('users.forgot_password') }}" class="text-orange-600 hover:text-orange-500">Request password reset again</a></p>
    </div>
  </div>
</div>
{% endblock %}