/* Popup Overlay */
#mpf-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
	right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75); /* Darker overlay */
    z-index: 99998; /* High z-index */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px; /* Add padding for smaller screens */
    box-sizing: border-box;
     opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s; 
}
#mpf-popup-overlay:target, 
#mpf-popup-overlay.mpf-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transition-delay: 0s !important;
}


/* Popup Container */
#mpf-popup-wrap {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 8px; /* Slightly more rounded */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    position: relative;
    max-width: 550px; /* Adjust as needed */
    width: 100%;      /* Use full width within padding */
    box-sizing: border-box;
    max-height: 90vh; /* Limit height */
    overflow-y: auto; /* Allow scrolling if content overflows */
    transform: scale(0.95); /* Start slightly smaller for pop effect */
    opacity: 0;
     transition: transform 0.3s ease, opacity 0.3s ease;
}
#mpf-popup-overlay.mpf-visible #mpf-popup-wrap {
    transform: scale(1);
    opacity: 1;
}

/* Close Button */
#mpf-close-popup-button {
    position: absolute;
    top: 10px;
    left: 10px;
    background: transparent;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    z-index: 10; /* Ensure above form elements */
}
#mpf-close-popup-button:hover {
    color: #333;
}

/* Form Elements */
#mpf-popup-form {
    margin-top: 10px;
}

#mpf-popup-form input::placeholder {
    text-align: right;
}
#mpf-popup-form input[type="number"] {
    color: var(--accent);
    background-color: var(--muz-bg1);
    border-radius: 8px;
    border: 1px solid var(--accent);
    text-align: center;
    width: 100%;
}
.date-number-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-content: flex-start;
    align-items: flex-start;
    gap: 10px;
}
.date-number-group .mpf-form-field {
    flex-grow: 1;
}

.date-number-group input#mpf-course-date {
    border: 1px solid var(--accent);
    padding: 10px;
    border-radius: 8px;
    width: 100%;
}

#mpf-popup-form h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.6em;
    color: #2c3e50; /* Darker blue */
    text-align: center;
    font-weight: 600;
}

.mpf-form-field {
    margin-bottom: 15px;
}

.mpf-form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
}

.mpf-form-field input[type="text"], .mpf-form-field input[type="tel"], .mpf-form-field input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.2s ease;
}
.mpf-form-field input:focus {
    border-color: #0073aa; /* WP blue on focus */
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}


.mpf-form-field input.mpf-input-error {
    border-color: #dc3232; /* WP red for errors */
     box-shadow: 0 0 0 1px #dc3232;
}

.mpf-form-field .required {
    color: #dc3232;
    font-weight: normal; /* Don't need bold if color indicates requirement */
    margin-left: 3px;
}

/* Submit Button Container */
.mpf-form-field:last-of-type { /* Target button container */
/*      margin-top: 25px; */
/*      text-align: center; */
}

#mpf-submit-button {
    padding: 12px 25px;
    background-color: #0073aa; /* WP blue */
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
     font-weight: 600;
    transition: background-color 0.2s ease;
     display: inline-block; /* Needed for centering */
}

#mpf-submit-button:hover:not(:disabled) {
    background-color: #005a87; /* Darker WP blue */
}

#mpf-submit-button:disabled {
    background-color: #a7aaad; /* WP disabled grey */
    cursor: wait;
    opacity: 0.7;
}


/* Messages & Loading */
#mpf-form-messages {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 4px;
    border-width: 1px;
    border-style: solid;
    display: none; /* Hidden by default */
    text-align: center;
    font-weight: 500;
}

.mpf-success {
    background-color: #f0fff3; /* Lighter green */
    border-color: #50af5d; /* WP green */
    color: #145d23; /* Darker green */
}

.mpf-error {
    background-color: #fff5f5; /* Lighter red */
    border-color: #dc3232; /* WP red */
    color: #991b1b; /* Darker red */
}

#mpf-loading {
     margin-top: 10px;
     text-align: center;
     color: #555;
     font-style: italic;
     display: none; /* Initially hidden */
}

/* reCAPTCHA notice */
.recaptcha-notice {
    display: block;
    margin-top: 20px;
    font-size: 0.8em;
    color: #777;
    text-align: center;
    line-height: 1.4;
}
.recaptcha-notice a {
    color: #555;
    text-decoration: underline;
}

/* Optional: Style radio button group */
.mpf-radio-group label { /* General label for the group */
    display: block;
    font-weight: 600;
}
.mpf-radio-group > div { /* Container for each radio */
    margin-bottom: 5px;
}
.mpf-radio-group > div label { /* Label next to radio */
    display: inline-block; /* Align radio and text */
    font-weight: normal;
    margin-left: 5px;
    cursor: pointer;
}
.mpf-radio-group input[type="radio"] {
    margin-right: 5px;
    vertical-align: middle;
}

.mpf-form-field.mpf-radio-group {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border: 1px solid var(--accent);
    padding: 10px;
    border-radius: 8px;
}

/* Basic button style if theme doesn't provide one */
button.mpf-open-button {
     /* Example styles - Adjust or remove if your theme handles buttons */
     /* padding: 10px 18px; */
     /* font-size: 1em; */
     /* background-color: #2271b1; */
     /* color: white; */
     /* border: 1px solid #2271b1; */
     /* border-radius: 3px; */
     /* cursor: pointer; */
     /* text-decoration: none; */
     /* white-space: nowrap; */
}
/* button.mpf-open-button:hover { */
    /* background-color: #1d5f96; */
    /* border-color: #1d5f96; */
/* } */

/* Responsive Adjustments */
@media (max-width: 600px) {
    #mpf-popup-wrap {
        padding: 20px;
        max-height: 85vh; /* Adjust height for smaller screens */
    }
     #mpf-popup-form h2 {
        font-size: 1.4em;
        margin-bottom: 20px;
     }
     .mpf-form-field input[type="text"],
    .mpf-form-field input[type="tel"] {
        padding: 10px 12px;
    }
     #mpf-submit-button {
        padding: 10px 20px;
        font-size: 1em;
		width: 100%;
     }
}