/* ============================================
   POPUP (feedback + tour)
   ============================================ */

.fancybox-container {
    -webkit-backface-visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transform: translateZ(0);
    z-index: 99992;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.fancybox-container.fancybox-is-open {
    opacity: 1;
}

.fancybox-container * {
    box-sizing: border-box;
}

.fancybox-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #000;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.fancybox-is-open .fancybox-bg {
    opacity: 0.87;
}

.fancybox-inner,
.fancybox-stage {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.fancybox-inner {
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    -webkit-overflow-scrolling: touch;
}

.fancybox-stage {
    overflow: visible;
    direction: ltr;
    z-index: 99994;
    -webkit-transform: translate3d(0, 0, 0);
    pointer-events: none;
}

.fancybox-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: visible;
    outline: none;
    white-space: normal;
    box-sizing: border-box;
    text-align: center;
    z-index: 99994;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    transition-property: transform, opacity;
    transform-origin: center center;
}

.fancybox-slide--html {
    padding: 20px 0;
}

/* ============================================
   POPUP
   ============================================ */

.popup {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 1780px;
    min-width: 280px;
    padding: 32px 15px;
    border-radius: 15px;
    background: #f6f6f6;
    pointer-events: auto;
    box-sizing: border-box;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    text-align: start;
}

.popup.popup--visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.popup__form {
    width: 100%;
    max-width: 1174px;
    margin: 0 auto;
    text-align: start;
}

/* ============================================
   TITLE / SUBTITLE
   Усиливаем селектор, чтобы не перебивался .title из темы
   ============================================ */

.popup .popup__title,
.popup__title.title {
    font-family: Verdana;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.15;
    color: rgba(60, 60, 59, 0.7);
    padding-right: 40px;
    margin: 0;
    text-shadow: none;
}

.popup__title strong {
    font-weight: 700;
}

.popup .popup__subtitle,
.popup__subtitle {
    font-size: 13px;
    line-height: 1.5;
    padding: 6px 0 16px;
    color: rgba(60, 60, 59, 0.7);
    max-width: 100%;
}

.popup__subtitle p {
    margin: 0 0 6px;
}

.popup__subtitle p:last-child {
    margin-bottom: 0;
}

/* ============================================
   CLOSER (крестик)
   ============================================ */

.closer {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    z-index: 10;
}

.closer:after,
.closer:before {
    position: absolute;
    top: 50%;
    width: 100%;
    height: 2px;
    content: "";
    background: rgba(60, 60, 59, 0.7);
}

.closer:after {
    left: 0;
    transform: rotate(45deg);
}

.closer:before {
    right: 0;
    transform: rotate(-45deg);
}

/* ============================================
   FORM
   ============================================ */

.form,
.form__columns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form__column p {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
    margin: 0;
}

.form__column input {
    max-height: 67px;
}

.form__label {
    display: block;
}

.form__label--fillHeight,
.form__label--fillHeight textarea {
    height: 100%;
    display: block;
    max-height: 148px;
}

.form__input,
.form__textarea {
    font-family: Verdana;
    font-size: 14px;
    width: 100%;
    height: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(60, 60, 59, 0.7);
    border-radius: 15px;
    background: #f7f7f7;
    color: #3c3c3b;
    box-sizing: border-box;
}

.form__textarea {
    min-height: 130px;
    resize: none;
    line-height: 1.4;
}

.form__input.error,
.form__textarea.error {
    border-color: #ea7d1bb3;
}

.form__error-message {
    color: #ea7d1bb3;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.form__bottom {
    padding-top: 16px;
}

.form__bottom p {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
    margin: 0;
    align-items: flex-start;
}

/* ============================================
   BUTTON (перебиваем .btn из темы жёстко)
   ============================================ */

.popup .form__btn,
.popup .btn,
.popup .btn--orange,
.popup input.btn,
.popup input.btn--orange {
    font-family: Verdana;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    padding: 12px 30px;
    cursor: pointer;
    transition: background-color 0.32s;
    white-space: nowrap;
    color: #f7f7f7;
    border: 0;
    border-radius: 40px;
    background-color: #ea7d1bb3;
    justify-content: center;
    align-items: center;
    width: auto;
    flex-shrink: 0;
}

