@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");

@font-face {
    font-family: "Gotham Pro";
    src: url("../fonts/gothampro.ttf");
    src: local("Gotham Pro"), local("Gotham Pro"), url("../fonts/gothampro.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

:root {
    --color-grey: #f6f6f6;
    --color-grey2: #c4c4c4;
    --color-white: #ffffff;
    --color-red: #e20101;
    --color-violet: #5b41f5;
    --color-violet-hover: #876fff;

    --color-dark-grey: #3e3e3d;
    --color-disabled: #bababa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

* {
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently
                                    supported by Chrome, Edge, Opera and Firefox */
}

* {
    /* Синяя подсветка исчезает без следа */
    -webkit-tap-highlight-color: transparent;
}

.visually-hidden:not(:focus):not(:active),
input[type="checkbox"].visually-hidden,
input[type="ratio"].visually-hidden {
    display: none;
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    border: 0;
    padding: 0;
    white-space: nowrap;
    clip-path: insert(100%);
    clip: rect(0 0 0 0);
    overflow: hidden;
}

body {
    background: var(--color-grey);
    min-width: 390px;
}

.main__container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    max-width: 390px;
    margin: 0 auto;
    padding: 32px 10px;
}

.header__container {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 0 15px;
    margin-bottom: 25px;
}

.header__logo {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 68px;
}

.logo {
    width: 100%;
    object-fit: contain;
    object-position: center;
}

.header__title-block {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    margin-left: 16px;
    width: 100%;
    padding-top: 2px;
}

.header__title {
    font-family: Roboto;
    font-size: 33.93px;
    font-weight: 700;
    line-height: 35px;
    letter-spacing: -0.01em;
    text-align: left;
}
.header__subtitle {
    font-family: Roboto;
    font-size: 22.62px;
    font-weight: 400;
    line-height: 29px;
    letter-spacing: -0.01em;
    text-align: left;
}

section {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0px 0px 5px 0px #0000001a;
    background: var(--color-white);
    padding: 24px 24px 0 24px;
    margin-bottom: 32px;
}

.block__title {
    font-family: Roboto;
    font-size: 20px;
    font-weight: 700;
    line-height: 25.8px;
    letter-spacing: -0.01em;
    text-align: left;
    margin-bottom: 20px;
}

.item__title {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 4px;
    font-family: Roboto;
    font-size: 16px;
    font-weight: 400;
    line-height: 20.64px;
    letter-spacing: -0.01em;
    text-align: left;
    margin-bottom: 16px;
    color: var(--color-dark-grey);
    width: 100%;
}

li::marker {
    font-size: 16px;
    font-family: "Roboto";
    color: var(--color-dark-grey);
}

.item__notice {
    font-family: Roboto;
    font-size: 16px;
    font-style: italic;
    font-weight: 400;
    line-height: 20.64px;
    letter-spacing: -0.01em;
    text-align: left;
    margin-left: 26px;
    margin-bottom: 16px;
    color: var(--color-dark-grey);
}

.first__block .item__notice {
    margin-left: 16px;
}

.input {
    width: 100%;
    height: 45px;
    border-radius: 10px;
    margin-bottom: 24px;
    border: 0.5px solid var(--color-grey2);
    background-color: var(--color-grey);
    padding: 0 16px;
    font-family: Roboto;
    font-size: 18px;
    font-weight: 400;
    line-height: 23.22px;
    letter-spacing: -0.01em;
    text-align: left;
}

.input:disabled {
    border: 0.5px solid var(--color-grey2);
    background-color: var(--color-disabled);
}

.input.error {
    border: 1px solid var(--color-red);
}

.notice__policy {
    font-family: Roboto;
    font-size: 13px;
    font-weight: 400;
    line-height: 16.77px;
    letter-spacing: -0.01em;
    text-align: left;
    color: var(--color-dark-grey);
    margin-top: 48px;
}

.btn-form {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 48px;
    padding: 8px;
    gap: 20px;
    border-radius: 8px;
    background: var(--color-violet);
    border: none;
    margin: 32px 0 40px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    color: var(--color-white);
    font-family: Gotham Pro;
    font-size: 15px;
    font-weight: 500;
    line-height: 14.36px;
    letter-spacing: -0.025em;
}

.btn-form:hover {
    background: var(--color-violet-hover);
}

.btn-form:active {
    background: var(--color-violet-hover);
}

/* Блок генерации файлов: 40px от края блока до кнопки, 36px между кнопками.
   ВАЖНО: у section уже есть padding: 24px сверху, поэтому margin-top первой
   кнопки = 40 - 24 = 16px. Снизу padding у section нулевой, поэтому
   margin-bottom последней кнопки = полные 40px. */
#shareButton {
    margin: 16px 0 36px;
}

#shareButton2,
#shareButton3 {
    margin: 0 0 40px;
}

