/* ============================================
   Стили для формы заказа прайс-листа
   ============================================ */

/* Заголовок с баннером — фон zayvka_bg.png, сверху картинка и название по макету */
.price-header {
    margin-bottom: 30px;
    border-top: 3px solid #003366;
    background: url('../images/zayvka_bg.png') no-repeat center;
    background-size: cover;
    min-height: 140px;
    display: flex;
    align-items: stretch;
}

.price-header .row {
    width: 100%;
    margin: 0;
    align-items: stretch;
}

.price-header .row [class*="col-"] {
    padding: 0;
}

.price-banner-left {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    flex: 1;
    min-height: 140px;
}

.price-category-image {
    width: 110px;
    height: 110px;
    min-width: 110px;
    background-color: #fff;
    border: 2px solid #0066cc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 24px;
    flex-shrink: 0;
}

.price-category-image img {
    max-width: 90px;
    max-height: 90px;
    object-fit: contain;
}

.price-banner-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}

.price-label {
    font-size: 32px;
    font-family: 'Century Gothic', 'CenturyGothic', AppleGothic, sans-serif;
    line-height: 1.2;
}

.price-category-name {
    font-size: 32px;
    font-family: 'Century Gothic', 'CenturyGothic', AppleGothic, sans-serif;
    text-transform: lowercase;
}

.price-banner-right {
    display: flex;
    align-items: center;
    min-height: 140px;
    justify-content: flex-end;
    margin-right: 18px;
}

.price-banner-right p {
    color: #fff;
    font-size: 26px;
    font-family: 'Century Gothic', 'CenturyGothic', AppleGothic, sans-serif;
    margin: 0;
    line-height: 1.4;
    text-align: right;
}

/* Форма — по макету: пунктирная синяя рамка */
.price-request-form {
    background-color: var(--white);
    padding: 30px;
    border-radius: 0;
    border: 2px solid #000;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-family: 'Century Gothic', 'CenturyGothic', AppleGothic, sans-serif;
    display: block;
    width: 200px;
    text-align: left;
}

.required-star {
    color: #dc3545;
    font-weight: bold;
    margin-left: 3px;
}

/* Расположение полей: метка слева, поле справа */
.form-row-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-field-group {
    display: flex;
    align-items: stretch;
    border-bottom: none;
    border-radius: 0;
    margin-bottom: 15px;
}

.form-field-group:last-child {
    margin-right: 0px!important;
}

.form-field-group .form-label {
    flex-shrink: 0;
    margin-bottom: 0;
    width: 280px;
    border: 1px solid #989898;
    background-color: var(--white);
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #1a237e;
    text-align: center;
    justify-content: center;
}

.form-field-group .form-control,
.form-field-group .phone-input-group,
.form-field-group .inn-input-group {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #989898;
    background-color: var(--white);
}

.form-field-group .form-control {
    background-color: transparent;
    border: 1px solid #989898;
    margin-left: 15px;
    font-family: 'Century Gothic', 'CenturyGothic', AppleGothic, sans-serif;
    text-align: center;
    color: #989898;
    font-size: 22px;
    padding: 0;
}

.form-field-group .phone-input-group,
.form-field-group .inn-input-group {
    margin-left: 15px;
    display: flex;
    align-items: center;
    gap: 0px;
    padding: 5px;
    background-color: transparent;
    justify-content: center;
}

/* Разделитель после выбора типа лица — пунктирная синяя линия по макету */
.form-group-person-type {
    margin-bottom: 0;
}

.form-section-separator {
    height: 0;
    border: none;
    border-bottom: 2px dashed #0066cc;
    margin: 0 0 25px 0;
}

/* Выбор типа лица — три отдельных блока в рамках с отступами между ними */
.person-type-selector {
    display: flex;
    gap: 15px;
    margin-top: 0;
    align-items: stretch;
}

.person-type-selector input[type="radio"] {
    display: none;
}

/* Первый блок — «Выберите необходимое» в своей рамке */
.person-type-label {
    padding: 12px 20px;
    border: 1px solid #989898;
    background-color: var(--white);
    color: #1a237e;
    font-family: 'Century Gothic', 'CenturyGothic', AppleGothic, sans-serif;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: center;
    width: 280px;
}

