.contact {
    position: relative;
    margin: 0 var(--section-gutter) var(--section-gap);
    padding: clamp(36px, 5vw, 60px) clamp(24px, 5vw, 60px);
    border-radius: var(--radius-lg);
    background: var(--gradient-primary-dark);
    color: var(--color-white);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    overflow: hidden;
    min-height: 560px;
}

.contact__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 520px;
    opacity: 0;
    transform: translateX(-32px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact__content.in {
    opacity: 1;
    transform: none;
}

.contact__title {
    font-family: var(--font-title);
    font-size: clamp(28px, 4.4vw, 40px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    color: var(--color-white);
    margin: 0;
}

.contact__desc {
    font-family: var(--font-body);
    font-size: clamp(14px, 1.1vw, 15px);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.contact__form {
    background: rgba(225, 229, 255, 1.0);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: var(--radius-md);
    padding: 24px 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.contact__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact__label {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
}

.contact__input,
.contact__select {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    padding: 11px 18px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
}

.contact__input::placeholder {
    color: #9a9a9a;
}

.contact__input:disabled {
    color: #9a9a9a;
    cursor: not-allowed;
}

.contact__select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23212121' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 42px;
    cursor: pointer;
}

.contact__input:focus,
.contact__select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(1, 16, 110, 0.1);
}

@supports (appearance: base-select) {
    .contact__select,
    .contact__select::picker(select) {
        appearance: base-select;
    }

    .contact__select::picker-icon {
        display: none;
    }

    .contact__select::picker(select) {
        border: 1px solid rgba(1, 16, 110, 0.1);
        border-radius: 16px;
        background: var(--color-white);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
        padding: 6px;
        margin-top: 8px;
        overflow: hidden;
    }

    .contact__select option {
        display: flex;
        align-items: center;
        gap: 8px;
        border-radius: 10px;
        padding: 10px 14px;
        font-size: 13px;
        color: var(--color-text);
        cursor: pointer;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .contact__select option:hover {
        background: var(--color-surface);
    }

    .contact__select option:checked {
        background: var(--color-accent);
        color: var(--color-white);
        font-weight: 500;
    }

    .contact__select option[disabled] {
        color: #9a9a9a;
    }

    .contact__select option::checkmark {
        display: none;
    }
}

.contact__status {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    margin: 0;
    padding: 9px 14px;
    border-radius: var(--radius-pill);
}

.contact__status[data-state="error"] {
    color: #b3261e;
    background: rgba(179, 38, 30, 0.1);
}

.contact__status[data-state="success"] {
    color: #146c2e;
    background: rgba(20, 108, 46, 0.1);
}

.contact__consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--color-text-soft);
    line-height: 1.45;
    text-align: left;
    margin: 4px 0 2px;
    cursor: pointer;
}

.contact__consent-checkbox {
    flex: none;
    width: 15px;
    height: 15px;
    margin: 1px 0 0;
    accent-color: var(--color-accent);
    cursor: pointer;
}

.contact__consent-link {
    text-decoration: underline;
}

.contact__consent-link:hover {
    color: var(--color-text);
}

/* honeypot — скрыто визуально и от скринридеров, но не display:none/hidden,
   чтобы простые боты, заполняющие все поля формы, попадались в ловушку */
.contact__hp {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    left: -9999px;
}

.contact__submit {
    width: 100%;
    padding: 12px 24px;
    background: var(--color-dark);
    color: var(--color-white);
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease, transform 0.2s ease;
}

.contact__submit:hover {
    background: #000;
    transform: scale(1.01);
}

.contact__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.contact__media {
    position: relative;
    z-index: 1;
    display: flex;

    align-items: flex-end;
    justify-content: center;
    bottom: -60px;
    opacity: 0;
    transform: translateX(32px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}

.contact__media.in {
    opacity: 1;
    transform: none;
}

.contact__media img {
    max-height: 560px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.25));
}

.contact__line {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: auto;
    max-height: none;
    z-index: 0;
    pointer-events: none;
    object-fit: contain;
    object-position: right center;
}

.contact__phone {
    position: relative;
    z-index: 1;

    aspect-ratio: 650 / 965;
}

@media (max-width: 900px) {
    .contact {
        grid-template-columns: 1fr;
        min-height: auto;
        gap: 20px;
    }

    .contact__content {
        max-width: 100%;
    }

    .contact__media {
        order: 2;
        bottom: 0;
        margin-top: 20px;
    }

    .contact__media img {
        max-height: 340px;
    }

    .contact__line {
        display: none;
    }
}

@media (max-width: 480px) {
    .contact__media {
        display: none;
    }

    /* Мобильная вёрстка по Figma-макету 402px */
    .contact__title {
        font-size: 20px;
        line-height: 1;
        letter-spacing: normal;
        text-align: center;
    }

    .contact__desc {
        font-size: 14px;
        line-height: 1.2;
        letter-spacing: -0.04em;
        text-align: center;
    }

    .contact__form {
        background: #e1e5ff;
        border-radius: 20px;
        padding: 20px;
        gap: 16px;
    }

    .contact__label {
        font-size: 14px;
        font-weight: 400;
        color: var(--color-text);
    }

    .contact__input,
    .contact__select {
        height: 42px;
        font-size: 14px;
        padding: 0 20px;
    }

    .contact__select {
        padding-right: 44px;
    }

    .contact__consent {
        font-size: 14px;
        letter-spacing: -0.04em;
        line-height: 1.2;
    }

    .contact__submit {
        height: 42px;
        font-size: 14px;
        font-weight: 500;
    }
}
