.phone-field-group { margin-bottom: 20px; }

.phone-field-group > label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.phone-input-row {
    display: flex;
    gap: 8px;
}

.phone-number-input {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s;
}

.phone-number-input:focus {
    outline: none;
    border-color: var(--primary, #0078d4);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #0078d4) 15%, transparent);
}

.phone-number-input {
    flex: 1;
    min-width: 0;
}

.phone-number-input::placeholder {
    color: #9ca3af;
}

/* Custom flag country picker - the real <select> stays in the DOM (visually
   hidden, not display:none) so the field still submits/works without JS;
   the button + listbox below are the actual UI. */
.phone-country-picker {
    position: relative;
    flex: 0 0 auto;
}

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

.phone-country-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s;
}

.phone-country-trigger:hover {
    border-color: var(--primary, #0078d4);
}

.phone-country-trigger:focus-visible,
.phone-country-picker:focus-within .phone-country-trigger {
    outline: none;
    border-color: var(--primary, #0078d4);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #0078d4) 15%, transparent);
}

.phone-country-trigger .phone-country-flag {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    background: #eee;
}

.phone-country-trigger i {
    font-size: 0.65rem;
    color: #6b7280;
}

.phone-country-dropdown {
    list-style: none;
    margin: 4px 0 0;
    padding: 4px 0;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 50;
}

.phone-country-dropdown[hidden] {
    display: none;
}

.phone-country-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    color: #1e1e1e;
}

.phone-country-option .phone-country-flag {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
    background: #eee;
}

.phone-country-option .phone-country-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phone-country-option .phone-country-dial {
    color: #6b7280;
}

.phone-country-option:hover,
.phone-country-option.is-active {
    background: color-mix(in srgb, var(--primary, #0078d4) 10%, transparent);
}

.phone-country-option[aria-selected="true"] {
    background: color-mix(in srgb, var(--primary, #0078d4) 16%, transparent);
    color: var(--primary-dark, var(--primary, #0078d4));
    font-weight: 600;
}

@media (max-width: 480px) {
    .phone-input-row { flex-direction: column; }
    .phone-country-picker { width: 100%; }
    .phone-country-trigger { width: 100%; justify-content: space-between; }
    .phone-country-dropdown { width: 100%; }
}