/* Кнопки «Физ лицо» и «Юр лицо» — каждая в своей рамке с отступом */
.person-type-btn {
    padding: 12px 30px;
    border: 1px solid #989898;
    background-color: var(--white);
    color: #1a237e;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Century Gothic', 'CenturyGothic', AppleGothic, sans-serif;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    margin: 0;
}

.person-type-selector input[type="radio"]:checked + .person-type-btn,
.person-type-btn.active {
    background-color: #FFC887;
    color: #1a237e;
}

.person-type-btn:hover:not(.active) {
    background-color: #f5f5f5;
}

/* Секции формы — рамка #989898, без закругления, как в макете */
.form-section {
    background-color: var(--white);
    padding: 0;
    border-radius: 0;
    margin-top: 15px;
}

/* Блоки адресов: слева заголовок в рамке, справа один блок с полями (как в макете) */
.address-section {
    display: flex;
    align-items: stretch;
    gap: 15px;
    border: none;
    padding: 0;
    margin-bottom: 30px;
}

.address-block-label {
    width: 280px;
    min-width: 200px;
    flex-shrink: 0;
    border: 1px solid #989898;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-blue);
    background-color: var(--white);
    font-family: 'Century Gothic', 'CenturyGothic', AppleGothic, sans-serif;
    text-align: center;
}

.address-block-fields {
    flex: 1;
    border: 1px solid #989898;
    border-radius: 0;
}

.address-block-fields .form-row-layout {
    margin: 0;
    padding: 8px;
}
.address-block-fields .form-field-group .form-label
{
    width: 120px;
}
/* Дом, индекс, строение/корпус в одну строку (как в макете) */
.form-row-inline {
    display: flex;
    flex-wrap: nowrap;
}

.form-row-inline .form-field-group {
    flex: 1;
    min-width: 0;
    margin-right: 15px;
}

.form-row-inline .form-field-group:not(:last-child) {
    border-right: none;
}


.form-label-two-lines {
    line-height: 1.3;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0;
    padding: 12px 15px;
    border-bottom: 1px solid #989898;
    background-color: var(--white);
    font-family: 'Century Gothic', 'CenturyGothic', AppleGothic, sans-serif;
}

.form-control {
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 16px;
    width: 100%;
    background-color: transparent;
    outline: none;
}

.form-control:focus {
    outline: none;
    box-shadow: none;
}

.form-control.is-invalid,
.form-field-group.is-invalid .form-control {
    background-color: #ffe6e6;
}

.form-field-group.is-invalid {
    border-color: #dc3545;
    background-color: #fff5f5;
}

/* Телефон с отдельными боксами */
.phone-input-group {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 0;
}

.phone-digit {
    width: 35px;
    height: 35px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    border: 1px solid #989898;
    border-radius: 0;
    padding: 0;
    background-color: var(--white);
}

/* Отступ после первой цифры */
.phone-digit:nth-child(1) {
    margin-right: 10px;
}

/* Отступ после четвертой цифры (после трех следующих) */
.phone-digit:nth-child(4) {
    margin-right: 10px;
}

.phone-digit:focus {
    border-color: var(--primary-blue);
    outline: none;
    box-shadow: none;
    background-color: #f0f8ff;
}

.phone-digit.is-invalid {
    border-color: #dc3545;
    background-color: #ffe6e6;
}

.phone-input-group.has-error .phone-digit {
    border-color: #dc3545;
    background-color: #ffe6e6;
}

/* ИНН с отдельными боксами */
.inn-input-group {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 0;
}

.inn-digit {
    width: 35px;
    height: 35px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    border: 1px solid #989898;
    border-radius: 0;
    padding: 0;
    background-color: var(--white);
}

.inn-digit:focus {
    border-color: var(--primary-blue);
    outline: none;
    box-shadow: none;
    background-color: #f0f8ff;
}

.inn-digit.is-invalid {
    border-color: #dc3545;
    background-color: #ffe6e6;
}

.inn-input-group.has-error .inn-digit {
    border-color: #dc3545;
    background-color: #ffe6e6;
}

