body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 10vh;
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #E9E9E9;
    padding: 10px;
    box-sizing: border-box;
}

form {
    background: #ffffff;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    font-weight: bold;
}

input, select, textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 15px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 5px;
}

/* ��новний ��ил� дл� кнопки */
input[type="submit"] {
    position: relative;
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    border: none;
    border-radius: 15px;
    background: linear-gradient(45deg, rgba(255, 0, 0, 0.7), rgba(255, 127, 0, 0.7), rgba(255, 255, 0, 0.7), rgba(0, 255, 0, 0.7), rgba(0, 0, 255, 0.7), rgba(75, 0, 130, 0.7), rgba(148, 0, 211, 0.7));
    background-size: 400% 400%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
    animation: gradientAnimation 8s ease infinite;
    color: white;
    overflow: hidden;
}

input[type="submit"] span {
    position: relative;
    z-index: 1;
}

input[type="submit"]::before {
    content: attr(value);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(45deg, rgba(148, 0, 211, 0.7), rgba(75, 0, 130, 0.7), rgba(0, 0, 255, 0.7), rgba(0, 255, 0, 0.7), rgba(255, 255, 0, 0.7), rgba(255, 127, 0, 0.7), rgba(255, 0, 0, 0.7));
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: textGradientAnimation 8s ease infinite;
}

input[type="submit"]:hover {
    background: linear-gradient(45deg, rgba(255, 0, 0, 1), rgba(255, 127, 0, 1), rgba(255, 255, 0, 1), rgba(0, 255, 0, 1), rgba(0, 0, 255, 1), rgba(75, 0, 130, 1), rgba(148, 0, 211, 1));
    background-size: 400% 400%;
    animation: gradientAnimation 8s ease infinite;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes textGradientAnimation {
    0% {
        background-position: 100% 50%;
    }
    50% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* �ода�ковий е�ек� дл� ��во�енн� "ва�" */
input[type="submit"]::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 20px;
    background: linear-gradient(45deg, rgba(255, 0, 0, 10), rgba(255, 127, 0, 10), rgba(255, 255, 0, 10), rgba(0, 255, 0, 10), rgba(0, 0, 255, 10), rgba(75, 0, 130, 10), rgba(148, 0, 211, 10));
    background-size: 400% 400%;
    z-index: -1;
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: gradientAnimation 8s ease infinite;
}

input[type="submit"]:hover::after {
    background: linear-gradient(45deg, rgba(255, 0, 0, 1), rgba(255, 127, 0, 1), rgba(255, 255, 0, 1), rgba(0, 255, 0, 1), rgba(0, 0, 255, 1), rgba(75, 0, 130, 1), rgba(148, 0, 211, 1));
    opacity: 1;
}

/* ��ек� ��йва п�и на�и�канн� */
input[type="submit"]:active {
    transform: scale(1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

input[type="submit"]:active::after {
    opacity: 0.5;
    filter: blur(10px);
}


.success-message,
.error-message,
.loading {
    display: none; /* Спочатку приховано */
    padding: 20px; /* Збільшення відступів всередині повідомлення */
    border-radius: 10px;
    text-align: center;
    width: 100%;
    max-width: 600px; /* Максимальна ширина повідомлення */
    font-size: 18px; /* Збільшення шрифту */
    font-weight: bold; /* Жирний шрифт */
    box-sizing: border-box;
    z-index: 9999; /* Щоб повідомлення відображалося поверх інших елементів */
    position: fixed; /* Фіксоване розташування */
    top: 50%; /* Центруємо по вертикалі */
    left: 50%; /* Центруємо по горизонталі */
    transform: translate(-50%, -50%); /* Точне центрування */
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 15px;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 15px;
}

.loading {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 15px;
}

/* �ед�а-запи�и дл� моб�л�ни� п�и���о�в */
@media (max-width: 600px) {
    body {
        justify-content: center; /* Цен���ванн� �о�ми */
        align-items: flex-start; /* �о�ина� �о�м� з ве��� */
    }

    form,
    .success-message,
    .error-message,
    .loading {
        width: calc(100% - 20px); /* �ода�мо �и�ин� 100% дл� �о�ми �а пов�домлен�, змен���мо на 20px дл� в�д���п� */
        max-width: none; /* �аби�а�мо обмеженн� на мак�имал�н� �и�ин� */
        margin: 10px; /* �ода�мо в�д���п */
        border-radius: 15px; /* �бе��га�мо зак��гленн� к���в */
        overflow-y: auto; /* �ода�мо п�ок����ванн� дл� випадк�в, коли кон�ен� не вм�������� */
    }

    .form-group {
        margin-bottom: 10px;
        text-align: center; /* �и��вн�ванн� �ек��� по �ен��� */
    }

    label {
        font-size: 14px; /* �мен���мо �озм�� ��и��� */
        margin-bottom: 5px;
        display: block; /* �абезпе���мо, �о label займа� ве�� ��док */
        width: 100%;
        text-align: center; /* �ода�мо ви��вн�ванн� �ек��� по �ен��� */
    }

    input, select, textarea {
        padding: 8px; /* �мен���мо в�д���пи дл� моб�л�ни� п�и���о�в */
    }

    input[type="submit"] {
        padding: 8px; /* �мен���мо в�д���пи дл� моб�л�ни� п�и���о�в */
    }
}

/* С�ил� дл� �� */
@media (min-width: 601px) {
    .form-group {
        display: flex;
        align-items: center;
    }

    label {
        flex: 1;
        margin-right: 15px;
        margin-bottom: 0;
    }

    input, select, textarea {
        flex: 2;
        margin-bottom: 0;
    }
}
