<!DOCTYPE html>
<html lang="en">

	<head>
		{% block head %}
			<meta charset="UTF-8">
			<meta http-equiv="X-UA-Compatible" content="IE=edge">
			<meta name="viewport" content="width=device-width, initial-scale=1.0">
			<link rel="preconnect" href="https://fonts.googleapis.com">
			<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
			<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;700;900&display=swap" rel="stylesheet">
			<link href={{ asset('css/login.css') }} rel="stylesheet">
            <title>IceLAND</title>
		{% endblock %}
	</head>

	<body>
        <div class="container">
		{% block body %}
			{% if error %}
				<div>{{ error.messageKey|trans(error.messageData, 'security') }}</div>
			{% endif %}

			<form action="{{ path('app_login') }}" method="post">
				<label for="username">Email:</label>
				<input type="text" id="username" name="_username" value="{{ last_username }}">

				<label for="password">Password:</label>
				<input
				type="password" id="password" name="_password">

				{# If you want to control the URL the user is redirected to on success
						            <input type="hidden" name="_target_path" value="/account"> #}

				<button type="submit">Войти</button>
			</form>
            <button id="btn-register">Регистрация</button>
		{% endblock %}
        </div>
	</body>
    <script>
		var btnToRegister = document.getElementById('btn-register');
		btnToRegister.addEventListener('click', function() {
            window.location.href = '/register'
		});

	</script>
</html>
