/* CSP-safe searchable country combobox */
.country-picker {
    position: relative;
    width: 100%;
}

.country-picker__selected {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.country-picker__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    max-width: 100%;
    border: 1px solid #c7d2fe;
    border-radius: 9999px;
    background: #eef2ff;
    color: #312e81;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.country-picker__chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-picker__chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: #4338ca;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
}

.country-picker__chip-remove:hover,
.country-picker__chip-remove:focus-visible {
    background: #c7d2fe;
    color: #1e1b4b;
    outline: none;
}

.country-picker__input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.625rem 0.875rem;
    color: #0f172a;
    outline: none;
}

.country-picker__input:focus {
    border-color: #35296a;
    box-shadow: 0 0 0 3px rgba(53, 41, 106, 0.16);
}

.country-picker__results {
    position: absolute;
    z-index: 50;
    top: calc(100% + 0.25rem);
    right: 0;
    left: 0;
    max-height: 18rem;
    overflow-y: auto;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.16);
}

.country-picker__group-label {
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
    color: #64748b;
    padding: 0.5rem 0.75rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.country-picker__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f8fafc;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
    padding: 0.625rem 0.75rem;
    text-align: left;
}

.country-picker__option:hover,
.country-picker__option.is-active {
    background: #f1f5f9;
}

.country-picker__option.is-selected {
    color: #312e81;
    font-weight: 700;
}

.country-picker__option:focus-visible {
    position: relative;
    z-index: 1;
    outline: 3px solid rgba(53, 41, 106, 0.32);
    outline-offset: -3px;
}

.country-picker__check {
    color: #35296a;
    font-weight: 700;
}

.country-picker__status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.country-picker__native-select {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .country-picker__option,
    .country-picker__chip-remove {
        transition: none;
    }
}
