/* Mobile Login Popup CSS */
.ml-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.ml-modal-wrapper.active {
    opacity: 1;
    pointer-events: auto;
}

.ml-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.ml-modal-content {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 480px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Roboto', 'Public Sans', 'Barlow', sans-serif;
    color: #111827;
}

.ml-modal-wrapper.active .ml-modal-content {
    transform: scale(1);
}

/* Screens */
.ml-screen {
    display: none;
    padding: 24px;
}

.ml-screen.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header style */
.ml-header {
    position: relative;
    margin-bottom: 24px;
}

.ml-btn-close {
    position: absolute;
    right: 0;
    top: -5px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.ml-btn-close:hover {
    color: #374151;
}

.ml-btn-back {
    position: absolute;
    left: 0;
    top: -5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.ml-btn-back:hover {
    background-color: #f3f4f6;
}

.ml-store-banner {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #d97706;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    padding: 10px 16px;
    border-radius: 8px;
    margin-top: 15px;
}

/* Body / Titles */
.ml-body {
    padding-top: 10px;
}

.ml-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1f2937;
    text-align: left;
}

.ml-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px 0;
    text-align: left;
}

.ml-highlight {
    color: #111827;
    font-weight: 600;
}

/* Form controls */
.ml-input-group {
    position: relative;
    margin-bottom: 20px;
}

.ml-label {
    position: absolute;
    left: 12px;
    top: -8px;
    background: #ffffff;
    padding: 0 6px;
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    z-index: 2;
}

.ml-phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px 16px;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ml-phone-input-wrapper:focus-within {
    border-color: #111827;
    box-shadow: 0 0 0 1px #111827;
}

.ml-country-code {
    font-size: 16px;
    font-weight: 500;
    color: #4b5563;
    padding-right: 12px;
    border-right: 1px solid #e5e7eb;
    margin-right: 12px;
    user-select: none;
}

.ml-phone-input {
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    width: 100%;
    padding: 0;
    letter-spacing: 0.5px;
}

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

/* OTP single-digit inputs */
.ml-otp-input-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.ml-otp-digit {
    width: 56px;
    height: 56px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ml-otp-digit:focus {
    border-color: #111827;
    box-shadow: 0 0 0 1px #111827;
}

/* Error style */
.ml-error-message {
    color: #dc2626;
    font-size: 13px;
    margin-top: 6px;
    text-align: left;
    display: none;
    font-weight: 500;
}

/* Checkbox */
.ml-checkbox-group {
    margin-bottom: 24px;
    text-align: left;
}

.ml-checkbox-container {
    display: flex;
    align-items: flex-start;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.ml-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.ml-checkbox-checkmark {
    height: 20px;
    width: 20px;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.ml-checkbox-container input:checked ~ .ml-checkbox-checkmark {
    background-color: #111827;
    border-color: #111827;
}

.ml-checkbox-checkmark::after {
    content: "";
    display: none;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.ml-checkbox-container input:checked ~ .ml-checkbox-checkmark::after {
    display: block;
}

.ml-checkbox-text {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
    font-weight: 500;
}

/* Buttons */
.ml-btn-primary {
    background: #000000;
    color: #ffffff;
    width: 100%;
    border: none;
    outline: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.ml-btn-primary:hover {
    background: #1f2937;
}

.ml-btn-primary:active {
    transform: scale(0.98);
}

.ml-btn-primary:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Resend section */
.ml-resend-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    font-size: 14px;
}

#ml-timer-text {
    color: #6b7280;
}

.ml-btn-link {
    background: none;
    border: none;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-size: 14px;
}

.ml-btn-link:hover {
    color: #1d4ed8;
}

/* Footer T&C text */
.ml-footer-text {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 24px;
    text-align: center;
    line-height: 1.5;
}

.ml-footer-text a {
    color: #4b5563;
    text-decoration: underline;
}

.ml-footer-text a:hover {
    color: #111827;
}

/* Spinner for AJAX loading inside button */
.ml-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: ml-spin 1s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes ml-spin {
    to { transform: rotate(360deg); }
}
