.mrc-login-section {
    margin: 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.mrc-checkbox-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Hide native checkbox */
.mrc-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Toggle track */
.mrc-toggle-track {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
    background-color: #ccc;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

/* Toggle thumb */
.mrc-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease;
}

/* On state */
.mrc-toggle-track.is-checked {
    background-color: #296D38;
}

.mrc-toggle-track.is-checked::after {
    transform: translateX(16px);
}

.mrc-checkbox-label {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    margin: 0 !important;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.mrc-fields-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    animation: slideDown 0.15s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mrc-helper-text {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.4;
}

.mrc-info-icon {
    font-size: 12px;
    line-height: 1;
}

.mrc-otp-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.mrc-otp-message {
    margin: 0 0 12px 0 !important;
    background: #d4edda !important;
    border: 1px solid #c3e6cb !important;
    padding: 10px 12px !important;
    color: #155724 !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    border-radius: 4px !important;
}

.mrc-error-message {
    margin: 12px 0 0 0 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
}

.mrc-resend-link {
    color: #004d66;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
}

.mrc-resend-link:hover {
    text-decoration: underline;
}

/* Input styling */
.mrc-login-section input[type='text'].woocommerce-Input {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 14px;
    transition: all 0.2s;
}

.mrc-login-section input[type='text'].woocommerce-Input:focus {
    outline: none;
    border-color: #004d66;
    background: #ffffff;
    box-shadow: 0 0 0 1px #004d66;
}

.mrc-login-section input[type='text'].woocommerce-Input:disabled {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* Error field glow effect - temporary */
.mrc-login-section input[type='text'].woocommerce-Input.error,
input[type='text'].woocommerce-Input.error,
input[type='password'].woocommerce-Input.error {
    border-color: #d32f2f !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.25) !important;
    animation: errorPulse 1s ease-in-out;
}

@keyframes errorPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(211, 47, 47, 0.3);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0);
    }
}

.mrc-login-section label {
    display: block;
    font-weight: 500;
    color: #333;
    font-size: 14px !important;
}

.mrc-login-section .required {
    color: #d32f2f;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .mrc-login-section {
        padding: 14px;
    }

    .mrc-checkbox-label {
        font-size: 10px;
    }

    .mrc-helper-text {
        font-size: 10px;
    }

}


.optional-tooltip {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
}

.optional-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #1F5C2F;
    color: white;
    font-size: 14px;
    cursor: help;
    position: relative;
    transition: background-color 0.2s;
}

.optional-icon:hover {
    background-color: #3a645b;
}

/* Tooltip styling */
.optional-icon::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 102px;
    transform: translateX(-65%);
    background-color: #1F5C2F;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 100;
    white-space: normal;
    /* Changed from nowrap to normal */
    width: 180px;
    /* Fixed width for text wrapping */
    text-align: center;
    /* Center align text */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    margin-bottom: 8px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    word-wrap: break-word;
    /* Ensure long words break */
    line-height: 1.4;
    /* Better line spacing for readability */
}

.optional-icon::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    margin-bottom: -2px;
    z-index: 1001;
}

.optional-icon:hover::after,
.optional-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Spinner Styles */
.mrc-spinner {
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

.mrc-spinner-inner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: mrc-spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes mrc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ensure buttons with spinner still look good */
form.woocommerce-form-login button[type="submit"]:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/* Make sure resend link can show spinner */
.mrc-resend-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.mrc-resend-link:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner Styles */
.mrc-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: mrc-spin 0.8s linear infinite;
}

/* For light background buttons */
.woocommerce button.button .mrc-spinner {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
}

@keyframes mrc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Button states */
form.woocommerce-form-login button[type="submit"] {
    transition: all 0.3s ease;
}

form.woocommerce-form-login button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Ensure button text is visible */
form.woocommerce-form-login button[type="submit"] span.mrc-spinner+span {
    display: inline-block;
}

/* Success Overlay Styles */
.mrc-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease;
}

.mrc-success-icon {
    font-size: 48px;
    color: #28a745;
    background: #fff;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
    border: 3px solid #28a745;
}

.mrc-success-message {
    font-size: 18px;
    font-weight: 600;
    color: #155724;
    text-align: center;
    padding: 0 20px;
    line-height: 1.5;
}

.mrc-success-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #28a745;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Ensure MRC section has relative positioning */
.mrc-login-section {
    position: relative;
}

.mrc-login-section.is-active {
    box-shadow: 0 0 0 2px #1F5C2F;
    transition: opacity 0.3s ease;
}

/* Faded form content when overlay is active */
.mrc-login-section.has-success-overlay .mrc-checkbox-wrapper,
.mrc-login-section.has-success-overlay .mrc-fields-container {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}