:root {
    --phone-input-outline: rgba(60, 60, 67, 0.12);
    --phone-input-outline-strong: rgba(60, 60, 67, 0.18);
    --phone-input-surface: rgba(255, 255, 255, 0.98);
    --phone-input-hover: rgba(0, 0, 0, 0.04);
    --phone-input-accent: #007aff;
    --phone-input-accent-soft: rgba(0, 122, 255, 0.08);
    --phone-input-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.iti,
.phone-intl-shell {
    display: block;
    width: 100%;
}

.phone-intl-shell {
    --iti-border-width: 0px;
    --iti-hover-color: var(--phone-input-hover);
    --iti-border-color: rgba(60, 60, 67, 0.08);
    --iti-dropdown-bg: var(--phone-input-surface);
    --iti-icon-color: #8e8e93;
    --iti-arrow-size: 4px;
    --iti-arrow-padding: 6px;
    --iti-spacer-horizontal: 10px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 34px;
}

.phone-intl-shell .iti__country-container {
    position: relative;
    inset: auto;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin-right: 14px;
    padding-right: 14px;
    cursor: pointer;
}

.phone-intl-shell .iti__country-container::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 1px;
    height: 24px;
    background: var(--phone-input-outline-strong);
    transform: translateY(-50%);
}

.phone-intl-shell input.iti__tel-input,
.phone-intl-shell input.iti__tel-input[type="tel"],
.phone-intl-shell input.iti__tel-input[type="text"] {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 34px;
    padding: 0 !important;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.phone-intl-shell input.iti__tel-input::placeholder {
    color: #b0b0b6;
}

.phone-intl-shell .iti__selected-country {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #1f2937;
    appearance: none;
    -webkit-appearance: none;
    transition: color 0.2s ease, opacity 0.2s ease;
    box-shadow: none;
    cursor: pointer;
}

.phone-intl-shell .iti__selected-country:focus,
.phone-intl-shell .iti__selected-country:focus-visible {
    outline: none;
}

.phone-intl-shell .iti__selected-country:hover,
.phone-intl-shell .iti__selected-country:has(+ .iti__dropdown-content:hover),
.phone-intl-shell .iti__country-container:hover .iti__selected-country,
.phone-intl-shell .iti__country-container:hover .iti__selected-dial-code {
    background: transparent;
    color: var(--phone-input-accent);
}

.phone-intl-shell .iti__selected-country-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0;
    border-radius: 0;
}

.phone-intl-shell .iti__selected-country-primary:hover {
    background: transparent !important;
}

.phone-intl-shell .iti__selected-dial-code {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    color: #1f3b67;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
}

.phone-intl-shell .iti__selected-dial-code::after {
    content: "";
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-left: 8px;
    border-right: 1.75px solid #8e8e93;
    border-bottom: 1.75px solid #8e8e93;
    transform: rotate(45deg) translateY(-1px);
    transform-origin: center;
    transition: border-color 0.2s ease;
}

.phone-intl-shell .iti__country-container:hover .iti__selected-dial-code::after,
.phone-intl-shell .iti__selected-country:focus-visible + .iti__selected-dial-code::after,
.phone-intl-shell .iti__selected-country:hover + .iti__selected-dial-code::after {
    border-right-color: var(--phone-input-accent);
    border-bottom-color: var(--phone-input-accent);
}

.phone-intl-shell .iti__arrow {
    display: none;
}

