:root {
    /* Theme Compatibility: Astra -> WP Block Theme (FSE) -> Default Pink */
    --mml-primary: var(--ast-global-color-0, var(--wp--preset--color--primary, #e91e63));
    --mml-primary-hover: var(--ast-global-color-1, var(--wp--preset--color--secondary, #d81b60));
    --mml-bg: #fff;
    /* Fixed: White instead of pink */
    --mml-border-radius: 15px;
    --mml-input-border: #ccc;
    --mml-text: var(--ast-global-color-3, #333);
}

.mml-wrapper {
    max-width: 600px;
    /* Slightly wider for better spacing */
    width: 100%;
    margin: 0 auto;
    font-family: inherit;
    /* Inherit Astra font */
    box-sizing: border-box;
}

/* Google Login */
.mml-google-login {
    /* display: flex; REMOVED per user request */
    text-align: center;
    /* Center content */
    /* justify-content: center; REMOVED */
    /* align-items: center; REMOVED */
    margin-bottom: 20px;
    border: 1px solid var(--mml-primary);
    /* RESTORED: Blue Border */
    border-radius: var(--mml-border-radius);
    padding: 15px;
    background: #fff;
    /* RESTORED: White Background */
    min-height: 60px;
    width: 100%;
    /* Ensure full width container */
    box-sizing: border-box;
    /* Prevent padding overflow */
}

/* Force inner Google div to have no float and center margins */
.mml-google-login>div {
    margin: 0 auto !important;
    float: none !important;
}

/* Ensure Google Button iframe is centered */
.mml-google-login>div,
.mml-google-login iframe {
    text-align: center;
    margin: 0 auto !important;
    display: block !important;
}

/* Main Container */
.mml-container {
    background: #fff;
    border: 3px solid var(--mml-primary);
    border-radius: var(--mml-border-radius);
    overflow: hidden;
    padding-bottom: 20px;
    background-color: #fff;
    /* Fixed: White background */
}

/* Tabs */
.mml-tabs {
    display: flex;
    background: var(--mml-primary);
}

.mml-tab {
    flex: 1;
    text-align: center;
    padding: 15px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    user-select: none;
}

.mml-tab.active {
    background: #fff;
    color: var(--mml-primary);
    border-top-left-radius: var(--mml-border-radius);
    border-top-right-radius: var(--mml-border-radius);
    margin-top: 5px;
    border-bottom: none;
}

.mml-content {
    display: none;
    padding: 20px 30px;
    /* More padding on sides */
}

.mml-content.active {
    display: block;
}

.mml-welcome {
    font-size: 14px;
    margin-bottom: 20px;
    color: #666;
    text-align: center;
}

.mml-welcome a {
    color: var(--mml-primary);
    text-decoration: underline;
}

/* Form Elements */
.mml-input-group {
    margin-bottom: 20px;
    position: relative;
    width: 100%;
}

.mml-input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    /* Slightly larger */
    color: #444;
    /* Darker for better visibility */
    background: transparent;
    /* Fixed: Transparent to match theme */
    width: fit-content;
    padding: 0 5px;
    margin-left: 10px;
    margin-top: -10px;
    position: relative;
    z-index: 1;
    font-weight: 600;
    /* Make label standout */
}

/* Red Asterisk for Required Fields */
.mml-input-group label::after {
    content: " *";
    color: #e53935;
    /* Red Color */
    font-weight: bold;
}

.mml-input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #aaa;
    /* Darker border */
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    margin-top: -5px;
    transition: all 0.3s;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Slight shadow */
}

.mml-input-group input:focus {
    border-color: var(--mml-primary);
    box-shadow: 0 0 8px rgba(233, 30, 99, 0.15);
    /* Glow effect */
}

/* Row for Password/Confirm */
.mml-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    /* Wrap on small screens */
}

.mml-row .mml-input-group {
    flex: 1;
    min-width: 200px;
    /* Minimum width before wrapping */
}

/* Password Toggle */
.mml-password-wrapper {
    position: relative;
    width: 100%;
}

.mml-toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    margin-top: -2px;
    color: #999;
}

/* Submit Button */
.mml-submit-btn {
    width: 100%;
    background: linear-gradient(90deg, var(--mml-primary), var(--mml-primary-hover));
    border: none;
    padding: 15px;
    border-radius: 8px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    transition: opacity 0.3s;
}

.mml-submit-btn:hover {
    opacity: 0.9;
}

.mml-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.mml-badge {
    background: #ffeb3b;
    color: #d32f2f;
    font-size: 10px;
    padding: 5px;
    border-radius: 50%;
    font-weight: bold;
    border: 2px dashed #fbc02d;
    transform: rotate(-15deg);
}

.mml-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.mml-actions a {
    color: var(--mml-primary);
    text-decoration: none;
    font-weight: bold;
}

/* Terms Notice */
.mml-terms-notice {
    font-size: 13px;
    /* Match label size */
    color: #444;
    /* Match label color */
    font-weight: 600;
    /* Match label weight */
    text-align: center;
    margin-top: 15px;
    line-height: 1.4;
}

/* Add Red Asterisk */
.mml-terms-notice::before {
    content: "* ";
    color: #e53935;
    font-weight: bold;
}

.mml-terms-notice a {
    color: var(--mml-primary);
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .mml-wrapper {
        padding: 0 10px;
    }

    .mml-content {
        padding: 15px;
    }

    .mml-tab {
        padding: 10px;
        font-size: 16px;
    }

    .mml-submit-btn {
        font-size: 16px;
        padding: 12px;
    }
}

/* Lost Password Popup Styles */
.mml-popup-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.mml-popup-content {
    background: #2b2d35;
    /* Dark Theme from image */
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    animation: mmlFadeIn 0.3s ease;
}

.mml-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.mml-popup-close:hover {
    color: #fff;
}

@keyframes mmlFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Popup Specific Overrides */
.mml-popup-content h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 18px;
    text-transform: uppercase;
}

