/* Основные стили для формы */
.calculation-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    margin-top: 40px;
}

.calculation-header {
    text-align: center;
}

.form-row {
    position: relative;
    margin-bottom: 25px;
}

.block-column {
    width: calc(50% - 10px);
}


.form-label {
    position: absolute;
    top: 8px;
    left: 12px;
    font-size: 12px;
    color: #666;
    background: white;
    padding: 0 5px;
    z-index: 1;
    width: auto;
    pointer-events: none;
    transition: all 0.2s ease;
    margin-bottom: 0 !important;
}

.form-select-label {
    position: absolute;
    top: -20px;
    left: 12px;
    font-size: 12px;
    color: #666;
    background: white;
    padding: 0 5px;
    z-index: 1;
    width: auto;
    pointer-events: none;
    transition: all 0.2s ease;
    margin-bottom: 0 !important;
}

.form-field {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.form-control, .form-select {
    padding: 22px 12px 8px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px;
    height: auto !important;
    background-color: white !important;
    width: 100% !important;
}

.form-control:focus, .form-select:focus {
    border-color: #2a7fbd !important;
    outline: none !important;
    box-shadow: 0 0 0 0.2rem rgba(42, 127, 189, 0.25) !important;
}

.form-select:disabled {
    /* Неактивное окно */
    background-color: #f0f0f0 !important;  /* Серый фон */
    color: #555 !important;                /* Темно-серый текст */
    cursor: not-allowed !important;        /* Курсор "недоступно" */
}

.form-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Кнопка расчета */
.submit-button {
    display: block;
    margin: 25px auto 0;
    padding: 10px 30px;
    background-color: #2a7fbd;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.submit-button:hover {
    background-color: #1e6ea7;
}

.result-container{
    padding-top: 15px;
    max-width: 1000px
}

.image-center {
    text-align: center;
}


.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

.is-invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.error-message {
    margin-top: 0.5rem;
}

.custom-fieldset {
    border: 2px solid #2a7fbd;
    border-radius: 4px;
    padding: 25px 20px 20px;
    margin: 30px 0;
    position: relative;
    background: white;
}

.custom-fieldset legend {
    position: absolute;
    width: auto !important;  /*ДЛЯ ИЗМЕНЕНИЯ ПОВЕДЕНИЯ BOOTSTRAP*/
    float: none !important;
    top: -12px;
    background: white;
    
    padding: 0 10px;
    font-size: 16px;
    font-weight: 600;
    color: #2a7fbd;
    margin: 0;
    line-height: 1;
}

/* Стили для радио-кнопок и чекбоксов */
.form-radio-group-horizontal {
    display: flex;
    gap: 15px;
}

.form-check-inline {
    margin-right: 0;
}

.open-flange-modal{
    margin-bottom: 30px;
}


.modal-content {
    overflow: auto; /* Важно для float */
}

.columns-container {
    display: flow-root; /* Modern clearfix */
    margin-bottom: 20px;
}


/* Адаптивность */
@media (max-width: 768px) {
    .form-row {
        margin-bottom: 20px;
    }
    
    .form-control, .form-select {
        padding: 20px 10px 6px;
    }
    
    .form-label {
        font-size: 11px;
        top: 6px;
        left: 10px;
    }
}