/* ============================================
   CONTACT FORM — секция «Оставьте заявку»
   ============================================ */

.contact-form {
    position: relative;
    background: var(--surface-general-secondary);
    padding: 80px 0;
    overflow: hidden;
}

/* Декоративные SVG-фоны */
.contact-form__background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    color: var(--base-neutral-lightest);
}

.contact-form__shape {
    position: absolute;
    max-width: none;
}

.contact-form__shape--right {
    top: 0;
    width: 50%;
    height: 60%;
}

.contact-form__shape--left {
    bottom: 0;
    left: 0;
    width: 45%;
    height: 40%;
}

/* Контейнер */
.contact-form__container {
    position: relative;
    max-width: 1440px;
    margin: 0 auto;
    z-index: 1;
}

/* Карточка формы */
.contact-form__card {
    padding: 24px;
    border-radius: 16px;
    outline: 1px solid var(--border-secondary);
    outline-offset: -1px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
}

/* ===== ЛЕВАЯ КОЛОНКА: ИНФО ===== */
.contact-form__info {
    width: 472px;
    /* min-height: 453px; */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    align-self: stretch;
}

.contact-form__info-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.contact-form__title {
    color: var(--base-neutral-lightest);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.1;
    margin: 0;
}

.contact-form__badge {
    display: inline-flex;
    align-items: center;
    padding: 8px;
    background: var(--surface-general-accent-secondary);
    border-radius: 4px;
    color: var(--text-content-tertiary);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

/* Контакты */
.contact-form__contacts {
    display: flex;
    /* flex-direction: column; */
    gap: 12px;
}

.contact-form__contact-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--base-neutral-lightest);
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.2;
    transition: color 300ms var(--easing-gentle);
}

.contact-form__contact-row:hover {
    color: var(--surface-general-accent-primary);
}

.contact-form__contact-row .icon {
    fill: currentColor;
    flex-shrink: 0;
}

/* ===== ПРАВАЯ КОЛОНКА: ФОРМА ===== */
.contact-form__form-wrap {
    width: 714px;
    max-width: 714px;
    flex: 1 1 0;
    min-width: 288px;
    display: flex;
    flex-direction: column;
    gap: 48px;
    position: relative;
}

/* Обёртка CF7 */
.contact-form__form-wrap .wpcf7-form {
    display: contents;
}

.contact-form__form-wrap .wpcf7-form>p:empty {
    display: none;
}

/* Поля в строках */
.contact-form__fields {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.contact-form__row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.contact-form__row .input-field {
    flex: 1 1 0;
    min-width: 260px;
}

.contact-form__row .input-field:first-child {
    flex: 1 1 0;
}

/* Инпуты */
.contact-form__form-wrap .input-field__input {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-family-base);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--base-neutral-lightest);
    width: 100%;
    padding: 0;
}

.contact-form__form-wrap .input-field__input::placeholder {
    color: var(--base-neutral-lightest);
    opacity: 0.6;
}

.contact-form__form-wrap .input-field__wrapper {
    background: rgba(250, 250, 250, 0.08);
    border-radius: 8px;
    padding: 12px;
    outline: 1px solid transparent;
    outline-offset: -1px;
    position: relative;
    transition:
        background-color 300ms var(--easing-gentle),
        outline-color 300ms var(--easing-gentle);
}

.contact-form__form-wrap .input-field__wrapper>span {
    width: 100%;
}

.contact-form__form-wrap .input-field__wrapper:focus-within {
    background: rgba(250, 250, 250, 0.12);
    outline-color: var(--border-secondary);
}

/* Textarea */
.contact-form__form-wrap textarea.input-field__input {
    max-height: 100px;
    resize: vertical;
    font-family: inherit;
}

/* Label */
.contact-form__form-wrap .form-label {
    padding-bottom: 4px;
    padding-left: 12px;
    color: #E8E1E1;
}

/* Действия (чекбокс + кнопка) */
.contact-form__actions {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 48px;
}

.contact-form__consent-wrap {
    flex: 1 1 0;
    min-width: 288px;
    max-width: 714px;
}

.contact-form__consent-wrap .checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px;
}

.contact-form__consent-wrap .checkbox__indicator {
    flex-shrink: 0;
    margin-top: 2px;
}

.contact-form__consent-wrap .checkbox__label {
    flex: 1 1 0;
    font-size: 16px;
    line-height: 1.4;
    color: var(--text-content-primary);
}

.contact-form__consent-wrap .checkbox__label a {
    color: var(--text-link-hover);
    text-decoration: underline;
    transition: color 300ms var(--easing-gentle);
}

.contact-form__consent-wrap .checkbox__label a:hover {
    color: var(--surface-general-accent-primary);
}

.contact-form__submit {
    width: 188px;
    height: 56px;
    position: relative;
    overflow: hidden;
}

/* ===== ОШИБКИ ВАЛИДАЦИИ CF7 ===== */

