/* Sudan-only phone input */
.phone-sudan-cell {
    display: flex;
    align-items: stretch;
    gap: 12px;
    width: 100%;
}

.phone-sudan-prefix {
    width: 100px;
    min-width: 100px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f7f8f8;
    color: #002f34;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    user-select: none;
    pointer-events: none;
}

.phone-sudan-hint {
    display: block;
    margin-top: 6px;
    color: #5b7b7d;
    font-size: 12px;
    line-height: 1.4;
}

.phone-sudan-flag {
    position: relative;
    width: 18px;
    height: 12px;
    flex-shrink: 0;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 47, 52, 0.12);
    background:
        linear-gradient(to bottom, #d3202f 0 33.33%, #ffffff 33.33% 66.66%, #111111 66.66% 100%);
}

.phone-sudan-flag::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 40%;
    height: 100%;
    background: #007a3d;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.phone-sudan-code {
    line-height: 1;
}

.phone-sudan-cell .phone-number-input {
    flex: 1;
    min-width: 120px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.phone-sudan-cell .phone-number-input[readonly] {
    background: #f7f8f8;
    color: #002f34;
    cursor: default;
}

.phone-sudan-cell .phone-number-input:focus {
    border-color: #0c9267;
    box-shadow: 0 0 0 3px rgba(12, 146, 103, 0.15);
}

@media (max-width: 576px) {
    .phone-sudan-prefix {
        width: 112px;
        min-width: 112px;
        font-size: 13px;
    }

    .phone-sudan-flag {
        width: 16px;
        height: 11px;
    }
}

/* Legacy phone input styles kept for older markup */
.phone-input-wrap {
    position: relative;
    width: 100%;
}

/* Force LTR: country code on left, number on right */
.phone-input-inner {
    display: flex;
    flex-direction: row;
    direction: ltr;
    align-items: stretch;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    min-height: 44px;
}

.phone-input-inner:focus-within {
    border-color: #0c9267;
    box-shadow: 0 0 0 3px rgba(12, 146, 103, 0.15);
}

.phone-country-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    background: #f7f8f8;
    border: none;
    cursor: pointer;
    min-width: 95px;
    font-size: 13px;
    color: #002f34;
    outline: none;
    border-right: 1px solid #e8ebeb;
    transition: background 0.2s;
}

.phone-country-trigger:hover {
    background: #ebeeef;
}

.phone-flag-img {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.phone-code {
    font-weight: 600;
    font-size: 14px;
    color: #002f34;
    direction: ltr;
    unicode-bidi: embed;
}

.phone-chevron {
    font-size: 10px;
    margin-inline-start: auto;
    opacity: 0.6;
    transition: transform 0.2s;
}

.phone-dropdown.open .phone-chevron {
    transform: rotate(180deg);
}

.phone-number-input {
    flex: 1;
    border: none;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    min-width: 0;
}

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

.phone-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e8ebeb;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    max-height: 320px;
    display: none;
    overflow: hidden;
}

.phone-dropdown.open {
    display: flex;
    flex-direction: column;
}

.phone-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f7f8f8;
    border-bottom: 1px solid #e8ebeb;
}

.phone-search-icon {
    font-size: 14px;
    color: #5b7b7d;
    flex-shrink: 0;
}

.phone-search {
    flex: 1;
    border: none;
    padding: 0;
    font-size: 14px;
    outline: none;
    background: transparent;
}

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

.phone-options {
    max-height: 260px;
    overflow-y: auto;
    padding: 6px 0;
}

.phone-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}

.phone-option:hover {
    background: #f0f4f5;
}

.phone-option:active {
    background: #e8ebeb;
}

.phone-option-flag {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.phone-option-name {
    flex: 1;
    color: #002f34;
}

.phone-option-code {
    font-weight: 600;
    color: #5b7b7d;
    font-size: 13px;
    direction: ltr;
    unicode-bidi: embed;
}

/* Haraj-style overrides */
.phone-input-wrap .haraj-input {
    border: none !important;
}

.phone-input-inner .phone-number-input.haraj-input {
    padding: 10px 12px;
    font-size: 14px;
}

/* Two phone inputs in one row (phone + whatsapp) */
.phone-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 1rem;
}

.phone-fields-row .input-group,
.phone-fields-row .cd-form-group {
    margin-bottom: 0;
}

@media (max-width: 576px) {
    .phone-fields-row {
        grid-template-columns: 1fr;
    }
}
