.phone-input-wrapper {
    position: relative;
}

.phone-input-wrapper .country-code-selector {
    position: static;
}

.phone-input-wrapper .country-code-dropdown {
    position: absolute;
}

.phone-input-group {
    display: flex;
    width: 100%;
    border: 1px solid #d9d9d9;
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.phone-input-group:focus-within {
    border-color: #7367f0;
    box-shadow: 0 0 0 0.2rem rgba(115, 103, 240, 0.25);
}

.phone-input-group.is-invalid {
    border-color: #ea5455;
}

.country-code-selector {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-left: 1px solid #d9d9d9;
    border-radius: 0.5rem 0 0 0.5rem;
    padding: 0 0.75rem;
    /* min-width: 100px; */
    cursor: pointer;
    transition: background 0.2s;
}

.country-code-selector:hover {
    background: #e9ecef;
}

.country-code-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    user-select: none;
}

.country-code-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 0.5rem;
    max-height: 320px;
    overflow: hidden;
    z-index: 1050;
    display: none;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

.country-code-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.country-search {
    position: sticky;
    top: 0;
    background: white;
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    z-index: 1;
}

.country-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d9d9d9;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.country-search input:focus {
    outline: none;
    border-color: #7367f0;
}

.country-list {
    max-height: 240px;
    overflow-y: auto;
}

.country-option {
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    transition: background 0.15s;
}

.country-option:hover {
    background: #f8f9fa;
}

.country-option.active {
    background: #7367f0;
    color: white;
}

.country-name {
    flex: 1;
}

.country-code {
    color: #6e6b7b;
    font-size: 0.85rem;
    margin-right: auto;
}

.country-option.active .country-code {
    color: rgba(255, 255, 255, 0.9);
}

#phone {
    border: none !important;
    flex: 1;
    padding: 0.736rem 1rem;
    font-size: 1rem;
    outline: none;
    background: transparent;
    border-radius: 0 0.5rem 0.5rem 0;
}

#phone:focus {
    box-shadow: none !important;
}

.no-results {
    padding: 1.5rem 1rem;
    text-align: center;
    color: #b9b9c3;
    font-size: 0.875rem;
}

/* Custom scrollbar */
.country-list::-webkit-scrollbar {
    width: 6px;
}

.country-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.country-list::-webkit-scrollbar-thumb {
    background: #d9d9d9;
    border-radius: 3px;
}

.country-list::-webkit-scrollbar-thumb:hover {
    background: #c1c1c1;
}