.popup .form__btn:hover,
.popup .btn:hover,
.popup input.btn:hover {
    background-color: #3c3c3b;
}

/* ============================================
   ACCEPT (чекбокс)
   ============================================ */

.accept {
    font-size: 11px;
    line-height: 1.4;
    display: flex;
    color: #636363;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    order: -1;
    width: 100%;
}

.accept__input {
    display: none;
}

.accept__checkbox {
    width: 18px;
    height: 18px;
    transition: 0.32s;
    border: 1px solid #e0e0e0;
    background-color: #f7f7f7;
    flex-shrink: 0;
    margin-top: 1px;
}

.accept__checkbox.error {
    border-color: #ea7d1bb3;
}

.accept__checkbox.accept__checkbox-checked {
    background-color: #ea7d1bb3;
    box-shadow: inset 0 0 0 4px #f7f7f7;
}
.accept__text a{
    cursor: pointer;
}
.accept__text {
    color: #636363;
    text-decoration: none;
    cursor: default;
}

/* ============================================
   LOADER / ANSWER / ERROR
   ============================================ */

.loader,
.answerMessage,
.errorMessage {
    display: flex;
    flex-direction: column;
    min-height: 200px;
    text-align: center;
    justify-content: center;
    align-items: center;
}

.loader__ico {
    width: 40px;
    height: 40px;
    margin: auto;
    stroke: rgba(60, 60, 59, 0.7);
}

.answerMessage__title,
.errorMessage__title {
    font-family: Verdana;
    font-size: 22px;
    font-weight: 400;
    color: rgba(60, 60, 59, 0.7);
    margin-bottom: 16px;
}

.answerMessage__text,
.errorMessage__text {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(60, 60, 59, 0.7);
}

.answerMessage__text p {
    margin: 0 0 6px;
}

.hide {
    display: none !important;
}

/* ============================================
   FANCYBOX CLOSE (крестик fancybox — используется как fallback)
   ============================================ */

.fancybox-button {
    display: inline-block;
    padding: 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
    outline: none;
    color: #bdbdbd;
    transition: color 0.2s;
}

.fancybox-button:hover {
    color: #3c3c3b;
}

.fancybox-button svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.fancybox-close-small {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    padding: 8px;
    margin: 0;
    border: 0;
    background: transparent;
    z-index: 10;
    cursor: pointer;
    opacity: 0.7;
}

.fancybox-close-small:hover {
    opacity: 1;
}

/* ============================================
   TABLET / DESKTOP
   ============================================ */

@media (min-width: 768px) {
    .popup {
        padding: 40px 50px;
        width: calc(100vw - 40px);
        max-width: 1174px;
        border-radius: 20px;
    }

    .popup .popup__title,
    .popup__title.title {
        font-size: 32px;
        line-height: 1.1;
        padding-right: 60px;
    }

    .popup .popup__subtitle,
    .popup__subtitle {
        font-size: 14px;
        line-height: 1.5;
        padding: 10px 0 30px;
    }

    .closer {
        top: 24px;
        right: 30px;
        width: 40px;
        height: 40px;
    }

    .closer:after,
    .closer:before {
        height: 3px;
    }

    .form__columns {
        flex-direction: row;
        gap: 14px;
    }

    .form__column {
        flex: 1 1 auto;
        min-width: 0;
    }

    .form__column--long {
        flex: 0 0 58%;
        width: 58%;
        flex-shrink: 0;
    }

    .form__input,
    .form__textarea {
        font-size: 15px;
        border-radius: 33px;
        padding: 16px 24px;
    }

    .form__textarea {
        min-height: 148px;
    }

    .form__bottom {
        padding-top: 24px;
    }

    .form__bottom p {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
    }

    .accept {
        font-size: 12px;
        order: 0;
        width: auto;
        max-width: 60%;
    }

    .popup .form__btn,
    .popup .btn,
    .popup input.btn {
        font-size: 14px;
        padding: 16px 40px;
    }

    .form__btn--mobLast {
        order: inherit;
    }
}

