.phone-input-wrapper {
    margin-bottom: 15px;
}

.phone-input-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

.phone-input-container {
    display: flex;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: visible;
    transition: border-color .3s;
    background: #fff;
    position: relative;
}

.phone-input-container:focus-within {
    border-color: var(--bs-primary);
}

.country-selector {
    position: relative;
    min-width: 120px;
    z-index: 100;
    border-right: 1px solid #e0e0e0;
}

.country-selected {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    background: #f8f9fa;
    height: 100%;
    gap: 8px;
    border-radius: 10px 0 0 10px;
}

.country-selected:hover {
    background: #f0f0f0;
}

.country-selected img {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    object-fit: cover;
}

.country-selected .selected-code {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.country-selected .arrow {
    margin-left: auto;
    color: #666;
    transition: transform .2s;
}

.country-selector.open .arrow {
    transform: rotate(180deg);
}

.country-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
    z-index: 9999;
    max-height: 350px;
    overflow-y: auto;
    display: none;
    width: 280px;
}

.country-dropdown.show {
    display: block;
}

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

.country-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    direction: ltr;
}

.country-search-input:focus {
    border-color: var(--bs-primary);
}

.country-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    gap: 12px;
    transition: background .2s;
    direction: ltr;
}

.country-item:hover {
    background: #f5f5f5;
}

.country-item.selected {
    background: color-mix(in srgb, var(--bs-primary) 10%, transparent);
}

.country-item img {
    width: 28px;
    height: 20px;
    border-radius: 3px;
    object-fit: cover;
}

.country-item .name {
    flex: 1;
    font-size: 14px;
    color: #333;
    text-align: left;
}

.country-item .dial-code {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.phone-input {
    flex: 1;
    border: none;
    padding: 12px;
    font-size: 16px;
    outline: none;
    direction: ltr;
    text-align: left;
    border-radius: 0 10px 10px 0;
    font-family: inherit;
    min-width: 0;
}

.phone-input::placeholder {
    color: #aaa;
    text-align: left;
}

.phone-input:disabled,
.phone-input[readonly] {
    background: #f8f9fa;
}

/* Responsive: small screens show flag only, hide dial code */
@media (max-width: 480px) {
    .country-selector {
        min-width: unset;
    }

    .country-selected {
        padding: 10px;
        gap: 4px;
    }

    .country-selected .selected-code {
        display: none;
    }

    .country-selected .arrow {
        font-size: 11px;
    }

    .country-selected img {
        width: 26px;
        height: 18px;
    }
}
