.country-picker-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body.country-picker-open {
    overflow: hidden;
}

.country-picker-field {
    position: relative;
    width: 100%;
}

.country-picker-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 0.8rem 2.8rem 0.8rem 1rem;
    border: 1px solid #d9e1ec;
    border-radius: 14px;
    background: #fff;
    color: #24344d;
    text-align: left;
    box-shadow: 0 10px 28px rgba(37, 64, 97, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.country-picker-trigger:hover,
.country-picker-trigger:focus-visible {
    border-color: #5dc7de;
    box-shadow: 0 14px 32px rgba(52, 122, 152, 0.14);
    outline: none;
}

.country-picker-trigger.is-invalid {
    border-color: #dc3545;
}

.country-picker-trigger:disabled {
    background: #f4f7fb;
    color: #8a96ab;
    box-shadow: none;
    cursor: not-allowed;
}

.country-picker-trigger__summary {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.country-picker-trigger__text {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.country-picker-trigger__primary,
.country-picker-trigger__secondary,
.country-picker-option__english,
.country-picker-option__russian {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-picker-trigger__primary,
.country-picker-option__english {
    font-weight: 600;
}

.country-picker-trigger__secondary,
.country-picker-option__russian {
    color: #6f7f95;
    font-size: 0.86rem;
}

.country-picker-trigger__placeholder {
    color: #7d8aa0;
    font-weight: 500;
}

.country-picker-trigger__chevron {
    position: absolute;
    right: 1rem;
    top: 50%;
    width: 0.7rem;
    height: 0.7rem;
    border-right: 2px solid #7d8aa0;
    border-bottom: 2px solid #7d8aa0;
    transform: translateY(-60%) rotate(45deg);
    pointer-events: none;
}

.country-picker-flag,
.country-picker-trigger__flag,
.country-picker-option__flag {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    min-width: 1.6rem;
    height: 1.15rem;
    border-radius: 0.3rem;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(27, 44, 76, 0.08);
    background: linear-gradient(135deg, #eef4fb, #d9e5f3);
}

.country-picker-flag__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.country-picker-flag__fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.country-picker-flag__fallback::before {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: rgba(36, 52, 77, 0.38);
}

[data-country-flag-wrapper].is-fallback .country-picker-flag__image {
    display: none;
}

[data-country-flag-wrapper].is-fallback .country-picker-flag__fallback {
    display: inline-flex;
}

.country-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.country-picker-overlay[hidden] {
    display: none !important;
}

.country-picker-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 16, 28, 0.52);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.country-picker-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1080px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(10, 26, 48, 0.24);
    overflow: hidden;
    pointer-events: auto;
}

.country-picker-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.4rem 1rem;
    border-bottom: 1px solid rgba(33, 62, 99, 0.08);
}

.country-picker-dialog__title {
    margin: 0;
    color: #1f3152;
    font-size: 1.15rem;
    font-weight: 700;
}

.country-picker-dialog__subtitle {
    margin-top: 0.25rem;
    color: #6f7f95;
    font-size: 0.88rem;
}

.country-picker-dialog__subtitle:empty {
    display: none;
}

.country-picker-dialog__close {
    border: 0;
    background: transparent;
    color: #5e718d;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.1rem 0.3rem;
}

.country-picker-dialog__close:hover,
.country-picker-dialog__close:focus-visible {
    color: #21355b;
    outline: none;
}

.country-picker-toolbar {
    display: grid;
    gap: 0.9rem;
    padding: 1rem 1.4rem 0.9rem;
    border-bottom: 1px solid rgba(33, 62, 99, 0.08);
}

.country-picker-search {
    width: 100%;
    border: 1px solid #d9e1ec;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    background: #f9fbfe;
    color: #223552;
    font-size: 0.96rem;
    pointer-events: auto;
}

.country-picker-search:focus {
    border-color: #5dc7de;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(93, 199, 222, 0.15);
}

.country-picker-alpha {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.country-picker-alpha__button {
    border: 0;
    border-radius: 999px;
    padding: 0.35rem 0.72rem;
    background: #eef5fb;
    color: #39516f;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.country-picker-alpha__button.is-active {
    background: #5dc7de;
    color: #fff;
    box-shadow: 0 10px 24px rgba(54, 134, 160, 0.22);
}

.country-picker-alpha__button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.country-picker-alpha__button:hover,
.country-picker-alpha__button:focus-visible {
    background: #dff5fb;
    color: #103954;
    outline: none;
}

.country-picker-alpha__button.is-active:hover,
.country-picker-alpha__button.is-active:focus-visible {
    background: #44b8d1;
    color: #fff;
}

.country-picker-content {
    overflow: auto;
    padding: 1.1rem 1.4rem 1.4rem;
}

.country-picker-recent + .country-picker-groups {
    margin-top: 1.35rem;
}

.country-picker-section + .country-picker-section {
    margin-top: 1.25rem;
}

.country-picker-section__title {
    margin: 0 0 0.75rem;
    color: #4f6484;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.country-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
    align-items: stretch;
}

.country-picker-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    min-height: 108px;
    padding: 0.78rem 0.9rem;
    border: 1px solid #e3eaf3;
    border-radius: 16px;
    background: #fff;
    color: #203351;
    text-align: left;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.country-picker-option:hover,
.country-picker-option:focus-visible {
    border-color: #5dc7de;
    background: #f9fdff;
    box-shadow: 0 14px 28px rgba(45, 88, 129, 0.12);
    transform: translateY(-1px);
    outline: none;
}

.country-picker-option.is-selected {
    border-color: #49bfd8;
    background: linear-gradient(180deg, rgba(93, 199, 222, 0.1), rgba(93, 199, 222, 0.04));
}

.country-picker-option__text {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
    min-width: 0;
}

.country-picker-option__check {
    margin-left: auto;
    color: #1c9ab8;
    font-size: 1rem;
    font-weight: 700;
}

.country-picker-empty {
    padding: 2.2rem 1rem;
    border: 1px dashed #d2dbe7;
    border-radius: 18px;
    color: #6f7f95;
    text-align: center;
}

.country-picker-recent__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.country-picker-recent__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid #dde7f1;
    border-radius: 999px;
    padding: 0.46rem 0.8rem;
    background: #fff;
    color: #29415f;
    font-size: 0.88rem;
    font-weight: 600;
}

.country-picker-recent__chip:hover,
.country-picker-recent__chip:focus-visible {
    border-color: #5dc7de;
    background: #f7fdff;
    outline: none;
}

@media (max-width: 1199.98px) {
    .country-picker-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .country-picker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .country-picker-overlay {
        padding: 0.65rem;
        align-items: flex-end;
    }

    .country-picker-dialog {
        width: 100%;
        max-height: calc(100vh - 1.3rem);
        border-bottom-right-radius: 20px;
        border-bottom-left-radius: 20px;
    }

    .country-picker-dialog__header,
    .country-picker-toolbar,
    .country-picker-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .country-picker-grid {
        grid-template-columns: 1fr;
    }
}
