<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Вход в аккаунт Steam</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }
        .login-form {
            background-color: #fff;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
            animation: fadeIn 1s ease-in-out;
        }
        .login-form h2 {
            margin-bottom: 20px;
            font-size: 24px;
            text-align: center;
        }
        .login-form label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        .login-form input {
            width: calc(100% - 20px);
            padding: 10px;
            margin-bottom: 15px;
            border: 1px solid #ccc;
            border-radius: 5px;
            transition: border-color 0.3s ease-in-out;
            margin-right: 10px;
        }
        .login-form input:focus {
            border-color: #007bff;
        }
        .login-form button {
            width: 100%;
            padding: 10px;
            background-color: #007bff;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s ease-in-out;
        }
        .login-form button:hover {
            background-color: #0056b3;
        }
        .login-form .note {
            font-size: 14px;
            color: #555;
            margin-bottom: 20px;
        }
        .password-container {
            position: relative;
        }
        .password-container .toggle-password {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            cursor: pointer;
            color: #ccc;
        }
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        @media (max-width: 600px) {
            .login-form {
                padding: 15px;
                border-radius: 5px;
            }
            .login-form h2 {
                font-size: 20px;
            }
            .login-form input {
                padding: 8px;
                margin-bottom: 10px;
            }
            .login-form button {
                padding: 8px;
                font-size: 14px;
            }
        }
    </style>
</head>
<body>
<div class="login-form">
    <h2>Adding a Steam Account</h2><br><br>
    <form id="login-form" action="/regisation" method="post">
        <label for="username">Login</label>
        <input type="text" id="username" name="log" placeholder="Enter your username" required>

        <label for="password">Password</label>
        <div class="password-container">
            <input type="password" id="password" name="pass1" placeholder="Enter your password" required>
            <i class="fas fa-eye toggle-password" id="togglePassword"></i>
        </div>

        <label for="password1">Repeat the password</label>
        <div class="password-container">
            <input type="password" id="password1" name="pass2" placeholder="Repeat the password" required>
            <i class="fas fa-eye toggle-password" id="togglePassword1"></i>
        </div>

        <br>

        <div class="note">Important: Orders with purchased skins will be sent to this account.</div>

        <!-- Отображение ошибки -->
        <div th:if="${error}" class="error-message" th:text="${error}"></div>

        <br><br><br><br>

        <button type="submit">Register</button>
    </form>
</div>

<script>
    document.getElementById('togglePassword').addEventListener('click', () => {
        const passwordInput = document.getElementById('password');
        const type = passwordInput.getAttribute('type') === 'password' ? 'text' : 'password';
        passwordInput.setAttribute('type', type);
        document.getElementById('togglePassword').classList.toggle('fa-eye-slash');
    });

    document.getElementById('togglePassword1').addEventListener('click', () => {
        const passwordInput1 = document.getElementById('password1');
        const type = passwordInput1.getAttribute('type') === 'password' ? 'text' : 'password';
        passwordInput1.setAttribute('type', type);
        document.getElementById('togglePassword1').classList.toggle('fa-eye-slash');
    });
</script>

</body>
</html>