/* Кнопка сохранения */
.form-actions {
    margin-top: 30px;
}

.btn-save-price {
    background-color: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 15px 50px;
    font-size: 20px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'Century Gothic', 'CenturyGothic', AppleGothic, sans-serif;
}

.btn-save-price:hover {
    background-color: #0052a3;
    color: var(--white);
}

/* Сообщение об успехе */
.price-success-message {
    background: linear-gradient(180deg, #003366 0%, #0066cc 100%);
    padding: 60px 40px;
    border-radius: 8px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-content {
    text-align: center;
    color: var(--white);
}

.success-text {
    font-size: 24px;
    font-weight: 500;
    font-family: 'Century Gothic', 'CenturyGothic', AppleGothic, sans-serif;
    margin-bottom: 8px;
    line-height: 1.3;
}

.success-spacer {
    height: 30px;
}

.success-spacer-large {
    height: 60px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .person-type-label{
        width: 100%;
    }
    .price-header {
        flex-direction: column;
        min-height: auto;
        background-size: cover;
        background-position: center;
    }
    
    .price-banner-left {
        flex-direction: column;
        text-align: center;
        min-height: auto;
        padding: 20px;
    }
    
    .price-category-image {
        margin-right: 0;
        margin-bottom: 12px;
        width: 90px;
        height: 90px;
        min-width: 90px;
    }
    
    .price-category-image img {
        max-width: 70px;
        max-height: 70px;
    }
    
    .price-label {
        font-size: 26px;
    }
    
    .price-category-name {
        font-size: 18px;
    }
    
    .price-banner-right {
        min-height: auto;
        max-width: none;
        padding: 16px 20px;
        text-align: center;
    }
    
    .price-banner-right p {
        padding-left: 0;
        font-size: 14px;
    }
    
    .person-type-selector {
        flex-direction: column;
    }
    
    .person-type-btn {
        width: 100%;
        text-align: center;
    }
    .form-row-inline .form-field-group {
        flex: 1;
        min-width: 0;
        margin-right: 0px; 
    }
    /* Мобильная версия полей формы */
    .form-field-group {
        flex-direction: column;
        align-items: flex-start;
    }
    .address-block-fields .form-field-group {
        flex-direction: row;
    }
    .form-field-group .form-label {
        margin-bottom: 0;
        width: 100%;
        border-right: 1px solid #989898;
        padding: 12px 20px;
        border: 1px solid #000;
        background-color: var(--white);
        color: #1a237e;
        font-family: 'Century Gothic', 'CenturyGothic', AppleGothic, sans-serif;
        font-weight: normal;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        flex-shrink: 0;
        text-align: center;
    }
    
    .form-field-group .form-control,
    .form-field-group .phone-input-group,
    .form-field-group .inn-input-group {
        width: 100%;
        HEIGHT: 52PX;
        padding: 11px 20px;
        margin: 0;
    }

    div#phone-input-group {
        padding: 11px 0px;
    }

    .phone-input-group {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .phone-digit {
        width: 27px;
        height: 27px;
        font-size: 16px;
    }
    .phone-digit:nth-child(1) {
        margin-right: 3px;
    }
    .inn-input-group {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .inn-digit {
        width: 27px;
        height: 27px;
        font-size: 16px;
    }
    
    .form-section {
        margin-bottom: 20px;
    }
    
    .address-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .address-block-label {
        width: 100%;
        min-width: 0;
        padding: 10px 15px;
        font-size: 16px;
    }
    
    .form-row-inline {
        flex-direction: column;
    }
    
    .form-row-inline .form-field-group + .form-field-group {
        border-left: 1px solid #989898;
        border-top: none;
        border-right: 1px solid #989898;
    }
    
    .form-row-inline .form-field-group:not(:last-child) {
        border-right: 1px solid #989898;
    }
    
    .section-title {
        font-size: 16px;
        padding: 10px 15px;
    }
    
    .price-request-form {
        padding: 15px;
    }
    
    .success-text {
        font-size: 18px;
    }
    
    .price-success-message {
        padding: 40px 20px;
        min-height: auto;
    }
}
