<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="es">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>TAI – AGE | Registro</title>
    <link rel="stylesheet" th:href="@{/css/style.css}"/>
    <link rel="stylesheet" th:href="@{/css/registro.css}"/>
</head>
<body>
<div class="auth-wrap">
    <div class="auth-card">
        <h2>Crear cuenta</h2>
        <p class="subtitle">Tu cuenta quedará pendiente de activación hasta que el administrador la apruebe.</p>

        <div th:if="${error}" class="auth-msg error" th:text="${error}"></div>

        <div class="auth-msg info">
            <strong>¿Ya has pagado?</strong> Indica tu email al registrarte y el admin activará tu acceso.
        </div>

        <form th:action="@{/registro}" method="post">
            <div class="auth-field">
                <label for="email">Email</label>
                <input id="email" type="email" name="email" required autofocus/>
            </div>
            <div class="auth-field">
                <label for="password">Contraseña</label>
                <input id="password" type="password" name="password" required minlength="8"/>
                <span class="hint">Mínimo 8 caracteres</span>
            </div>
            <div class="auth-field">
                <label for="passwordConfirm">Confirmar contraseña</label>
                <input id="passwordConfirm" type="password" name="passwordConfirm" required minlength="8"/>
            </div>
            <button type="submit" class="auth-btn">Registrarme</button>
        </form>

        <div class="auth-footer">
            ¿Ya tienes cuenta? <a th:href="@{/login}">Iniciar sesión</a>
        </div>
    </div>
</div>
</body>
</html>
