.phone-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.phone-input__label {
    font-size: 0.7rem;
    color: var(--text);
    line-height: 100%;
}

.phone-input__input {
    width: 100%;
    background-color: var(--brand-muted);
    border: 1px solid transparent;
    border-radius: 1.2rem;
    padding: 0.5rem 1.2rem;
    font-family: var(--font-main);
    color: var(--text);
    outline: none;
    transition: border-color 0.3s ease, border-radius 0.15s ease;
    box-shadow: 0 20px 40px -15px rgba(10, 61, 36, 0.05);
    font-size: 0.9rem;
    line-height: 100%;
    padding-left: 6.2rem !important;
    max-height: 2.1rem;
}

.phone-input__input::placeholder{
    color: #B9C1C1;
}

.phone-input__input:focus {
    border-color: var(--brand);
}

/* intl-tel-input */
.phone-input .iti {
    position: relative;
    width: 100%;
    z-index: 1;
    overflow: visible;
}

.phone-input .iti.is-iti-open,
.phone-input.is-iti-open .iti {
    z-index: 20;
}

.phone-input .iti__flag-container {
    border-radius: 16px 0 0 16px;
}

.phone-input.is-iti-open .iti input.iti__tel-input,
.phone-input .iti.is-iti-open input.iti__tel-input {
    border-radius: 1.2rem 1.2rem 0 0;
}

.phone-input .iti__arrow {
    width: 1.2rem;
    height: 1.2rem;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="5" viewBox="0 0 10 5" fill="none"><path d="M5 5L0 0H10L5 5Z" fill="%231C1B1F"/></svg>');
    background-position: center;
    background-size: 10px;
    background-repeat: no-repeat;
    position: relative;
    border: none;
    transform: none;
    margin: 0;
    transition: transform 0.3s ease-in-out;
}

.phone-input .iti__arrow.iti__arrow--up {
    transform: rotate(180deg);
}

.phone-input .iti__selected-country-primary {
    padding: 0 0 0 1.2rem;
    background: transparent !important;
}

.phone-input .iti__selected-country {
    cursor: pointer;
    left: 0;
    top: 0;
}

.phone-input .iti__country-selector,
.phone-input .iti--detached-country-selector,
.phone-input .iti.iti--inline-country-selector .iti__country-selector {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 1.2rem .6rem 1.2rem 1.2rem;
    background: var(--brand-muted);
    border: none;
    border-radius: 0 0 1.2rem 1.2rem;
    box-shadow: 0 20px 40px -15px rgba(10, 61, 36, 0.08);
    z-index: 30;
    opacity: 0;
    transform: translateY(1rem);
    pointer-events: none;
    transition: opacity 0.3s ease,
        transform 0.3s ease;
    position-try-fallbacks: none;
}

.phone-input .iti.is-iti-open.is-iti-dropdown-ready .iti__country-selector,
.phone-input .iti.is-iti-open.is-iti-dropdown-ready .iti--detached-country-selector,
.phone-input .iti__country-selector.is-iti-dropdown-ready,
.phone-input .phone-input-iti-dropdown.is-iti-dropdown-ready {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}


.iti__country-container {
    width: 100%;
}

.phone-input .iti__country-list,
.iti--detached-country-selector .iti__country-list,
.iti--container .iti__country-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-height: 10rem;
    overflow: auto;
    padding: 0 .6rem 0 0;
    margin: 0;
    background: transparent;
    white-space: normal;
    -webkit-mask-image: linear-gradient(to bottom,
            transparent,
            #000 0.1rem,
            #000 calc(100% - 0.1rem),
            transparent);
    mask-image: linear-gradient(to bottom,
            transparent,
            #000 0.1rem,
            #000 calc(100% - 0.1rem),
            transparent);
}

.phone-input .iti__country-list::-webkit-scrollbar,
.iti--detached-country-selector .iti__country-list::-webkit-scrollbar,
.iti--container .iti__country-list::-webkit-scrollbar {
    width: 0.375rem;
    border-radius: .5rem;
}

.phone-input .iti__country-list::-webkit-scrollbar-thumb,
.iti--detached-country-selector .iti__country-list::-webkit-scrollbar-thumb,
.iti--container .iti__country-list::-webkit-scrollbar-thumb {
    background-color: var(--brand, var(--main-blue));
    border-radius: .5rem;
    width: 0.25rem;
    border: 1px solid #d9d9d9;
}