/* Кнопки «Комплект на страну» — по одной на подключённую страну, создаются
   в shared/trip-kit.js. Каждая показывается только когда городом прилёта
   выбран город этой страны, поэтому по умолчанию скрыта классом
   btn-form--hidden.
   Между кнопками в этом блоке 36px, но у section стоит display: flex, и
   отступы соседей не схлопываются: снизу у кнопки чека уже 40px, поэтому
   сверху здесь -4px — так расстояние остаётся теми же 36px, а если кнопка
   скрыта, у чека сохраняются свои 40px до края блока. */
.btn-form--kit {
    margin: -4px 0 40px;
}

.btn-form--hidden {
    display: none;
}

#addPath {
    margin: 0 0 40px;
}

.btn__text {
    color: var(--color-white);
    font-family: Gotham Pro;
    font-size: 15px;
    font-weight: 500;
    line-height: 14.36px;
    letter-spacing: -0.025em;
    text-align: left;
}

.red__notice {
    position: relative;
    display: flex;
    width: 322px;
    font-family: Roboto;
    font-size: 13px;
    font-weight: 400;
    line-height: 16.77px;
    letter-spacing: -0.01em;
    text-align: left;
    color: var(--color-red);
    margin-left: 26px;
    margin-bottom: 16px;
}

.footer__container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 30px;
    max-width: 390px;
    margin: 0 auto;
}

.refresh__link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 48px;
    padding: 8px 48px;
    gap: 20px;
    border-radius: 8px;
    background: #f0efef;
    border: none;
    margin: 8px 0 40px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.refresh__link:hover {
    background: #ffffff;
}

.refresh__link:active {
    background: #ffffff;
}

.link-text {
    font-family: Gotham Pro;
    font-size: 15px;
    font-weight: 600;
    line-height: 14.36px;
    letter-spacing: -0.025em;
    text-align: left;
    color: var(--color-violet);
}

.options {
    position: relative;
    display: flex;
    justify-content: flex-start;
    gap: 24px;
    margin-left: 16px;
    margin-bottom: 8px;
}

.options__row {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 8px;
}