.phone-intl-shell .iti__flag {
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.phone-intl-flag--circle {
    width: 20px !important;
    height: 20px !important;
    border-radius: 999px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    box-shadow: none !important;
}

.phone-intl-shell .iti__dropdown-content {
    margin-top: 12px;
    border: 1px solid var(--tg-border, #e7e7ec);
    border-radius: 14px;
    background: var(--tg-surface, #ffffff);
    box-shadow: 0 16px 36px rgba(17, 24, 31, 0.16);
    overflow: hidden;
}

.phone-intl-shell .iti__search-input-wrapper {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 6px;
    border-bottom: 0;
    background: var(--tg-surface, #ffffff);
}

.phone-intl-shell .iti__search-input {
    min-height: 42px;
    padding-left: 40px;
    padding-right: 36px;
    border: 1px solid var(--tg-border, #e7e7ec);
    border-radius: 12px;
    background: #f8f8fb;
    color: var(--tg-text, #11181f);
    font-size: 14px;
    line-height: 1.4;
    font-family: var(--tg-font-ui, inherit);
}

.phone-intl-shell .iti__search-icon {
    left: 18px;
}

.phone-intl-shell .iti__search-input:focus {
    outline: none;
    border-color: rgba(36, 129, 204, 0.34);
    box-shadow: 0 0 0 3px rgba(36, 129, 204, 0.12);
}

.phone-intl-shell .iti__search-clear {
    right: 12px;
}

.phone-intl-shell .iti__country-list {
    max-height: min(320px, calc(100dvh - 180px));
    padding: 0 6px 6px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #b9c0cb transparent;
}

.phone-intl-shell .iti__country {
    min-height: 40px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    font-family: var(--tg-font-ui, inherit);
}

.phone-intl-shell .iti__country.iti__highlight,
.phone-intl-shell .iti__search-clear:hover,
.phone-intl-shell .iti__search-clear:focus-visible {
    background: var(--phone-input-accent-soft);
}

.phone-intl-shell .iti__country.iti__highlight {
    outline: none;
}

.phone-intl-shell .iti__country.iti__highlight .iti__country-name,
.phone-intl-shell .iti__country.iti__highlight .iti__dial-code {
    color: inherit;
}

.phone-intl-shell .iti__country-check {
    color: var(--phone-input-accent);
}

.phone-intl-shell .iti__country-name {
    color: var(--tg-text, #11181f);
}

.phone-intl-shell .iti__dial-code {
    color: #9aa3b2;
}

.phone-intl-shell .iti__country-list::-webkit-scrollbar {
    width: 8px;
}

.phone-intl-shell .iti__country-list::-webkit-scrollbar-track {
    background: transparent;
}

.phone-intl-shell .iti__country-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #b9c0cb;
}

.iti--container {
    z-index: 2100;
}

.phone-intl-dropdown-container {
    z-index: 2100;
}

.phone-intl-dropdown-content {
    margin-top: 12px;
    border: 1px solid var(--tg-border, #e7e7ec);
    border-radius: 14px;
    background: var(--tg-surface, #ffffff);
    box-shadow: 0 16px 36px rgba(17, 24, 31, 0.16);
    overflow: hidden;
}

.phone-intl-dropdown-content--auth {
    border: 1px solid rgba(60, 60, 67, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(16px);
}

.phone-intl-dropdown-container--auth.iti--inline-dropdown .phone-intl-dropdown-content--auth,
.phone-intl-dropdown-container--auth .phone-intl-dropdown-content--auth {
    border: 1px solid rgba(60, 60, 67, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(16px);
}

.phone-intl-dropdown-content .iti__search-input-wrapper {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 6px;
    border-bottom: 0;
    background: var(--tg-surface, #ffffff);
}

.phone-intl-dropdown-content--auth .iti__search-input-wrapper {
    padding: 10px;
    background: rgba(255, 255, 255, 0.98);
}

.phone-intl-dropdown-content .iti__search-icon {
    left: 18px;
}

.phone-intl-dropdown-content .iti__search-input {
    min-height: 42px;
    padding-left: 40px;
    padding-right: 36px;
    border: 1px solid var(--tg-border, #e7e7ec);
    border-radius: 12px;
    background: #f8f8fb;
    color: var(--tg-text, #11181f);
    font-size: 14px;
    line-height: 1.4;
    font-family: var(--tg-font-ui, inherit);
    box-shadow: none;
}

.phone-intl-dropdown-content .iti__search-input::placeholder {
    color: #9aa3b2;
}

.phone-intl-dropdown-content--auth .iti__search-input {
    min-height: 44px;
    border: 1px solid rgba(60, 60, 67, 0.08);
    border-radius: 14px;
    background: var(--tgui-tertiary-bg-color, #f2f2f7);
    color: var(--tgui-text-color, #000000);
    font-size: 17px;
    line-height: 22px;
}

.phone-intl-dropdown-content--auth .iti__search-input::placeholder {
    color: #8e8e93;
}

.phone-intl-dropdown-content .iti__search-input:focus {
    outline: none;
    border-color: rgba(36, 129, 204, 0.34);
    box-shadow: 0 0 0 3px rgba(36, 129, 204, 0.12);
}

.phone-intl-dropdown-content--auth .iti__search-input:focus {
    border-color: rgba(0, 122, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.12);
}

.phone-intl-dropdown-content .iti__search-clear {
    right: 12px;
}

.phone-intl-dropdown-content .iti__country-list {
    max-height: min(320px, calc(100dvh - 180px));
    padding: 0 6px 6px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #b9c0cb transparent;
}

.phone-intl-dropdown-content .iti__country {
    min-height: 40px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    font-family: var(--tg-font-ui, inherit);
}

.phone-intl-dropdown-content--auth .iti__country {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--tgui-text-color, #000000);
    font-size: 17px;
    line-height: 22px;
}

.phone-intl-dropdown-content .iti__country-name {
    color: var(--tg-text, #11181f);
}

.phone-intl-dropdown-content--auth .iti__country-name {
    color: var(--tgui-text-color, #000000);
}

.phone-intl-dropdown-content .iti__dial-code {
    color: #9aa3b2;
}

.phone-intl-dropdown-content--auth .iti__dial-code {
    color: #8e8e93;
}

.phone-intl-dropdown-content .iti__country.iti__highlight,
.phone-intl-dropdown-content .iti__search-clear:hover,
.phone-intl-dropdown-content .iti__search-clear:focus-visible {
    background: var(--phone-input-accent-soft);
}

.phone-intl-dropdown-content--auth .iti__country.iti__highlight,
.phone-intl-dropdown-content--auth .iti__search-clear:hover,
.phone-intl-dropdown-content--auth .iti__search-clear:focus-visible {
    background: var(--tgui-tertiary-bg-color, #f2f2f7);
}

.phone-intl-dropdown-content .iti__country.iti__highlight {
    outline: none;
}

.phone-intl-dropdown-content .iti__country-check {
    color: var(--phone-input-accent);
}

.phone-intl-dropdown-content--auth .iti__country-check {
    color: var(--tgui-link-color, #007aff);
}

.phone-intl-dropdown-content .iti__country-list::-webkit-scrollbar {
    width: 8px;
}

.phone-intl-dropdown-content .iti__country-list::-webkit-scrollbar-track {
    background: transparent;
}

.phone-intl-dropdown-content .iti__country-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #b9c0cb;
}

.phone-intl-shell--auth input.iti__tel-input,
.phone-intl-shell--auth input.iti__tel-input[type="tel"],
.phone-intl-shell--auth input.iti__tel-input[type="text"] {
    color: var(--tgui-text-color, #000000);
    font-size: 17px;
    line-height: 22px;
}

.phone-intl-shell--auth .iti__selected-country,
.phone-intl-shell--auth .iti__selected-dial-code {
    font-size: 17px;
}

.phone-intl-shell--tgui input.iti__tel-input,
.phone-intl-shell--tgui input.iti__tel-input[type="tel"],
.phone-intl-shell--tgui input.iti__tel-input[type="text"] {
    color: var(--tg-text, #111827);
    font-size: 17px;
    line-height: 1.4;
}

.phone-intl-shell--legacy input.iti__tel-input,
.phone-intl-shell--legacy input.iti__tel-input[type="tel"],
.phone-intl-shell--legacy input.iti__tel-input[type="text"] {
    min-height: 38px;
}

.auth-row--phone .phone-intl-shell {
    margin-top: 2px;
}

.auth-row .phone-intl-shell input.iti__tel-input,
.input-group .phone-intl-shell input.iti__tel-input,
.tg-input-cell .phone-intl-shell input.iti__tel-input {
    min-height: inherit;
}

.tg-input-cell .phone-intl-shell {
    margin-top: -2px;
}

@media (max-width: 575.98px) {
    .phone-intl-shell {
        min-height: 32px;
    }

    .phone-intl-shell .iti__country-container {
        margin-right: 12px;
        padding-right: 12px;
    }

    .phone-intl-shell .iti__country-container::after {
        height: 22px;
    }

    .phone-intl-shell .iti__selected-country-primary,
    .phone-intl-shell input.iti__tel-input,
    .phone-intl-shell input.iti__tel-input[type="tel"],
    .phone-intl-shell input.iti__tel-input[type="text"] {
        min-height: 32px;
    }

    .phone-intl-shell .iti__dropdown-content {
        border-radius: 18px;
    }

    .phone-intl-shell .iti__country-list {
        max-height: min(280px, calc(100dvh - 140px));
    }

    .phone-intl-dropdown-content .iti__country-list {
        max-height: min(280px, calc(100dvh - 140px));
    }
}
