/* styles.css */

input[type="number"].invalid {
    border: 2px solid red;
}

input[type="number"].valid {
    border: 2px solid #9A7A3F;
}

/* Основные стили */
body {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    background: #f4f3ef;
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a {
    color: #9A7A3F;
    text-decoration: none;
}

h3 {
    color: #9A7A3F;
    font-size: 22px;
    margin-top: 20px;
    margin-bottom: 20px;
    font-weight: 700;
    text-align: left;
}

label {
    font-size: 16px;
    color: #555;
    font-weight: 600;
    cursor: pointer;
}

input[type="text"],
input[type="number"],
input[type="tel"] {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    background: #f0f0f0;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus {
    border-color: #9A7A3F;
    outline: none;
}

#user-phone {
    padding: 12px;
    font-size: 16px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, background 0.3s ease;
}

#user-phone:focus {
    border-color: #9A7A3F;
    background: #eafaf2;
    outline: none;
}

button {
    background-color: #23272a;
    color: #fff;
    padding: 10px 15px;
    font-size: 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

button:hover {
    background-color: #111416;
}

/* Чекбоксы и радиокнопки */
input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    width: 25px;
    height: 25px;
    border: 2px solid #ddd;
    border-radius: 50%; /* Радиокнопки */
    background-color: #fff;
    transition: background-color 0.3s, border-color 0.3s;
    cursor: pointer;
}

input[type="checkbox"]:checked {
    background-color: #9A7A3F;
    border-color: #9A7A3F;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"%3E%3Cpath d="M20.292 6.708a1 1 0 010 1.414l-9 9a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L10 14.586l8.586-8.586a1 1 0 011.414 0z"/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
}

input[type="radio"]:checked {
    background-color: #9A7A3F;
    border-color: #9A7A3F;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    font-size: 16px;
}

/* Контейнер для изображения и полей ввода */
.dimension-wrapper {
    display: flex; /* Размещаем элементы в строку */
    align-items: flex-start; /* Выравниваем элементы по верхнему краю */
    gap: 20px; /* Отступ между изображением и полями */
}

/* Стили для изображения */
#instruction-image img {
    max-width: 150px; /* Ограничиваем ширину изображения */
    height: auto; /* Сохраняем пропорции */
    border-radius: 5px; /* Скругляем углы */
}

/* Поля ввода */
#dimension-fields {
    flex-grow: 1; /* Занимает оставшееся место */
}

/* Поля ввода (индивидуальные стили) */
#dimension-fields label {
    display: block; /* Каждое поле с новой строки */
    margin-bottom: 10px; /* Отступ между полями */
    font-weight: bold;
    font-size: 16px;
}

#dimension-fields input {
    width: 100%; /* Поля растягиваются на всю ширину */
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    transition: border-color 0.3s ease;
}

#dimension-fields input:focus {
    border-color: #9A7A3F;
    outline: none;
}

/* Контейнер для формы выбора */
#calculation-form-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Контейнер для радиокнопок */
.radio-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap; /* Позволяет элементам переноситься на следующую строку */
    gap: 20px;
}

/* Блок радиокнопки с текстом и картинкой */
.radio-group {
    display: flex;
    flex-direction: column;
    width: 23%; /* Для размещения 4 элементов в ряд с отступами */
    box-sizing: border-box;
    position: relative; /* Для корректного позиционирования */
}

/* Радиокнопка и текст */
.radio-group label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #333;
    cursor: pointer;
}

/* Радиокнопка */
.radio-group input[type="radio"] {
    accent-color: #9A7A3F;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Картинка под текстом */
.radio-group img {
    margin-top: 10px;
    width: 100px;
    height: auto;
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-origin: left center; /* Устанавливаем точку трансформации слева по центру */
}

/* Эффект при наведении на картинку */
.radio-group img:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Выделенный текст при выборе радиокнопки */
.radio-group input[type="radio"]:checked + span {
    font-weight: bold;
    color: #9A7A3F;
}

/* Радиогруппы для дополнительных опций */
.radio-milling,
.radio-group2 {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Радиокнопка и текст для дополнительных опций */
.radio-milling label,
.radio-group2 label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    cursor: pointer;
}

/* Радиокнопка для дополнительных опций */
.radio-milling input[type="radio"],
.radio-group2 input[type="radio"] {
    accent-color: #9A7A3F;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Картинка под текстом для дополнительных опций */
.radio-milling img,
.radio-group2 img {
    margin-top: 10px;
    width: 100px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-origin: left center; /* Устанавливаем точку трансформации слева по центру */
}

/* Эффект при наведении на картинки для дополнительных опций */
.radio-milling img:hover,
.radio-group2 img:hover {
    transform: scale(5); /* Увеличение в 1.5 раза */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Выделенный текст при выборе радиокнопки для дополнительных опций */
.radio-group2 input[type="radio"]:checked + span,
.radio-milling input[type="radio"]:checked + span {
    font-weight: bold;
    color: #9A7A3F;
}

/* Таблицы */
table {
    font-size: 16px;
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ccc;
}

/* Кнопки добавления строк */
table button {
    font-size: 14px;
    padding: 8px 12px;
    margin-top: 10px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    #calculation-form-container {
        padding: 10px;
        max-width: 100%;
        margin: 10px auto;
        box-shadow: none; /* Убираем тень для экономии места */
    }

    h3 {
        font-size: 18px;
        margin-top: 15px;
        margin-bottom: 10px;
    }

    label {
        font-size: 14px;
    }

    input[type="text"],
    input[type="number"],
    input[type="tel"] {
        font-size: 14px;
        padding: 10px;
        margin-bottom: 15px;
    }

    button {
        font-size: 14px;
        padding: 8px 12px;
    }

    .radio-container {
        flex-direction: column; /* Переводим радиокнопки в столбик */
        gap: 20px;
    }

    .radio-group {
        width: 100%; /* Ширина 100% на мобильных */
    }

    .radio-group img {
        width: 80px; /* Уменьшаем размер изображения на мобильных */
    }

    .radio-group span {
        font-size: 14px;
    }

    .dimension-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    #instruction-image img {
        max-width: 100px;
        height: auto;
        margin-bottom: 10px;
    }

    #dimension-fields label {
        font-size: 14px;
    }

    #dimension-fields input {
        font-size: 14px;
    }

    /* Таблицы */
    table {
        font-size: 12px;
        width: 100%;
    }

    th, td {
        padding: 5px;
        text-align: center;
    }

    /* Кнопки добавления строк */
    table button {
        font-size: 12px;
        padding: 5px 10px;
    }

    /* Скрываем ненужные тени */
    button {
        box-shadow: none;
    }

    #user-info label {
        font-size: 14px;
    }

    #user-phone {
        padding: 10px;
        font-size: 14px;
    }

    /* Корректировка масштабирования изображений на мобильных */
    .radio-milling img,
    .radio-group2 img {
        transform: scale(1); /* Сброс масштабирования */
    }

    .radio-milling img:hover,
    .radio-group2 img:hover {
        transform: scale(1.2); /* Умеренное увеличение */
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }
}

/* Дополнительные медиазапросы для ещё меньших экранов */
@media (max-width: 480px) {
    h3 {
        font-size: 16px;
    }

    button {
        font-size: 14px;
        padding: 6px 10px;
    }

    .radio-group img,
    .radio-milling img,
    .radio-group2 img {
        width: 70px;
    }

    .dimension-wrapper {
        gap: 10px;
    }

    #instruction-image img {
        max-width: 80px;
    }
}
.label{
    display:flex;
    justify-content: space-between;
}
