/* === ОСНОВНЫЕ СТИЛИ === */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

h1, h2 {
    text-align: center;
}

.container {
    padding: 20px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
}

form label,
#requestForm p {
    font-size: 1.05rem;
    font-weight: 600;
    display: block;
    margin: 3px 0 2px;
    text-align: center;
}

select,
input[type="number"],
input[type="text"],
button {
    padding: 14px 16px;
    font-size: 1em;
    border-radius: 12px;
    border: 1px solid #ccc;
    width: 90%;
    max-width: 320px;
    box-sizing: border-box;
    display: block;
    margin: 3px auto;
    transition: 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: #5cb85c;
    outline: none;
    box-shadow: 0 0 6px rgba(92, 184, 92, 0.5);
}

/* Удаляем стрелочки у number */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

/* Плотнее select */
form select {
    margin-bottom: 6px;
    padding: 10px;
}

/* Кнопки */
button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

.submit-button-active {
    background-color: #007bff !important;
    color: white !important;
    padding: 12px 20px;
    font-size: 1.1em;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
}

.submit-button-inactive {
    background-color: #ccc;
    color: white;
    padding: 12px 20px;
    font-size: 1.1em;
    border: none;
    border-radius: 12px;
    cursor: not-allowed;
}

.submit-button-active:hover {
    filter: brightness(1.1);
}

/* Результат расчёта */
.result-box {
    margin-top: 30px;
    padding: 20px;
    border: 2px solid #007bff;
    border-radius: 15px;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

/* Мобильная адаптация */
@media (max-width: 600px) {
    body {
        font-size: 14px;
    }
    form {
        width: 100%;
    }
    select,
    input,
    button {
        width: 100%;
    }
}

/* Анимации и утилиты */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: shake 0.4s;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

select {
    max-height: 180px;
    overflow-y: auto;
}

select:focus {
    outline: none;
}


#phoneInput {
    text-align: center;
    font-size: 1.2em;
}

#requestForm p {
    margin: 10px 0 4px;
}

select {
    scroll-margin-bottom: 250px; /* поднимаем при фокусе */
}

.selected-option {
    padding: 14px 16px;
    border-radius: 12px;
    text-align: left;
}

.options-container div {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.options-container div:last-child {
    border-bottom: none;
}

.options-container div:hover {
    background-color: #f1f1f1;
}

.custom-select {
    position: relative;
    width: 90%;
    max-width: 320px;
    margin: 6px auto;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 1em;
    box-sizing: border-box;
    background-color: #fff;
    cursor: pointer;
    display: block;
}


.options-container div {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.options-container div:hover {
    background: #f0f0f0;
}

.options-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-top: 4px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 10;
    position: relative;
}

.custom-file-upload {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    font-size: 0.95em;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 4px auto;
    text-align: center;
}

.custom-file-upload:hover {
    background-color: #0056b3;
}

.custom-file-upload + input[type="file"] {
    display: none;
}

.custom-file-upload.attached {
    background-color: #28a745;
}

.custom-file-upload.attached:hover {
    background-color: #218838;
}

select, input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    background-color: #fff;
    color: #000;
}
