/* Shared utilities. Page and component styles live in their own CSS files. */

.is-hidden {
    display: none !important;
}

.select2-native-hidden {
    min-height: 58px;
    visibility: hidden;
}

.app-is-loading {
    cursor: wait;
}

.app-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12, 24, 36, 0.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.app-loading-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.app-loading-overlay__box {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 260px;
    max-width: min(360px, 100%);
    padding: 18px 22px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.24);
    color: #1f3344;
    font-size: 16px;
    font-weight: 600;
}

.app-loading-overlay__spinner {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border: 4px solid #d9e4ec;
    border-top-color: #ff9442;
    border-radius: 50%;
    animation: app-loading-spin 0.8s linear infinite;
}

.app-loading-overlay__text {
    line-height: 1.3;
}

@keyframes app-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.error-page {
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
    padding-bottom: 80px;
}

.error-page__content {
    max-width: 560px;
    text-align: center;
}

.error-page__code {
    margin-bottom: 14px;
    color: #ff9442;
    font-size: 88px;
    line-height: 1;
    font-weight: 700;
}

.error-page__title {
    margin-bottom: 18px;
}

.error-page__text {
    margin-bottom: 28px;
    color: #5f6f7b;
    font-size: 18px;
    line-height: 1.5;
}

.error-page__actions {
    display: flex;
    justify-content: center;
}

.support-page {
    padding-bottom: 80px;
}

.support-page__layout {
    display: grid;
    grid-template-columns: minmax(260px, .72fr) minmax(0, 1.35fr);
    gap: clamp(32px, 5vw, 78px);
    align-items: start;
}

.support-page__form-box.convert-box {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(26px, 3vw, 42px);
}

.support-page__section-title {
    margin: 0 0 22px;
}

.support-page__form-box .support-page__section-title {
    margin-top: -17px;
    color: var(--green);
}

.qr-wrap__title--actions {
    margin-top: 22px;
    margin-bottom: 14px;
}

.support-page__intro {
    max-width: 390px;
    margin: 0 0 30px;
    color: var(--context-grey);
    font-size: 17px;
    line-height: 1.55;
}

.support-contact {
    position: relative;
    margin-top: 22px;
    padding-left: 42px;
}

.support-contact::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 0;
    width: 28px;
    height: 28px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.support-contact--phone::before { background-image: url(../images/phone-icon.svg); }
.support-contact--email::before { background-image: url(../images/mail-icon.svg); }
.support-contact--telegram::before { background-image: url(../images/tg-icon.svg); }

.support-contact__label,
.support-contact__value {
    display: block;
}

.support-contact__label {
    margin-bottom: 4px;
    color: var(--context-grey);
    font-size: 14px;
}

.support-contact__value {
    color: var(--green);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
}

.support-page__notice {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.45;
}

.support-page__notice--success {
    border: 1px solid #83bf72;
    background: #eefae8;
    color: #557907;
}

.support-page__notice--error {
    border: 1px solid #efb0a7;
    background: #fff0ed;
    color: #aa3d30;
}

.support-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.support-form__field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.support-form__field:last-of-type,
.support-form__actions {
    grid-column: 1 / -1;
}

.support-form__label {
    color: var(--context-grey);
    font-size: 15px;
    font-weight: 600;
}

.support-form__input,
.support-form__textarea {
    width: 100%;
    border: 1px solid #cfc9c6;
    border-radius: 8px;
    background: #fff;
    color: var(--green);
    font: inherit;
    font-size: 16px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.support-form__input {
    min-height: 52px;
    padding: 0 16px;
}

.support-form__textarea {
    min-height: 190px;
    padding: 14px 16px;
    resize: vertical;
}

.support-form__input:focus,
.support-form__textarea:focus {
    border-color: #ff9442;
    box-shadow: inset 0 0 0 1px rgba(255, 148, 66, .42);
}

.support-form__actions {
    display: flex;
    justify-content: center;
    padding-top: 4px;
}

.support-form__submit {
    min-width: 230px;
    border: 0;
    cursor: pointer;
}

@media (max-width: 840px) {
    .support-page__layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .support-page__contacts.info {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 18px;
    }

    .support-page__contacts .support-page__section-title,
    .support-page__contacts .support-page__intro {
        grid-column: 1 / -1;
    }

    .support-contact {
        margin-top: 0;
    }
}

@media (max-width: 620px) {
    .support-page {
        padding-bottom: 56px;
    }

    .support-page__contacts.info,
    .support-form {
        grid-template-columns: 1fr;
    }

    .support-page__form-box.convert-box {
        padding: 24px 18px;
    }

    .support-form__submit {
        width: 100%;
    }
}

.choose-address__hint {
    color: var(--context-grey);
    font-size: .875rem;
    line-height: 1.5;
    margin: .35rem 0 0;
    max-width: 48rem;
}

.checkboxes-grid__label.checkboxes-grid__label--static {
    cursor: default;
}

.checkboxes-grid__label.checkboxes-grid__label--static::after {
    display: none;
}

.choose-address.is-mode-sell .checkboxes-grid {
    grid-template-columns: minmax(0, 2fr) minmax(12rem, 1fr);
}

.choose-address.is-mode-sell .wallet-address {
    align-self: start;
    height: 10rem;
}

.choose-address.is-mode-buy .wallet-empty {
    grid-column: span 2;
}

@media (min-width: 1031px) {
    .choose-address.is-mode-buy .wallet-address {
        align-self: stretch;
        box-sizing: border-box;
        height: 100%;
        min-height: 0;
    }
}

.choose-address.is-mode-sell .sending-addresses-card,
.choose-address.is-mode-sell .wallet-empty {
    box-sizing: border-box;
    width: 100%;
}

.sending-addresses-card {
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid var(--grey-border);
    border-radius: var(--brs);
    background: #f5f5f4;
}

.sending-addresses-card__header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-bottom: .875rem;
    border-bottom: 1px solid var(--grey-border);
}

