﻿/* ===== Общие ===== */

/* Центрируем заголовки */
.text-center {
    text-align: center;
    padding-top: 40px;
}

/* Футер */
footer {
    padding: 10px 0;
    font-size: 14px;
    background-color: #f8f9fa;
    border-top: 1px solid #ddd;
    text-align: center;
}

    footer .container {
        text-align: center;
    }

/* Структура страницы */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* ===== Кнопки: общий стиль ===== */
.button-style {
    font-size: 16px;
    padding: 12px 20px;
    border-radius: 8px;
    background-color: #75DDDD;
    color: black;
    border: none;
    cursor: pointer;
    text-align: center;
    white-space: normal;
    width: 100%;
    font-weight: 600;
}

    .button-style:hover {
        background-color: #61A0A8;
    }

.button-danger {
    background-color: #FF99AD;
}

    .button-danger:hover {
        background-color: #FF5C7C;
    }

/* ===== Первая страница: кнопки ===== */
.button-group {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 60px;
    margin-bottom: 40px;
}

.button-form {
    width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    box-sizing: border-box;
    gap: 10px;
}

    .button-form button {
        font-size: 18px;
        padding: 12px 24px;
    }

    .button-form p {
        margin: 0;
        color: green;
        font-weight: bold;
        text-align: center;
        font-size: clamp(12px, 1.6vw, 16px);
        line-height: 1.2;
        word-wrap: break-word;
        white-space: normal;
        overflow-wrap: break-word;
    }

/* ===== Вторая страница: сетка ===== */
.fixed-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px 30px;
    max-width: 1000px;
    margin: 60px auto;
    justify-items: center;
    padding: 0 10px;
}

    .fixed-grid button {
        max-width: 180px;
        width: 100%;
        font-size: 15px;
    }

/* ===== Обёртка формы ===== */
.form-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0 10px;
    margin-bottom: 60px;
}

/* ===== Input + Submit ===== */
.form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
}

.input-form {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 0 15px;
}

.input-form-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center;
    width: 100%;
}

.input-field {
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
    width: 600px;
    box-sizing: border-box;
}

.submit-button {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 8px;
    background-color: #0050cc;
    color: white;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

    .submit-button:hover {
        background-color: #003f99;
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
    }

/* ===== Сообщения ===== */
.message-placeholder {
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.button-message {
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    color: #2e7d32;
    font-weight: bold;
    font-size: 16px;
    margin: 0;
    text-align: center;
}

    .button-message.show {
        opacity: 1;
    }

/* ===== Мобильная адаптация ===== */
@media (max-width: 768px) {
    .input-form,
    .input-form-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .input-field,
    .submit-button {
        width: 100%;
    }

    .button-group {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .fixed-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px 15px;
    }

        .fixed-grid button {
            max-width: none;
            font-size: 14px;
        }

            /* Переупорядочивание кнопок на мобильных */
            .fixed-grid button:nth-child(1) {
                grid-column: 1;
                grid-row: 1;
            }

            .fixed-grid button:nth-child(2) {
                grid-column: 1;
                grid-row: 2;
            }

            .fixed-grid button:nth-child(3) {
                grid-column: 1;
                grid-row: 3;
            }

            .fixed-grid button:nth-child(4) {
                grid-column: 1;
                grid-row: 4;
            }

            .fixed-grid button:nth-child(5) {
                grid-column: 1;
                grid-row: 5;
            }

            .fixed-grid button:nth-child(6) {
                grid-column: 2;
                grid-row: 1;
            }

            .fixed-grid button:nth-child(7) {
                grid-column: 2;
                grid-row: 2;
            }

            .fixed-grid button:nth-child(8) {
                grid-column: 2;
                grid-row: 3;
            }

            .fixed-grid button:nth-child(9) {
                grid-column: 2;
                grid-row: 4;
            }

            .fixed-grid button:nth-child(10) {
                grid-column: 2;
                grid-row: 5;
            }

    .message-placeholder {
        margin-top: 10px;
    }

    .button-group .button-form + .button-form {
        margin-top: -50px;
    }
}
