﻿
.mobile-money-form {
    gap: 20px;
}

.momo-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 0;
    color: var(--text-secondary, #737373);
    font-size: 14px;
}

.momo-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid #d4d4d4;
    border-top-color: #16a34a;
    border-radius: 50%;
    animation: momo-spin 0.7s linear infinite;
}

@keyframes momo-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Country selector — styled to match the checkout UI */
.momo-country-select {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    background: #fff;
    border: 1px solid #d8dee8;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

/* Keyboard focus and interaction */
.momo-country-select:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

/* Native select, visually integrated into the wrapper */
.momo-country-select select {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0 42px 0 48px;
    margin: 0;
    border: none;
    outline: none;
    border-radius: inherit;
    background: transparent;
    color: #1f2937;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
}

/* Country flag */
.momo-country-flag,
.momo-country-flag-fallback {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    z-index: 1;
}

.momo-country-flag {
    object-fit: cover;
    border-radius: 50%;
}

.momo-country-flag-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.momo-country-flag-fallback svg {
    width: 20px;
    height: 20px;
}

/* Custom dropdown chevron */
.momo-select-chevron {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #64748b;
    pointer-events: none;
}

.momo-select-chevron svg {
    width: 16px;
    height: 16px;
}

/* Dropdown options */
.momo-country-select select option {
    padding: 10px;
    background: #fff;
    color: #1f2937;
    font-size: 14px;
}

/* Disabled state, if needed */
.momo-country-select select:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}


.momo-country-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 7px;
    color: var(--text-secondary, #737373);
    font-size: 12px;
}

.momo-network-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.momo-network-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 80px;
    padding: 8px;
    border: 1px solid var(--border-color, #dedede);
    border-radius: 12px;
    background: var(--card-background, #fff);
    color: inherit;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.momo-network-card:hover {
    border-color: var(--turq);
}

.momo-network-card.active {
    border: 2px solid #16a34a;
    padding: 7px;
    background: #f0fdf4;
}

/* Give the logo most of the available space */
.momo-network-logo {
    display: block;
    width: 100%;
    max-width: 130px;
    height: 40px;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
}

/* Fallback when a network has no logo */
.momo-network-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    flex-shrink: 0;
    color: #64748b;
}

.momo-network-logo-fallback svg {
    width: 30px;
    height: 30px;
}

/* Smaller, secondary network label */
.momo-network-name {
    display: block;
    width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 500;
}

.momo-network-check {
    display: inline-flex;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    margin-left: auto;
    color: #16a34a;
}

.momo-network-check svg {
    width: 100%;
    height: 100%;
}

.momo-no-networks {
    padding: 14px;
    border: 1px dashed var(--border-color, #dedede);
    border-radius: 10px;
    color: var(--text-secondary, #737373);
    font-size: 13px;
}

@media (max-width: 420px) {
    .momo-network-grid {
        grid-template-columns: 1fr;
    }

    .momo-country-meta {
        flex-wrap: wrap;
    }
}



.momo-otp-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.momo-otp-header {
    text-align: center;
}

.momo-otp-header h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
}

.momo-otp-header p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary, #64748b);
}

.momo-otp-iframe {
    display: block;
    width: 100%;
    height: 520px;
    border: 1px solid var(--border-color, #dedede);
    border-radius: 12px;
    background: #fff;
}

@media (max-width: 480px) {
    .mobile-money-form {
        gap: 16px;
    }

    /* Keep 2 network columns down to 360px, then single */
    .momo-network-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .momo-network-card {
        min-height: 72px;
        padding: 8px 6px;
        border-radius: 10px;
    }

    .momo-network-card.active {
        padding: 7px 5px;
    }

    .momo-network-logo {
        height: 34px;
        max-width: 110px;
    }

    .momo-network-name {
        font-size: 10.5px;
    }

    /* OTP iframe should fill available space gracefully */
    .momo-otp-iframe {
        height: 440px;
        border-radius: 10px;
    }

    .momo-otp-header h3 {
        font-size: 16px;
    }

    .momo-otp-header p {
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .momo-network-grid {
        grid-template-columns: 1fr;
    }

    .momo-otp-iframe {
        height: 400px;
    }
}