/* رمز الدولة (يسار) + الهاتف (يمين) — أعلام صور */
.eg-phone-row {
    display: flex;
    flex-direction: row;
    direction: ltr;
    align-items: stretch;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.eg-phone-dial-picker {
    position: relative;
    flex: 0 0 auto;
    order: 1;
    z-index: 20;
}

.eg-phone-number {
    flex: 1 1 auto;
    min-width: 0;
    order: 2;
    direction: ltr;
    text-align: left;
}

.eg-phone-dial-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 7.2rem;
    height: 100%;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background: #f8f9fa;
    color: #1e3c72;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    direction: ltr;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.eg-phone-dial-trigger:hover {
    border-color: #1e3c72;
    background: #fff;
}

.eg-phone-dial-trigger:focus {
    outline: none;
    border-color: #1e3c72;
    box-shadow: 0 0 0 2px rgba(30, 60, 114, 0.18);
}

.eg-phone-dial-flag,
.eg-phone-dial-option-flag-img {
    display: block;
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    background: #e9ecef;
}

.eg-phone-dial-code {
    flex: 1;
    text-align: left;
}

.eg-phone-dial-chevron {
    font-size: 0.65rem;
    opacity: 0.65;
    margin-left: 2px;
}

.eg-phone-dial-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: auto;
    width: min(18rem, calc(100vw - 2rem));
    max-height: 16rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
    overflow: hidden;
    z-index: 1200;
    direction: rtl;
}

.eg-phone-dial-panel.is-open {
    display: flex;
    flex-direction: column;
}

.eg-phone-dial-search {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #eee;
    font-family: inherit;
    font-size: 0.88rem;
    background: #fafbfc;
    color: #333;
    direction: rtl;
    text-align: right;
}

.eg-phone-dial-search:focus {
    outline: none;
    background: #fff;
    border-bottom-color: #1e3c72;
}

.eg-phone-dial-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    overflow-y: auto;
    flex: 1;
}

.eg-phone-dial-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.86rem;
    text-align: right;
    cursor: pointer;
    color: #333;
    direction: rtl;
}

.eg-phone-dial-option:hover,
.eg-phone-dial-option.is-selected {
    background: rgba(30, 60, 114, 0.08);
}

.eg-phone-dial-option.is-selected {
    font-weight: 700;
    color: #1e3c72;
}

.eg-phone-dial-option-flag {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.eg-phone-dial-option-name {
    flex: 1;
    min-width: 0;
}

.eg-phone-dial-option-code {
    direction: ltr;
    font-weight: 700;
    color: #1e3c72;
    flex-shrink: 0;
}

.eg-phone-dial-empty {
    padding: 12px;
    text-align: center;
    color: #888;
    font-size: 0.85rem;
}

.register-phone-otp-row {
    direction: ltr;
    flex-wrap: wrap;
}

.register-phone-otp-row .eg-phone-row-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    order: 1;
}

.register-phone-otp-row .eg-phone-row {
    width: 100%;
}

.register-phone-otp-row .register-otp-input {
    order: 2;
}

.register-phone-otp-row .btn-otp-send {
    order: 3;
}

.contact-form .eg-phone-row,
.form-group .eg-phone-row {
    width: 100%;
}

select.eg-phone-dial {
    display: none !important;
}

@media (max-width: 420px) {
    .register-phone-otp-row .eg-phone-row-wrap {
        flex: 1 1 100%;
        width: 100%;
    }

    .eg-phone-dial-trigger {
        min-width: 6.4rem;
        padding: 0 8px;
        font-size: 0.8rem;
    }

    .eg-phone-dial-panel {
        width: min(16.5rem, calc(100vw - 1.5rem));
    }
}