.sending-addresses-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sending-addresses-list__item {
    min-width: 0;
    padding: .875rem 0;
}

.sending-addresses-list__item + .sending-addresses-list__item {
    border-top: 1px solid var(--grey-border);
}

.sending-addresses-list__item:last-child {
    padding-bottom: 0;
}

.sending-addresses-list__description {
    margin-bottom: .25rem;
    color: var(--context-grey);
    font-size: .8125rem;
    line-height: 1.4;
}

.sending-addresses-list__address {
    color: var(--green);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

@media (max-width: 1030px) {
    .choose-address.is-mode-sell .checkboxes-grid {
        grid-template-columns: 1fr;
    }

    .choose-address.is-mode-sell .wallet-address {
        height: auto;
    }

    .choose-address.is-mode-buy .wallet-empty {
        grid-column: auto;
    }
}

.account-menu {
    position: relative;
}

.account-menu__toggle.header-phone {
    border: 0;
    background-color: transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.account-menu__toggle.header-phone:hover,
.account-menu__toggle.header-phone:focus-visible,
.account-menu.is-open .account-menu__toggle {
    color: var(--dark-grey-hover);
}

.account-menu__toggle:focus-visible {
    border-radius: 4px;
    outline: 2px solid var(--orange);
    outline-offset: 4px;
}

.account-menu__popup {
    position: absolute;
    z-index: 100;
    top: calc(100% + 14px);
    left: 50%;
    width: 292px;
    padding: 20px;
    transform: translateX(-50%);
    border: 1px solid #e4e7e9;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(33, 46, 54, 0.18);
    color: var(--dark-grey);
}

.account-menu__popup::before {
    position: absolute;
    top: -7px;
    left: 50%;
    width: 12px;
    height: 12px;
    transform: translateX(-50%) rotate(45deg);
    border-top: 1px solid #e4e7e9;
    border-left: 1px solid #e4e7e9;
    background: #fff;
    content: "";
}

.account-menu__name {
    padding-bottom: 14px;
    border-bottom: 1px solid #edf0f2;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.account-menu__details {
    display: grid;
    gap: 11px;
    margin: 15px 0 18px;
}

.account-menu__detail {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.account-menu__detail dt {
    color: var(--context-grey);
    font-size: 13px;
    line-height: 1.35;
}

.account-menu__detail dd {
    margin: 0;
    color: var(--dark-grey);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-align: right;
}

.account-menu__transactions {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #dfe8e9;
    border-radius: 8px;
    background: #f4f8f8;
    color: var(--green);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.account-menu__transactions:hover,
.account-menu__transactions:focus-visible {
    border-color: rgba(16, 74, 85, .4);
    background: #eaf2f2;
    color: var(--green-hover);
}

.account-menu__transactions-icon {
    width: 20px;
    height: 20px;
}

.account-menu__transactions-arrow {
    font-size: 16px;
}

.account-menu__profile {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--orange);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.account-menu__profile:hover,
.account-menu__profile:focus-visible {
    background: var(--orange-hover);
    color: #fff;
}

.language-menu__toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 5px 2px;
    border: 0;
    background: transparent;
    color: var(--dark-grey);
    cursor: pointer;
    font: inherit;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.25;
}

.language-menu__toggle:hover,
.language-menu__toggle:focus-visible,
.language-menu.is-open .language-menu__toggle {
    color: var(--dark-grey-hover);
}

.language-menu__toggle:focus-visible {
    border-radius: 5px;
    outline: 2px solid var(--orange);
    outline-offset: 3px;
}

.language-menu__flag {
    display: block;
    flex: 0 0 auto;
    width: 30px;
    height: 20px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(20, 71, 83, .14);
    object-fit: cover;
}

.language-menu__chevron {
    width: 7px;
    height: 7px;
    margin-top: -3px;
    transform: rotate(45deg);
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
}

.language-menu__popup {
    left: 0;
    width: 205px;
    padding: 8px;
    transform: none;
}

.language-menu__popup::before {
    left: 26px;
    transform: rotate(45deg);
}

.language-menu__option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 11px;
    border-radius: 7px;
    color: var(--dark-grey);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
}

a.language-menu__option:hover,
a.language-menu__option:focus-visible {
    background: #f4f7f8;
    color: var(--green);
}

.language-menu__option.is-current {
    background: #f4f5f5;
    color: #a2a9ad;
    cursor: default;
}

@media (min-width: 631px) and (max-width: 1100px) {
    .header .header__right {
        gap: 1rem;
    }
}

@media (max-width: 630px) {
    .header__container {
        gap: .75rem;
    }

    .header .logo {
        max-width: 6rem;
        margin-right: 0;
        margin-left: 0;
    }

    .header .header__right {
        gap: .75rem;
    }

    .language-menu__toggle {
        gap: 5px;
        min-height: 32px;
        font-size: .75rem;
    }

    .language-menu__toggle .language-menu__name {
        display: none;
    }

    .account-menu__popup.language-menu__popup {
        right: auto;
        left: 0;
        width: min(205px, calc(100vw - 32px));
        transform: none;
    }

    .account-menu__popup.language-menu__popup::before {
        right: auto;
        left: 26px;
        transform: rotate(45deg);
    }

    .account-menu__popup {
        right: -48px;
        left: auto;
        width: min(292px, calc(100vw - 32px));
        transform: none;
    }

    .account-menu__popup::before {
        right: 52px;
        left: auto;
        transform: rotate(45deg);
    }
}

.atm-list-entry {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: .875rem;
}

.atm-list-entry__details {
    min-width: 0;
}

.atm-list-icon {
    display: block;
    flex: 0 0 3.5rem;
    width: 3.5rem;
    height: 3.5rem;
    overflow: hidden;
    border-radius: .75rem;
    background: #edf5f4;
}

.atm-list-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.atm-list-icon--fallback img {
    object-fit: contain;
}

.atm-info-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.atm-info-content > .contacts-list {
    flex: 1 1 auto;
}

.atm-building-image {
    margin: 0;
    overflow: hidden;
    border-radius: .75rem;
    background: #eef2f0;
}

.atm-building-image[hidden] {
    display: none;
}

.atm-building-image[role="button"] {
    cursor: zoom-in;
}

.atm-building-image[role="button"]:focus-visible {
    outline: 3px solid #ff9442;
    outline-offset: 3px;
}

.atm-building-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.atm-building-image[role="button"] img {
    transition: transform .18s ease;
}

.atm-building-image[role="button"]:hover img,
.atm-building-image[role="button"]:focus-visible img {
    transform: scale(1.035);
}

body.is-atm-image-zoomed {
    overflow: hidden;
}

.atm-image-lightbox {
    position: fixed;
    z-index: 10050;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: rgba(7, 20, 23, .91);
    cursor: zoom-out;
}

.atm-image-lightbox[hidden] {
    display: none;
}

.atm-image-lightbox__image {
    display: block;
    width: auto;
    max-width: min(1200px, 100%);
    height: auto;
    max-height: calc(100vh - 6rem);
    border-radius: .75rem;
    box-shadow: 0 1.125rem 4.375rem rgba(0, 0, 0, .42);
    object-fit: contain;
    cursor: default;
}

.atm-image-lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
}

.atm-image-lightbox__close:hover,
.atm-image-lightbox__close:focus-visible {
    border-color: #fff;
    background: rgba(255, 255, 255, .24);
}

.atm-image-lightbox__close svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.atm-building-image--summary {
    flex: 0 0 clamp(7rem, 29%, 11rem);
    align-self: stretch;
    min-height: 10rem;
    max-height: 15rem;
    margin-top: 1rem;
}

.contacts-box.contacts-box--with-building {
    align-items: stretch;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(8.5rem, 11rem) minmax(18rem, 1.35fr);
}

.atm-building-image--location {
    min-height: 14rem;
    max-height: 21rem;
}

.atm-building-image--card,
.atm-building-image--account {
    width: 100%;
    max-height: 15rem;
    margin-top: 1rem;
}

.atm-building-image--card img,
.atm-building-image--account img {
    max-height: 15rem;
}

@media (max-width: 1030px) {
    .contacts-box.contacts-box--with-building {
        grid-template-columns: 1fr;
        gap: .75rem;
    }

    .atm-building-image--location {
        min-height: 0;
        height: 13rem;
    }
}

@media (max-width: 630px) {
    .atm-image-lightbox {
        padding: 4.75rem .75rem 1rem;
    }

    .atm-image-lightbox__image {
        max-height: calc(100vh - 5.75rem);
    }

    .atm-list-entry {
        gap: .625rem;
    }

    .atm-list-icon {
        flex-basis: 2.875rem;
        width: 2.875rem;
        height: 2.875rem;
    }

    .atm-info-content {
        flex-wrap: wrap;
    }

    .atm-building-image--summary {
        flex: 1 1 100%;
        min-height: 0;
        height: 11rem;
        margin-top: .75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .atm-building-image[role="button"] img {
        transition: none;
    }
}
