.fcps-phone-ui {
    display: flex;
    gap: 10px;
    width: 100%;
    align-items: stretch;
}

.fcps-country-wrap {
    position: relative;
    flex: 0 0 150px;
    min-width: 140px;
}

.fcps-country-button,
.fcps-local-number {
    box-sizing: border-box;
    min-height: 44px;
    font: inherit;
    color: inherit;
    background: #fff;
}

.fcps-country-button {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid #777771;
    border-radius: 0;
    cursor: pointer;
    text-align: left;
    line-height: 1.2;
}

.fcps-country-button-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.fcps-flag-frame {
    width: 24px;
    height: 18px;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 2px;
    background: #f1f1f1;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.fcps-flag-frame img {
    display: block;
    width: 24px;
    height: 18px;
    object-fit: cover;
}

.fcps-globe {
    width: 16px;
    height: 16px;
    display: block;
    opacity: .65;
}

.fcps-dial-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fcps-country-button.fcps-placeholder .fcps-dial-label {
    color: #777;
}

.fcps-chevron {
    width: 9px;
    height: 6px;
    flex: 0 0 auto;
    transition: transform .16s ease;
}

.fcps-country-button[aria-expanded="true"] .fcps-chevron {
    transform: rotate(180deg);
}

.fcps-local-number {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.fcps-country-menu {
    position: absolute;
    z-index: 999999;
    left: 0;
    top: calc(100% + 5px);
    width: min(360px, calc(100vw - 32px));
    max-height: 350px;
    background: #fff;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    box-shadow: 0 10px 28px rgba(0,0,0,.14);
    overflow: hidden;
}

.fcps-country-menu[hidden] {
    display: none !important;
}

.fcps-search-wrap {
    padding: 9px;
    border-bottom: 1px solid #e8e8e8;
    background: #fff;
}

.fcps-country-search {
    width: 100%;
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px 10px;
    font: inherit;
    border: 1px solid #cfcfcf;
    border-radius: 3px;
    background: #fff;
    color: #222;
}

.fcps-country-list {
    max-height: 286px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px 0;
}

.fcps-country-option {
    width: 100%;
    border: 0;
    background: transparent;
    color: #222;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font: inherit;
    line-height: 1.25;
    cursor: pointer;
    text-align: left;
}

.fcps-country-option:hover,
.fcps-country-option:focus,
.fcps-country-option[aria-selected="true"] {
    background: #f3f5f7;
    outline: none;
}

.fcps-country-name {
    flex: 1 1 auto;
    min-width: 0;
}

.fcps-country-code {
    flex: 0 0 auto;
    color: #666;
    white-space: nowrap;
}

.fcps-empty-result {
    padding: 14px 12px;
    color: #777;
    font-size: .95em;
}

/* Keep the original Forminator input available to Forminator while removing it visually. */
.fcps-original-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.fcps-country-button:focus,
.fcps-country-search:focus,
.fcps-local-number:focus {
    outline-offset: 1px;
}

.fcps-phone-ui.fcps-country-required .fcps-country-button {
    border-color: #d63638;
}

@media (max-width: 520px) {
    .fcps-phone-ui {
        gap: 8px;
    }

    .fcps-country-wrap {
        flex-basis: 128px;
        min-width: 128px;
    }

    .fcps-country-button {
        padding-left: 9px;
        padding-right: 9px;
    }

    .fcps-country-menu {
        width: min(330px, calc(100vw - 28px));
    }
}