.mml-popup-content .mml-input-group label {
    background: none;
    color: #ccc;
    position: static;
    margin: 0 0 5px 0;
    text-align: left;
}

.mml-popup-content .mml-input-group input {
    background: #3a3f4b;
    border: 1px solid #555;
    color: white;
}

.mml-popup-content .mml-input-group input:focus {
    border-color: var(--mml-primary);
}

.mml-popup-content button {
    margin-top: 20px;
}

/* Message Container Styles */
.mml-popup-message {
    padding: 20px 0;
    animation: mmlFadeIn 0.3s ease;
}

.mml-message-text {
    color: #fff;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Success State */
.mml-popup-message.success .mml-message-text {
    color: var(--ast-global-color-0, #e91e63);
    /* Astra Primary */
}

/* Error State */
.mml-popup-message.error .mml-message-text {
    color: var(--ast-global-color-1, #d81b60);
    /* Astra Secondary */
}

/* Buttons in Message */
.mml-popup-message button {
    width: auto;
    min-width: 120px;
    margin: 0 auto;
    display: inline-block;
}

.mml-retry-btn {
    background: #555;
    /* Neutral for retry */
}

/* Icons (Optional but nice) */
.mml-message-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.mml-popup-message.success .mml-message-icon:before {
    content: '✅';
}

.mml-popup-message.error .mml-message-icon:before {
    content: '⚠️';
}

/* CSS for OTP Inputs */
.mml-otp-inputs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.mml-otp-digit {
    width: 60px !important;
    height: 70px !important;
    font-size: 30px !important;
    text-align: center !important;
    border-radius: 12px !important;
    background: #4a4f5a !important;
    border: 2px solid #666 !important;
    color: white !important;
    font-weight: bold;
    transition: all 0.3s ease;
}

.mml-otp-digit:focus {
    border-color: var(--mml-primary) !important;
    background: #3b3f48 !important;
    box-shadow: 0 0 10px rgba(233, 30, 99, 0.5);
    outline: none;
}

.mml-lp-desc {
    color: #ccc;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.mml-lp-desc b {
    color: #fff;
}

/* Animations */
.mml-lp-step {
    animation: mmlSlideIn 0.4s ease-out;
}

@keyframes mmlSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}