.options__column {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.options__item {
    font-family: Roboto;
    font-size: 15px;
    font-weight: 300;
    line-height: 19.35px;
    letter-spacing: -0.01em;
    text-align: left;
}

.options__input {
    display: none;
}

.options__input:checked + .options__label::after {
    transform: scale(1);
}

.options__label {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-family: Roboto;
    font-size: 18px;
    font-weight: 300;
    line-height: 23.22px;
    letter-spacing: -0.01em;
    text-align: left;
    cursor: pointer;
}

.options__label::before {
    content: url(/themes/myvisa/assets/forms/ticket-form-new/img/ion_checkbox_unchecked.svg);
    align-self: flex-start;
    flex: 0 0 23px;
    height: 23px;
    margin: 0 10px 0 0;
}

.options__label::after {
    content: url(/themes/myvisa/assets/forms/ticket-form-new/img/ion_checkbox_checked.svg);
    position: absolute;
    align-self: flex-start;
    flex: 0 0 23px;
    height: 23px;
    margin: 0 10px 0 0;
    transform: scale(0);
}

.options.error .options__label::before {
    content: url(/themes/myvisa/assets/forms/ticket-form-new/img/ion_checkbox_unchecked_error.svg);
}

.options__origin {
    margin-left: 0;
    gap: 16px;
}
.options__origin .options__label {
    font-size: 15px;
}

.options__origin .options__label::after,
.options__origin .options__label::before {
    margin: 0 7px 0 0;
}

/* popup */

.overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.overlay.active {
    z-index: 999;
    opacity: 1;
    visibility: visible;
}

.popup {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 22px 52px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0px 0px 5px 0px #0000001a;
    z-index: -1;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.popup.active {
    z-index: 1000;
    opacity: 1;
    visibility: visible;
}

#closeBtn {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    background: #d9d9d9;
    padding: 12px 33px;
    border-radius: 8px;
    font-family: Gotham Pro;
    font-size: 15px;
    font-weight: 600;
    line-height: 14.36px;
    letter-spacing: -0.025em;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

#closeBtn:hover {
    background: #e5e5e5;
}

.popup__title {
    font-family: Roboto;
    font-size: 20px;
    font-weight: 700;
    line-height: 25.8px;
    letter-spacing: -0.01em;
    text-align: center;
    margin-bottom: 12px;
    white-space: nowrap;
}

.popup__text {
    font-family: Roboto;
    font-size: 14px;
    font-weight: 400;
    line-height: 18.06px;
    letter-spacing: -0.01em;
    text-align: center;
    color: var(--color-red);
    margin-bottom: 24px;
    white-space: nowrap;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid;
    border-color: var(--color-violet) transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loader-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s linear;
}

.loader-wrapper.active {
    visibility: visible;
    opacity: 1;
}

/* Кнопка "Удалить пассажира" — та же форма, но приглушённый/предупреждающий цвет */
.btn-form--remove {
    background: var(--color-white);
    color: var(--color-red);
    border: 1px solid var(--color-red);
    margin: 0 0 24px;
}

.btn-form--remove:hover,
.btn-form--remove:active {
    background: #fff3f3;
}

#addPassenger {
    margin: 0 0 40px;
}

/* Превью автоматически подобранных рейсов (город->город, даты) */

/* ===========================================================================
   Сложный маршрут: несколько въездов в страну одной поездкой
   ---------------------------------------------------------------------------
   Подзаголовки и кнопки видны только при выбранном типе «Сложный маршрут» —
   когда рейс один, нумеровать и добавлять нечего.
   =========================================================================== */
.route-leg__title {
    font-family: Gotham Pro;
    font-size: 15px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: -0.025em;
    color: var(--color-violet);
    margin: 8px 0 20px;
}

.route-leg__title--hidden,
.route-leg__buttons--hidden {
    display: none;
}

.route-leg__buttons .btn-form {
    margin: 8px 0 32px;
}

.route-preview {
    display: none;
}

.route-preview.active {
    display: block;
}

.route-preview__text,
.route-preview__text * {
    /* Глобальное правило * { user-select: none } применяется и к вложенным
       элементам, поэтому разрешаем выделение явно и для потомков. */
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    -webkit-touch-callout: default;
    cursor: text;
}

.route-preview__text {
    font-family: Roboto;
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-dark-grey);
    padding: 4px 16px 0 0;
}

/* п.3: отступ от последней строки до нижнего края блока */
.route-preview {
    padding-bottom: 24px;
}

/* Заголовок рейса в списке подобранных: отделяем от предыдущей группы,
   иначе «Второй рейс» липнет к последнему перелёту первого */
.route-preview__leg-group {
    display: block;
    margin: 22px 0 10px;
}

.route-preview__leg-group:first-child {
    margin-top: 0;
}

/* Каждый перелёт — отдельный блок; обратный рейс отделяем сильнее */
.route-preview__leg {
    display: block;
    margin-bottom: 14px;
}

.route-preview__leg:last-child {
    margin-bottom: 0;
}

.route-preview__leg-title {
    display: block;
    font-weight: 500;
}