/* ============================================
   DESKTOP LARGE
   ============================================ */

@media (min-width: 1080px) {
    .popup {
        padding: 50px 60px;
    }

    .popup .popup__title,
    .popup__title.title {
        font-size: 34px;
    }

    .popup .popup__subtitle,
    .popup__subtitle {
        font-size: 15px;
        padding-bottom: 35px;
    }

    .popup .form__btn,
    .popup .btn,
    .popup input.btn {
        font-size: 15px;
        padding: 18px 46px;
    }
}

/* ============================================
   MOBILE
   ============================================ */

@media (max-width: 767px) {
    .fancybox-inner {
        padding: 20px 0;
        align-items: center;
    }

    .fancybox-slide--html {
        padding: 0;
    }

    .popup {
        width: calc(100vw - 30px);
        max-width: 460px;
        max-height: calc(100vh - 60px);
        padding: 24px 16px;
        margin: auto;
        overflow-y: auto;
    }

    .closer {
        top: 12px;
        right: 12px;
        width: 24px;
        height: 24px;
    }

    .popup .popup__title,
    .popup__title.title {
        font-size: 20px;
        line-height: 1.2;
        padding-right: 34px;
    }

    .popup .popup__subtitle,
    .popup__subtitle {
        font-size: 12px;
        padding: 4px 0 14px;
    }

    .form__input,
    .form__textarea {
        font-size: 13px;
        padding: 11px 16px;
        border-radius: 15px;
    }

    .popup .form__btn,
    .popup .btn,
    .popup input.btn {
        font-size: 13px;
        padding: 12px 26px;
        width: 100%;
    }

    .accept {
        font-size: 11px;
    }
}

/* Скрываем встроенный крестик fancybox — используем свой .closer */
.popup .fancybox-close-small,
.fancybox-slide--html .fancybox-close-small {
    display: none;
}

/* Убираем обводку и тень при фокусе на полях */
.popup .form__input:focus,
.popup .form__textarea:focus,
.popup .form__input:active,
.popup .form__textarea:active {
    outline: none;
    box-shadow: none;
    border-color: rgba(60, 60, 59, 0.7);
}

/* Убираем дефолтный outline у всех полей в попапе (Safari, Firefox) */
.popup input:focus,
.popup textarea:focus {
    outline: 0;
    outline-offset: 0;
    box-shadow: none;
}

/* Сообщение об ошибке под полем */
.form__error-message {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.3;
    color: #ea7d1b;
}

/* Красная обводка поля с ошибкой */
.form__input.error,
.form__textarea.error {
    border-color: #ea7d1b;
}

/* Красный чекбокс и текст согласия */
.accept__checkbox.error {
    border-color: #ea7d1b;
}

.accept.error,
.accept.error span,
.accept.error a {
    color: #ea7d1b;
}

/* ============================================
   ВЫРАВНИВАНИЕ ПОЛЕЙ ФОРМЫ (2 инпута = 1 textarea)
   ============================================ */

@media (min-width: 768px) {
    /* Мелкие инпуты — фиксированная высота 62px */
    .popup .form__column .form__input {
        height: 62px;
        min-height: 62px;
        max-height: 62px;
        box-sizing: border-box;
    }

    /* Большое поле (textarea) = 2 инпута + gap */
    .popup .form__label--fillHeight,
    .popup .form__label--fillHeight textarea,
    .popup .form__textarea {
        height: 134px;
        min-height: 134px;
        max-height: 134px;
        box-sizing: border-box;
    }

    /* Колонки растягиваем на одинаковую высоту */
    .popup .form__columns {
        align-items: stretch;
    }

    .popup .form__column {
        display: flex;
        flex-direction: column;
    }

    .popup .form__column p {
        height: 100%;
        justify-content: space-between;
    }
}