/* CSS-страховка: если tip остался внутри wrapper (до работы JS), не ломает layout */
.contact-form__form-wrap .input-field__wrapper .wpcf7-not-valid-tip {
    display: block;
    position: absolute;
    left: 12px;
    bottom: -20px;
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-error-text);
    white-space: nowrap;
    pointer-events: none;
}

.contact-form__form-wrap .input-field__wrapper>.wpcf7-form-control-wrap .wpcf7-not-valid-tip {
    display: none;
}

/* Когда tip вынесен под .input-field (правильное поведение после работы JS) */
.contact-form__form-wrap .input-field>.wpcf7-not-valid-tip {
    display: block;
    position: static;
    padding: 8px 12px 0;
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-error-text);
    margin: 0;
}

/* Подсветка обёртки при ошибке */
.contact-form__form-wrap .input-field--error .input-field__wrapper {
    outline: 1px solid var(--text-error-text);
    outline-offset: -1px;
}

.contact-form__form-wrap .input-field--error .form-label {
    color: var(--text-error-text);
}

/* ===== СПИННЕР CF7 (внутри кнопки) ===== */
.contact-form__submit .wpcf7-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    margin: 0;
    background-image: none !important;
    background: transparent !important;
    border: 2px solid rgba(16, 16, 16, 0.25);
    border-top-color: var(--surface-general-secondary);
    border-radius: 50%;
    animation: zivert-spinner 0.7s linear infinite;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.contact-form__submit.has-spinner .wpcf7-spinner {
    display: block;
    opacity: 1;
    visibility: visible;
}

.contact-form__submit.has-spinner .button__label,
.contact-form__submit.has-spinner .button__icon-wrapper,
.contact-form__submit.has-spinner .button__text {
    visibility: hidden;
}

@keyframes zivert-spinner {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ===== СООБЩЕНИЯ ФОРМЫ (response-output) ===== */
.contact-form__messages {
    min-height: 0;
}

.contact-form__messages .wpcf7-response-output {
    margin: 0;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    transition: opacity 300ms var(--easing-gentle);
}

.contact-form__messages .wpcf7-response-output:empty {
    display: none;
}

/* Ошибки валидации / спам / неудача */
.contact-form__messages .wpcf7-validation-errors,
.contact-form__messages .wpcf7-spam-blocked,
.contact-form__messages .wpcf7-mail-sent-ng,
.contact-form__messages .wpcf7-aborted {
    background: rgba(255, 133, 131, 0.15);
    color: var(--text-error-text);
}

/* Успешная отправка */
.contact-form__messages .wpcf7-mail-sent-ok {
    background: rgba(153, 185, 0, 0.15);
    color: var(--surface-general-accent-primary);
}

/* ===== SUCCESS-ЭКРАН ===== */
.contact-form__success {
    position: absolute;
    inset: 0;
    background: var(--surface-general-secondary);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    text-align: center;
    padding: 24px;
    border-radius: 8px;
    z-index: 10;
}

.contact-form__success--visible {
    display: flex;
}

.contact-form__success-icon {
    color: var(--surface-general-accent-primary);
}

.contact-form__success-icon .icon {
    width: 64px;
    height: 64px;
    fill: currentColor;
}

.contact-form__success-title {
    color: var(--base-neutral-lightest);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

.contact-form__success-text {
    color: #E8E1E1;
    font-size: 16px;
    line-height: 1.4;
    margin: 0;
    max-width: 400px;
}

.contact-form__success-close {
    margin-top: 8px;
}

/* ===== АДАПТИВ: ПЛАНШЕТ (835-1440) ===== */
@media (max-width: 1440px) {
    .contact-form {
        padding: 60px 0;
    }

    .contact-form__container {
        padding: 0 40px;
    }

    .contact-form__info {
        width: 40%;
        min-height: auto;
    }

    .contact-form__form-wrap {
        width: 55%;
        max-width: none;
    }

    .contact-form__title {
        font-size: 24px;
    }

    .contact-form__shape--right {
        width: 100%;
        top: 0;
        right: 50%;
        height: auto;
    }

    .contact-form__shape--left {
        width: 100%;
        left: -70%;
        bottom: 0;
        height: auto;
    }
}

/* ===== АДАПТИВ: МОБИЛЬНЫЙ (≤834) ===== */
@media (max-width: 834px) {
    .contact-form {
        padding: 40px 0;
    }

    .contact-form__container {
        padding: 0 16px;
    }

    .contact-form__card {
        flex-direction: column;
        gap: 24px;
    }

    .contact-form__info {
        width: 100%;
    }

    .contact-form__form-wrap {
        width: 100%;
    }

    .contact-form__title {
        font-size: 22px;
    }

    .contact-form__row {
        flex-direction: column;
    }

    .contact-form__row .input-field {
        min-width: 100%;
    }

    .contact-form__submit {
        width: 100%;
    }
    .contact-form__contacts{
        flex-direction: column;
    }



}