.route-preview__text .route-preview__back {
    display: block;
    margin-top: 22px;
}

.route-preview__text .route-preview__error {
    color: var(--color-red);
}

/* Автодополнение для полей "Откуда"/"Куда" — поиск по городу или по стране,
   как в системах бронирования билетов. */
.autocomplete {
    position: relative;
}

.autocomplete__list {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 340px;
    overflow-y: auto;
    margin: 0;
    padding: 4px 0 8px;
    list-style: none;
    background: var(--color-white);
    border: 0.5px solid var(--color-grey2);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.autocomplete__list.active {
    display: block;
}

/* --- Выпадающий список городов (по образцу Trip.com) --- */

/* Иконка-указатель места */
.autocomplete__pin {
    flex: 0 0 16px;
    width: 16px;
    height: 18px;
    background-repeat: no-repeat;
    background-position: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23c9ced8'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
}

.autocomplete__pin--city {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%233e3e3d'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
}

/* Заголовок страны — приглушённый, без разделителя сверху */
.autocomplete__group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px 10px;
    font-family: Roboto;
    font-size: 15px;
    color: var(--color-grey2);
}

.autocomplete__group b {
    font-weight: 500;
    color: var(--color-grey2);
}

/* Город — тонкая линия-разделитель сверху, крупный кликабельный ряд */
.autocomplete__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    margin: 0 18px;
    border-top: 1px solid #eef0f3;
    font-family: Roboto;
    font-size: 15px;
    color: var(--color-dark-grey);
    cursor: pointer;
}

.autocomplete__group + .autocomplete__item {
    border-top: 1px solid #eef0f3;
}

.autocomplete__item:hover,
.autocomplete__item.active {
    background: #f5f7fa;
}

.autocomplete__city {
    flex: 1 1 auto;
}

.autocomplete__item b {
    font-weight: 600;
    color: var(--color-violet);
}

/* IATA-код справа — помогает различать похожие города */
.autocomplete__code {
    flex: 0 0 auto;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--color-grey2);
}

.autocomplete__empty {
    padding: 8px 16px;
    font-family: Roboto;
    font-size: 14px;
    color: var(--color-grey2);
}

/* Кнопка в состоянии "файл готов, отправьте" — второе касание мобильного
   сценария. Зелёный цвет и однократная пульсация подсказывают, что нужно
   нажать ещё раз, чтобы открылось системное "Поделиться". */
.btn-form.btn__ready {
    background: #16b364;
    animation: btnReadyPulse 0.6s ease-out 1;
}

.btn-form.btn__ready:hover,
.btn-form.btn__ready:active {
    background: #12a058;
}

@keyframes btnReadyPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(22, 179, 100, 0.5);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 0 8px rgba(22, 179, 100, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(22, 179, 100, 0);
    }
}

/* Сообщение под полем (проверка дат) — как в форме отелей */
.field__notice {
    margin: -16px 0 22px;
    font-family: Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.35;
    color: var(--color-dark-grey);
}

.field__notice--error {
    color: var(--color-red);
}

.field__notice--hidden {
    display: none;
}

/* ===========================================================================
   Узкие экраны
   ---------------------------------------------------------------------------
   У body был min-width: 390px — на телефонах 360 и 375 px это давало
   горизонтальный скрол всей страницы. Ширину отдаём экрану, а 390 px
   оставляем как максимум для крупных экранов.
   =========================================================================== */

body {
    min-width: 320px;
}

.main__container {
    width: 100%;
    max-width: 390px;
}

/* Длинные названия отелей и номеров не должны распирать блок */
.input,
select.input {
    max-width: 100%;
}

/* Страховка от случайного выхода за экран на узких телефонах */
html,
body {
    overflow-x: hidden;
}

/* Подсказка вверху была задана жёсткими 322 px плюс отступ 26 px слева —
   на экранах 320 px это вылезало за край. Отдаём ширину экрану. */
.red__notice {
    width: auto;
    max-width: 322px;
    margin-right: 10px;
}
