/*
 * hero_callback — кастомный hero-блок (по Figma 437:1414).
 * Frame внутри УТП 1280×760: УТП-плашка и форма расположены справа,
 * колонка 640px (Figma координаты x=886..1526). Между плашкой и
 * формой — соединительный треугольник (Polygon 3, 49×33), указывающий вниз.
 *
 * Префикс `.home-main > .hero_callback` нужен для перебивания правил
 * из global.css (`.home-main > *` имеет ту же специфичность, но грузится
 * позже module-css → побеждает). Поднимаем специфичность через имя класса.
 */

.hero_callback {
    position: relative;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: #fff;
    overflow: hidden;
}

.home-main > .hero_callback {
    /* full-bleed escape: фон растягиваем на всю ширину viewport,
       нейтрализуя padding-inline и max-width родителя */
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0;
    min-height: 760px;
}

.hero_callback__inner {
    position: relative;
    z-index: 1;
    max-width: var(--container-max, 1200px);
    margin: 0 auto;
    /* справа без отступа — карточка-форма приклеена к правому краю 1200px,
       так же как иконка корзины в шапке */
    padding: 0 0 0 var(--container-pad, 16px);
    display: grid;
    grid-template-columns: 1fr minmax(0, 640px);
    align-items: center;
    min-height: 760px;
}

.hero_callback__column {
    grid-column: 2;
    width: 640px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

/* ============== УТП плашка (Figma Frame 4 / 640×296) ============== */
.hero_callback__usp {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    width: 100%;
    height: 296px;
    padding: 60px 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero_callback__usp-title {
    margin: 0;
    font-family: "Lato", "Gotham Pro", system-ui, sans-serif;
    font-weight: 300;
    font-size: 55px;
    line-height: 1.1;
    color: inherit;
    letter-spacing: -0.005em;
}

.hero_callback__usp-subtitle {
    margin: 0;
    font-family: "Lato", system-ui, sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.3;
    color: inherit;
}

/* ============== Белая карточка с формой (Figma Frame заявка / 640×263) ============== */
.hero_callback__card {
    position: relative;
    background: #fff;
    color: #2D3553;
    width: 100%;
    height: 263px;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Polygon 3 (Figma 437:1463) — белый треугольник 49×33 в зазоре между плашкой
   и формой, на координате x=1181 (≈ центр колонки 640px), указывает вниз. */
.hero_callback__card-arrow {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -23px;
    width: 36px;
    height: 24px;
    background: #fff;
    clip-path: polygon(0 100%, 100% 100%, 50% 0);
}

.hero_callback__card-title {
    margin: 0;
    font-family: "Lato", system-ui, sans-serif;
    font-weight: 300;
    font-size: 35px;
    line-height: 1.2;
    color: #191E32;
}

/* ============== Форма ============== */
.hero_callback__form {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
    flex: 1;
}

.hero_callback__field {
    display: flex;
    align-items: stretch;
    height: 55px;
    background: transparent;
    gap: 16px;
}

.hero_callback__input {
    appearance: none;
    flex: 1;
    min-width: 0;
    background: transparent;
    color: #191E32;
    border: 0;
    border-bottom: 2px solid #C7CCD4;
    border-radius: 0;
    outline: none;
    padding: 0 0 6px;
    font: inherit;
    font-family: "Lato", system-ui, sans-serif;
    font-weight: 300;
    font-size: 18px;
    line-height: 1.2;
    transition: border-color 0.2s ease;
}

.hero_callback__input::placeholder {
    color: rgba(45, 53, 83, 0.55);
    font-weight: 300;
}

.hero_callback__input:focus {
    border-bottom-color: var(--color-accent, #FF644B);
}

.hero_callback__submit {
    appearance: none;
    cursor: pointer;
    background: var(--color-accent, #FF644B);
    color: #fff;
    border: 0;
    padding: 0 28px;
    font: inherit;
    font-family: "Lato", system-ui, sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.hero_callback__submit:hover {
    background: var(--color-accent-hover, #FF755E);
}

.hero_callback__submit[disabled] {
    background: #C7CCD4;
    cursor: not-allowed;
}

/* ============== Согласие ============== */
.hero_callback__consent {
    display: flex;
    gap: 10px;
    align-items: center;
    cursor: pointer;
    height: 36px;
    font-family: "Lato", system-ui, sans-serif;
    font-weight: 300;
    font-size: 15px;
    line-height: 1.2;
    color: rgba(45, 53, 83, 0.85);
    margin-top: auto;
}

.hero_callback__consent input[type="checkbox"] {
    appearance: none;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin: 0;
    border: 1px solid #C7CCD4;
    border-radius: 0;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.hero_callback__consent input[type="checkbox"]:checked {
    background: var(--color-accent, #FF644B);
    border-color: var(--color-accent, #FF644B);
}

.hero_callback__consent input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 0;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.hero_callback__consent-text {
    flex: 1;
}

/* ============== Состояния ============== */
.hero_callback__error {
    margin: 0;
    padding: 8px 12px;
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #b62232;
    font-size: 13px;
}

.hero_callback__error[hidden] { display: none; }

.hero_callback__success { padding: 0; }
.hero_callback__success[hidden] { display: none; }

.hero_callback__success-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #191E32;
}

.hero_callback__success-text {
    margin: 0;
    color: #2D3553;
    line-height: 1.45;
}

/* ============== Адаптивы ============== */
@media (max-width: 991px) {
    .home-main > .hero_callback {
        min-height: 0;
    }

    .hero_callback__inner {
        grid-template-columns: 1fr;
        min-height: 0;
        padding-block: 56px;
        align-items: stretch;
    }

    .hero_callback__column {
        grid-column: 1;
        width: 100%;
        max-width: 640px;
        margin-inline: auto;
    }

    .hero_callback__usp {
        height: auto;
        padding: 32px 24px;
        gap: 16px;
    }

    .hero_callback__usp-title { font-size: 36px; }

    .hero_callback__card {
        height: auto;
        padding: 28px 24px;
        gap: 20px;
    }

    .hero_callback__card-title { font-size: 26px; }
}

@media (max-width: 767px) {
    .hero_callback__inner { padding-block: 40px; }

    .hero_callback__usp {
        padding: 24px 20px;
        gap: 12px;
    }

    .hero_callback__usp-title { font-size: 28px; }
    .hero_callback__usp-subtitle { font-size: 16px; }

    .hero_callback__card {
        padding: 24px 20px;
        gap: 16px;
    }

    .hero_callback__card-title { font-size: 22px; }

    .hero_callback__field {
        flex-direction: column;
        height: auto;
        gap: 16px;
    }

    .hero_callback__submit {
        padding: 14px 24px;
        width: 100%;
    }
}
