{% extends "base.html" %}

{% block title %}{{ title }}{% endblock %}

{% block styles %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/login.css') }}">
{% endblock %}

{% block content %}
<div class="login-container">
    <div class="login-card register-card">
        <div class="card-header text-center mb-4">
            <h1 class="title">Crear cuenta</h1>
            <p class="subtitle">Únete a Olé Consulting y gestiona tu energía de forma inteligente</p>
        </div>
        
        <form method="POST" action="{{ url_for('auth_bp.register') }}">
            {{ form.hidden_tag() }}
            
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"><i class="fas fa-user"></i></span>
                    </div>
                    {{ form.username(class="form-control", placeholder="Nombre de usuario") }}
                </div>
                {% for error in form.username.errors %}
                <span class="error-message">{{ error }}</span>
                {% endfor %}
            </div>
            
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"><i class="fas fa-envelope"></i></span>
                    </div>
                    {{ form.email(class="form-control", placeholder="Correo electrónico") }}
                </div>
                {% for error in form.email.errors %}
                <span class="error-message">{{ error }}</span>
                {% endfor %}
            </div>
            
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"><i class="fas fa-lock"></i></span>
                    </div>
                    {{ form.password(class="form-control", placeholder="Contraseña") }}
                </div>
                {% for error in form.password.errors %}
                <span class="error-message">{{ error }}</span>
                {% endfor %}
            </div>
            
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"><i class="fas fa-lock"></i></span>
                    </div>
                    {{ form.password2(class="form-control", placeholder="Confirmar contraseña") }}
                </div>
                {% for error in form.password2.errors %}
                <span class="error-message">{{ error }}</span>
                {% endfor %}
            </div>
            
            <div class="form-check terms-check">
                {{ form.accept_terms(class="form-check-input") }}
                {{ form.accept_terms.label(class="form-check-label") }}
                {% for error in form.accept_terms.errors %}
                <span class="error-message">{{ error }}</span>
                {% endfor %}
            </div>
            
            <div class="form-actions">
                {{ form.submit(class="btn btn-primary", value="Crear cuenta") }}
            </div>
            
            <div class="auth-links">
                <p>¿Ya tienes una cuenta? <a href="{{ url_for('auth_bp.login') }}">Inicia sesión</a></p>
            </div>
        </form>
    </div>
</div>
{% endblock %}
