/* Modal Overlay */
.login-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.login-modal-overlay.active {
    display: block;
    z-index: 1000007;
}

/* Modal container */
.login-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    max-width: 95%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    flex-direction: row;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 100001;
}

.login-modal.active {
    display: flex;
    z-index: 1000008;
}

/* Left Image */
.modal-left {
    flex: 1;
    background: #f4b400;
}

.modal-left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Right Form */
.modal-right {
    flex: 1;
    padding: 50px 40px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-right h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.label {
    font-size: 14px;
    margin-bottom: 8px;
    color: #555;
}

/* Phone input */
#loginModal .phone-input {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

#loginModal .country {
    padding: 12px;
    background: #fafafa;
    border-right: 1px solid #ddd;
    font-size: 14px;
    white-space: nowrap;
}

#loginModal .phone-input input {
    flex: 1;
    border: none;
    padding: 12px;
    font-size: 14px;
    outline: none;
}

#loginModal .phone-input input::placeholder {
    color: #bbb;
}

/* Phone Input Wrapper (Single Row Like Screenshot) */
#loginModal .phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    height: 52px;
    margin-bottom: 0px;
    transition: all 0.3s ease;
}

/* LEFT SECTION (WhatsApp + Flag + Dropdown) */
#loginModal .country-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-right: 1px solid #eee;
    background: #fafafa;
    height: 100%;
    width: 100px;
    border: unset;
    min-width: unset;
    position: relative;
}
#loginModal .country-selector::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    background-image: url(../Images/down-arrow.png);
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: -6px;
    vertical-align: middle;
    left: 80px;
    position: absolute;
    cursor: pointer;
    pointer-events: none;
}
/* WhatsApp Icon */
#loginModal .country-display-text {
    display: flex;
    align-items: center;
}

#loginModal .country-display-text img {
    width: 20px;
    height: 20px;
}

/* Flag */
#loginModal #loginSelectedFlag {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

/* Dropdown */
#loginModal #loginCountrySelect {
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    outline: none;
    appearance: none;
    padding-right: 14px;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6"><path fill="%23333" d="M0 0l5 6 5-6z"/></svg>');
    background-repeat: no-repeat;
    background-position: right center;
    opacity: 0;
    width: 100px;
}

#loginModal #loginCountrySelect option {
    padding: 12px;
    font-size: 15px;
    color: #333;
    background-color: white;
}
#loginModal select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23333" d="M6 9L1 4h10z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}
/* RIGHT INPUT SECTION */
#loginModal .input-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    height: 100%;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    gap: unset;
    padding: unset;
}

#loginModal .input-wrapper:focus-within {
    background: transparent;
    border: none;
}

/* Country Code */
#loginModal .country-code {
    padding: 0 10px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

/* Input */
#loginModal .input-wrapper input {
    flex: 1;
    border: none;
    height: 100%;
    padding: 0 10px;
    font-size: 14px;
    outline: none;
    background: transparent;
    width: unset;
}

/* Placeholder */
#loginModal .input-wrapper input::placeholder {
    color: #9aa0a6;
}

/* Focus State (like screenshot subtle highlight) */
#loginModal .phone-input-wrapper:focus-within {
    border-color: #ff7a00;
    box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.08);
}

#loginModal .phone-error-wrapper {
    height: 20px;
    margin-bottom: 15px;
}

/* OTP Button */
.otp-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 6px;
    background: #ff7a00;
    color: #fff;
    font-weight: 600;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.otp-btn:hover:not(:disabled) {
    background: #ff6b35;
}

.otp-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.otp-btn.active {
    background: #ff7a00;
    color: #fff;
}

/* Terms */
.terms {
    font-size: 12px;
    color: #555;
    display: flex;
    gap: 8px;
    line-height: 1.4;
    align-items: flex-start;
    cursor: pointer;
}

.terms input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
}

.terms a {
    color: #ff7a00;
    text-decoration: none;
    display: contents;
}

.terms a:hover {
    text-decoration: underline;
}

/* Close button */
#loginModal .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#loginModal .close-btn:hover {
    color: #ff7a00;
    transform: scale(1.2);
}

/* OTP Verification Styles */

.subtext {
    color: #666;
    font-size: 14px;
    margin-bottom: 25px;
    line-height: 1.6;
}

.subtext a,
.edit-link {
    color: #ff7a00;
    text-decoration: none;
    margin-left: 8px;
    cursor: pointer;
}

.subtext a:hover,
.edit-link:hover {
    text-decoration: underline;
}

/* OTP INPUTS */

.otp-container {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    justify-content: flex-start;
}

.otp-container input {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.otp-container input:focus {
    border-color: #ff7a00;
    outline: none;
    box-shadow: 0 0 5px rgba(255, 122, 0, 0.3);
}

.otp-container input:not(:placeholder-shown) {
    border-color: #ff7a00;
}

/* VERIFY BUTTON */

.verify-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 6px;
    background: #eaeaea;
    color: #999;
    font-weight: 600;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.verify-btn:hover:not(:disabled) {
    background: #ddd;
}

.verify-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.verify-btn.active {
    background: #ff7a00;
    color: #fff;
}

/* RESEND */

.resend {
    font-size: 14px;
    color: #555;
    text-align: center;
    line-height: 1.6;
}

.resend a {
    color: #ff7a00;
    text-decoration: none;
    cursor: pointer;
}

.resend a:hover {
    text-decoration: underline;
}

.resend a.disabled {
    color: #bbb;
    cursor: not-allowed;
    text-decoration: none;
}

/* OTP Section */
.otp-section {
    flex: 1;
    padding: 50px 40px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.otp-section h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {

    .login-modal {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        border-radius: 20px 20px 0 0;
    }

    .modal-left {
        display: none;
        height: 220px;
    }

    .modal-right {
        padding: 30px 20px;
        justify-content: flex-start;
    }

    .modal-right h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }

    #loginModal .phone-input-wrapper {
        height: 48px;
        margin-bottom: 15px;
    }

    #loginModal .country-selector {
        min-width: 100px;
        gap: 6px;
        padding: 0 8px;
    }

    #loginModal #loginCountrySelect {
        font-size: 12px;
    }

    #loginModal .country-code {
        font-size: 13px;
        padding: 0 6px;
    }

    #loginModal .input-wrapper input {
        font-size: 13px;
    }

    .otp-container {
        justify-content: center;
        gap: 8px;
    }

    .otp-container input {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .otp-section {
        padding: 30px 20px;
    }

    .otp-section h2 {
        font-size: 22px;
    }

    .close-btn {
        top: 10px;
        right: 15px;
    }
}