.phone-input .iti__country-list::-webkit-scrollbar-track,
.iti--detached-country-selector .iti__country-list::-webkit-scrollbar-track,
.iti--container .iti__country-list::-webkit-scrollbar-track {
    background: #d9d9d9;
    border-radius: .5rem;
    padding: 1px;
}

.phone-input .iti__country,
.iti--detached-country-selector .iti__country,
.iti--container .iti__country {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

.phone-input .iti__country.iti__highlight,
.iti--detached-country-selector .iti__country.iti__highlight,
.iti--container .iti__country.iti__highlight {
    background: transparent !important;
    color: var(--brand) !important;
}

.phone-input .iti__country-check-svg,
.iti--detached-country-selector .iti__country-check-svg {
    color: var(--brand) !important;
}

.phone-input .iti__country-name,
.iti--container .iti__country-name {
    color: inherit;
    font-size: .8rem;
}

.phone-input .iti__dial-code,
.iti--container .iti__dial-code {
    color: var(--text-muted);
}

.phone-input .iti__country-list .iti__flag,
.iti--container .iti__country-list .iti__flag {
    margin-right: 0;
    margin-left: 0.2rem;
}

.phone-input .iti__no-results {
    color: var(--text-muted);
    font-size: 0.76rem;
    padding: 0.52rem 0;
}

/*
 * Same shake as .js-lead-form .is-invalid (feedback-dialog).
 * Overrides intl-tel-input strictMode reject animation.
 */
@keyframes cct-field-shake {
    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

.phone-input .iti__strict-reject-animation .iti__tel-input,
.phone-input .iti__strict-reject-animation .iti__selected-country,
.iti__strict-reject-animation .iti__tel-input,
.iti__strict-reject-animation .iti__selected-country {
    animation: cct-field-shake 0.45s ease !important;
}

@media (prefers-reduced-motion: reduce) {
    .phone-input .iti__country-selector,
    .phone-input .iti--detached-country-selector,
    .phone-input__input {
        transition: none;
    }

    .phone-input .iti__strict-reject-animation .iti__tel-input,
    .phone-input .iti__strict-reject-animation .iti__selected-country,
    .iti__strict-reject-animation .iti__tel-input,
    .iti__strict-reject-animation .iti__selected-country {
        animation: none !important;
    }
}

/* SVG flags — EU onlyCountries */
:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.35);
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__at {
    background-image: url('../../../assets/images/flags/at.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__be {
    background-image: url('../../../assets/images/flags/be.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__bg {
    background-image: url('../../../assets/images/flags/bg.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__hr {
    background-image: url('../../../assets/images/flags/hr.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__cy {
    background-image: url('../../../assets/images/flags/cy.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__cz {
    background-image: url('../../../assets/images/flags/cz.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__dk {
    background-image: url('../../../assets/images/flags/dk.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__ee {
    background-image: url('../../../assets/images/flags/ee.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__fi {
    background-image: url('../../../assets/images/flags/fi.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__fr {
    background-image: url('../../../assets/images/flags/fr.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__de {
    background-image: url('../../../assets/images/flags/de.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__gr {
    background-image: url('../../../assets/images/flags/gr.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__hu {
    background-image: url('../../../assets/images/flags/hu.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__ie {
    background-image: url('../../../assets/images/flags/ie.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__it {
    background-image: url('../../../assets/images/flags/it.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__lv {
    background-image: url('../../../assets/images/flags/lv.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__lt {
    background-image: url('../../../assets/images/flags/lt.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__lu {
    background-image: url('../../../assets/images/flags/lu.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__mt {
    background-image: url('../../../assets/images/flags/mt.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__nl {
    background-image: url('../../../assets/images/flags/nl.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__pl {
    background-image: url('../../../assets/images/flags/pl.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__pt {
    background-image: url('../../../assets/images/flags/pt.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__ro {
    background-image: url('../../../assets/images/flags/ro.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__sk {
    background-image: url('../../../assets/images/flags/sk.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__si {
    background-image: url('../../../assets/images/flags/si.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__es {
    background-image: url('../../../assets/images/flags/es.svg');
}

:is(.phone-input, .iti--detached-country-selector, .iti--container) .iti__flag.iti__se {
    background-image: url('../../../assets/images/flags/se.svg');
}