/* Shared phone field widget — load on every page that mounts PhoneField */

.phone-field-widget {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.phone-field-widget--picker-open {
    z-index: 1;
}

.phone-field-composite {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-height: 2.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(212 212 212 / 0.8);
    background: #fff;
    overflow: visible;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.dark .phone-field-composite {
    border-color: rgb(38 38 38);
    background: rgb(10 10 10);
}

.phone-field-composite:focus-within {
    border-color: rgb(16 185 129 / 0.6);
    box-shadow: 0 0 0 2px rgb(16 185 129 / 0.3);
}

.phone-field-composite--error {
    border-color: rgb(248 113 113);
    box-shadow: 0 0 0 2px rgb(248 113 113 / 0.35);
}

.phone-field-composite--highlight {
    border-color: rgb(251 191 36);
    box-shadow: 0 0 0 2px rgb(251 191 36 / 0.45);
}

.phone-field-country-wrap {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-self: stretch;
}

.phone-field-country-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 100%;
    min-height: 2.5rem;
    min-width: 5.5rem;
    padding: 0 0.65rem;
    border: none;
    border-right: 1px solid rgb(212 212 212 / 0.8);
    border-radius: 0.5rem 0 0 0.5rem;
    background: rgb(250 250 250);
    color: rgb(23 23 23);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.dark .phone-field-country-btn {
    border-right-color: rgb(38 38 38);
    background: rgb(23 23 23);
    color: rgb(250 250 250);
}

.phone-field-country-btn:hover {
    background: rgb(245 245 245);
}

.dark .phone-field-country-btn:hover {
    background: rgb(38 38 38);
}

.phone-field-country-flag {
    font-size: 1.1rem;
    line-height: 1;
}

.phone-field-country-dial {
    font-variant-numeric: tabular-nums;
}

.phone-field-country-chevron {
    font-size: 0.65rem;
    opacity: 0.55;
    margin-left: 0.1rem;
}

.phone-field-national {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 2.5rem;
    min-height: 2.5rem;
    padding: 0 0.75rem;
    border: none;
    border-radius: 0 0.5rem 0.5rem 0;
    background: transparent;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(23 23 23);
    outline: none;
    box-sizing: border-box;
}

.dark .phone-field-national {
    color: rgb(250 250 250);
}

.phone-field-national::placeholder {
    color: rgb(163 163 163);
}

.dark .phone-field-national::placeholder {
    color: rgb(82 82 82);
}

.phone-field-national:-webkit-autofill,
.phone-field-national:-webkit-autofill:hover,
.phone-field-national:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgb(10 10 10) inset;
    -webkit-text-fill-color: rgb(250 250 250);
    caret-color: rgb(250 250 250);
    transition: background-color 99999s ease-out 0s;
}

html:not(.dark) .phone-field-national:-webkit-autofill,
html:not(.dark) .phone-field-national:-webkit-autofill:hover,
html:not(.dark) .phone-field-national:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    -webkit-text-fill-color: rgb(23 23 23);
    caret-color: rgb(23 23 23);
}

.phone-field-country-panel {
    position: fixed;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    border-radius: 0.625rem;
    border: 1px solid rgb(212 212 212);
    background: #fff;
    box-shadow:
        0 4px 6px rgb(0 0 0 / 0.06),
        0 16px 40px rgb(0 0 0 / 0.18);
    overflow: hidden;
    box-sizing: border-box;
}

.dark .phone-field-country-panel {
    border-color: rgb(38 38 38);
    background: rgb(12 12 12);
    box-shadow: 0 12px 32px rgb(0 0 0 / 0.45);
}

.phone-field-country-panel.hidden {
    display: none;
}

.phone-field-country-search-wrap {
    padding: 0.5rem;
    border-bottom: 1px solid rgb(229 229 229);
    flex-shrink: 0;
}

.dark .phone-field-country-search-wrap {
    border-bottom-color: rgb(38 38 38);
}

.phone-field-country-search {
    width: 100%;
    min-height: 2.75rem;
    padding: 0 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid rgb(212 212 212);
    font-size: 16px;
    background: rgb(250 250 250);
    color: rgb(23 23 23);
    outline: none;
    box-sizing: border-box;
}

.phone-field-country-search:-webkit-autofill,
.phone-field-country-search:-webkit-autofill:hover,
.phone-field-country-search:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgb(250 250 250) inset !important;
    -webkit-text-fill-color: rgb(23 23 23) !important;
}

.dark .phone-field-country-search {
    border-color: rgb(38 38 38);
    background: rgb(23 23 23);
    color: rgb(250 250 250);
}

.dark .phone-field-country-search:-webkit-autofill,
.dark .phone-field-country-search:-webkit-autofill:hover,
.dark .phone-field-country-search:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgb(23 23 23) inset !important;
    -webkit-text-fill-color: rgb(250 250 250) !important;
}

.phone-field-country-search:focus {
    border-color: rgb(16 185 129 / 0.6);
    box-shadow: 0 0 0 2px rgb(16 185 129 / 0.25);
}

.phone-field-country-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 3rem;
    max-height: inherit;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.phone-field-country-empty {
    padding: 1rem 0.75rem;
    text-align: center;
    font-size: 0.8125rem;
    color: rgb(115 115 115);
    pointer-events: none;
}

.dark .phone-field-country-empty {
    color: rgb(163 163 163);
}

.phone-field-country-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.8125rem;
    color: rgb(64 64 64);
}

.dark .phone-field-country-option {
    color: rgb(212 212 212);
}

.phone-field-country-option:hover,
.phone-field-country-option.is-highlighted {
    background: rgb(245 245 245);
}

.dark .phone-field-country-option:hover,
.dark .phone-field-country-option.is-highlighted {
    background: rgb(30 30 30);
}

.phone-field-country-option.is-selected {
    background: rgb(236 253 245);
}

.dark .phone-field-country-option.is-selected {
    background: rgb(6 78 59 / 0.35);
}

.phone-field-country-option-flag {
    flex-shrink: 0;
    font-size: 1.05rem;
}

.phone-field-country-option-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phone-field-country-option-dial {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    color: rgb(115 115 115);
}

.dark .phone-field-country-option-dial {
    color: rgb(163 163 163);
}

@media (max-width: 480px) {
    .phone-field-country-btn {
        min-width: 5rem;
        padding: 0 0.5rem;
    }

    .phone-field-country-option {
        min-height: 3rem;
    }
}
