<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Набор на модератора Балтики</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f0f4f8;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            color: #333;
            animation: backgroundColorChange 5s infinite alternate;
        }

        @keyframes backgroundColorChange {
            0% { background-color: #f0f4f8; }
            100% { background-color: #f7f9fc; }
        }

        .form-container {
            background: linear-gradient(145deg, #ffffff, #f0f4f8);
            padding: 30px;
            border-radius: 20px;
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 450px;
            text-align: center;
            transform: scale(1);
            animation: formAnimation 1s ease-out;
        }

        @keyframes formAnimation {
            0% { transform: scale(0.9); opacity: 0; }
            100% { transform: scale(1); opacity: 1; }
        }

        .form-container h1 {
            color: #007bff;
            margin-bottom: 20px;
            font-size: 26px;
            text-transform: uppercase;
            letter-spacing: 2px;
            font-weight: bold;
            animation: fadeInTitle 2s ease-in-out;
        }

        @keyframes fadeInTitle {
            0% { opacity: 0; }
            100% { opacity: 1; }
        }

        .form-container label {
            display: block;
            margin-bottom: 8px;
            color: #555;
            font-weight: bold;
        }

        .form-container input, .form-container textarea, .form-container select {
            width: 100%;
            padding: 12px;
            margin-bottom: 20px;
            border: 1px solid #ccc;
            border-radius: 8px;
            font-size: 16px;
            background-color: #fafafa;
            transition: border-color 0.3s, background-color 0.3s;
        }

        .form-container input:focus, .form-container textarea:focus, .form-container select:focus {
            border-color: #007bff;
            outline: none;
            background-color: #e9f4fe;
        }

        .form-container button {
            background-color: #007bff;
            color: #fff;
            padding: 12px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .form-container button:hover {
            background-color: #0056b3;
        }

        .form-container button:active {
            background-color: #003f7f;
        }

        .form-container button:disabled {
            background-color: #a6c8ff;
            cursor: not-allowed;
        }

        .success-message {
            display: none;
            color: green;
            font-weight: bold;
            margin-top: 20px;
            font-size: 18px;
            animation: fadeInSuccess 1.5s ease-in-out;
        }

        @keyframes fadeInSuccess {
            0% { opacity: 0; }
            100% { opacity: 1; }
        }

        .form-container hr {
            border: 0;
            border-top: 2px solid #007bff;
            margin: 20px 0;
        }

        .emoji {
            font-size: 20px;
            margin-right: 10px;
        }

        .footer-text {
            font-size: 14px;
            color: #777;
        }

        .footer-text:hover {
            text-decoration: underline;
            cursor: pointer;
        }

    </style>
</head>
<body>
    <div class="form-container">
        <h1>Набор на модератора Балтики 🚀</h1>
        <form id="application-form">
            <label for="name">Ваше настоящее имя 👤:</label>
            <input type="text" id="name" name="name" placeholder="Введите ваше имя" required>

            <label for="age">Ваш настоящий возраст 🎂:</label>
            <input type="number" id="age" name="age" placeholder="Введите ваш возраст" required>

            <label for="opinion">Ваше мнение о 177 скваде 💬:</label>
            <textarea id="opinion" name="opinion" rows="4" placeholder="Напишите ваше мнение" required></textarea>

            <label for="rules-knowledge">Ваш уровень знания правил сервера (от 1 до 10) 📊:</label>
            <select id="rules-knowledge" name="rules-knowledge" required>
                <option value="">Выберите уровень</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
                <option value="6">6</option>
                <option value="7">7</option>
                <option value="8">8</option>
                <option value="9">9</option>
                <option value="10">10</option>
            </select>

            <label for="discord-id">Ваш Discord ID 🆔:</label>
            <input type="text" id="discord-id" name="discord-id" placeholder="Введите ваш Discord ID" required>

            <button type="submit"><span class="emoji">📩</span>Отправить заявку</button>
        </form>
        <div class="success-message" id="success-message">Заявка успешно отправлена! 🎉</div>
        <hr>
        <div class="footer-text">Мы свяжемся с вами после рассмотрения заявки. 🔜</div>
    </div>

    <script>
        document.getElementById('application-form').addEventListener('submit', function(event) {
            event.preventDefault();

            const name = document.getElementById('name').value;
            const age = document.getElementById('age').value;
            const opinion = document.getElementById('opinion').value;
            const rulesKnowledge = document.getElementById('rules-knowledge').value;
            const discordId = document.getElementById('discord-id').value;

            const webhookUrl = 'https://canary.discord.com/api/webhooks/1330287044806705294/oa6Bx6QoKcB6LY_OBXMXLrgdDfzommglscPUtGjh76cZ6uEKIO9oNwWf-OhlGT3jdKI2';

            const message = {
                content: `Новая заявка на модератора:\n**Имя:** ${name}\n**Возраст:** ${age}\n**Мнение о 177 скваде:** ${opinion}\n**Уровень знания правил:** ${rulesKnowledge}\n**Discord ID:** <@${discordId}>`
            };

            fetch(webhookUrl, {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify(message)
            })
            .then(response => {
                if (response.ok) {
                    document.getElementById('success-message').style.display = 'block';
                    document.getElementById('application-form').reset();
                } else {
                    alert('Ошибка при отправке заявки. Попробуйте снова.');
                }
            })
            .catch(error => {
                console.error('Ошибка:', error);
                alert('Ошибка при отправке заявки. Попробуйте снова.');
            });
        });
    </script>
</body>
</html>
