{% extends "base.html" %}

{% block title %}Crear Usuario - ARCH{% endblock %}

{% block content %}
<div class="container mt-4">
    <h1>Crear Usuario</h1>
    
    <div class="card">
        <div class="card-header bg-primary text-white">
            <h5 class="mb-0">Información del Usuario</h5>
        </div>
        <div class="card-body">
            <form method="POST" action="{{ url_for('users.create') }}">
                {{ form.csrf_token if form.csrf_token }}
                
                <div class="mb-3">
                    <label for="username" class="form-label">Nombre de Usuario</label>
                    <input type="text" class="form-control" id="username" name="username" required>
                </div>
                
                <div class="mb-3">
                    <label for="nombre" class="form-label">Nombre Completo</label>
                    <input type="text" class="form-control" id="nombre" name="nombre" required>
                </div>
                
                <div class="mb-3">
                    <label for="email" class="form-label">Correo Electrónico</label>
                    <input type="email" class="form-control" id="email" name="email" required>
                </div>
                
                <div class="mb-3">
                    <label for="password" class="form-label">Contraseña</label>
                    <input type="password" class="form-control" id="password" name="password" required>
                </div>
                
                <div class="mb-3">
                    <label for="password_confirm" class="form-label">Confirmar Contraseña</label>
                    <input type="password" class="form-control" id="password_confirm" name="password_confirm" required>
                </div>
                
                <div class="mb-3">
                    <label for="nivel" class="form-label">Nivel de Acceso</label>
                    <select class="form-select" id="nivel" name="nivel" required>
                        <option value="1000">Usuario (1000)</option>
                        <option value="5000">Supervisor (5000)</option>
                        <option value="9000">Administrador (9000)</option>
                        <option value="9999">Super Administrador (9999)</option>
                    </select>
                </div>
                
                <div class="mb-3">
                    <label for="empresa" class="form-label">Empresa</label>
                    <input type="text" class="form-control" id="empresa" name="empresa" value="ARCH">
                </div>
                
                <div class="mb-3">
                    <label for="idioma" class="form-label">Idioma</label>
                    <select class="form-select" id="idioma" name="idioma">
                        <option value="es" selected>Español</option>
                        <option value="en">Inglés</option>
                    </select>
                </div>
                
                <div class="d-flex justify-content-between">
                    <button type="submit" class="btn btn-primary">Crear Usuario</button>
                    <a href="{{ url_for('users.list') }}" class="btn btn-secondary">Cancelar</a>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}
