.nmi-payment-form-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Step styling */
.payment-step {
    transition: opacity 0.3s ease;
}

.payment-step.active {
    display: block;
}

.payment-step h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    font-size: 24px;
}

/* Payment summary */
.payment-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #e1e5e9;
}

.summary-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.summary-description {
    color: #666;
    font-size: 16px;
}

.summary-amount {
    font-size: 20px;
    font-weight: 600;
    color: #007cba;
}

/* Give button styling */
.nmi-give-button {
    width: 100%;
    padding: 15px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.nmi-give-button:hover {
    background: #218838;
}

.nmi-give-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Form actions styling */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.nmi-back-button {
    flex: 0 0 100px;
    padding: 15px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.nmi-back-button:hover {
    background: #5a6268;
}

.nmi-pay-button {
    flex: 1;
    padding: 15px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.nmi-pay-button:hover {
    background: #28a745;
}

.nmi-pay-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.nmi-payment-form {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-group input.error,
.form-group select.error {
    border-color: #dc3232;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

.form-group.quarter {
    flex: 0 0 30%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-group input.error,
.form-group select.error {
    border-color: #dc3232;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

.form-group.quarter {
    flex: 0 0 30%;
}

#nmi-payment-messages {
    margin-top: 20px;
}

#nmi-payment-messages.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 4px;
}

#nmi-payment-messages.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 4px;
}

#nmi-payment-messages p {
    margin: 0 0 10px 0;
}

#nmi-payment-messages p:last-child {
    margin-bottom: 0;
}

/* Payment type tabs */
.payment-type-tabs {
    display: flex;
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.payment-type-tab {
    flex: 1;
    padding: 12px 20px;
    background: #f8f9fa;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.payment-type-tab:first-child {
    border-right: 1px solid #e1e5e9;
}

.payment-type-tab:hover {
    background: #e9ecef;
}

.payment-type-tab.active {
    background: #28a745;
    color: white;
}

/* Payment type sections */
.payment-type-section {
    display: none;
}

.payment-type-section.active {
    display: block;
}

/* Frequency buttons */
.frequency-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.frequency-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.frequency-btn:hover {
    background: #e9ecef;
    border-color: #28a745;
}

.frequency-btn.selected {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

/* Recurring amounts styling */
.recurring-amounts .amount-btn {
    position: relative;
}

.recurring-amounts .amount-btn::after {
    font-size: 12px;
    color: #666;
    position: absolute;
    bottom: 2px;
    right: 4px;
}

.recurring-amounts .amount-btn.selected::after {
    color: rgba(255, 255, 255, 0.8);
}

/* Give button dynamic text */
#give-button-text {
    transition: all 0.3s ease;
}

@media (max-width: 600px) {
    .frequency-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .frequency-btn {
        flex: none;
    }
    
    .payment-type-tabs {
        margin: 10px 0 20px 0;
    }
}
.amount-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.amount-btn {
    flex: 1;
    min-width: 60px;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.amount-btn:hover {
    background: #e9ecef;
    border-color: #28a745;
}

.amount-btn.selected {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.other-amount-container {
    margin-top: 10px;
}

.other-amount-toggle {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.other-amount-toggle:hover {
    background: #e9ecef;
    border-color: #28a745;
}

.other-amount-toggle.active {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.custom-amount-input {
    margin-top: 10px;
}

.custom-amount-input label {
    margin-bottom: 5px;
}

.custom-amount-input input {
    width: 100%;
}

/* Error states for amount selection */
.amount-buttons.error .amount-btn,
.other-amount-container.error .other-amount-toggle {
    border-color: #dc3232;
}

.amount-buttons.error .amount-btn.selected {
    border-color: #dc3232;
    background: #dc3232;
}

/* Error states for frequency selection */
.frequency-buttons.error .frequency-btn {
    border-color: #dc3232;
}

.frequency-buttons.error .frequency-btn.selected {
    border-color: #dc3232;
    background: #dc3232;
}

@media (max-width: 600px) {
    .amount-buttons {
        flex-direction: column;
    }
    
    .amount-btn {
        flex: none;
    }
}
@media (max-width: 600px) {
    .nmi-payment-form-container {
        margin: 10px;
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group.half,
    .form-group.quarter {
        flex: none;
    }
}

/* Loading state */
.nmi-pay-button.loading {
    position: relative;
}

.nmi-pay-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Description toggle styling */
.description-toggle-checkbox {
    width: auto !important;
    margin-right: 8px;
    transform: scale(1.1);
}

.form-group label:has(.description-toggle-checkbox) {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    padding: 10px;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.form-group label:has(.description-toggle-checkbox):hover {
    background: #e9ecef;
    border-color: #007cba;
}

.form-group label:has(.description-toggle-checkbox:checked) {
    background: rgba(0, 124, 186, 0.1);
    border-color: #007cba;
    color: #007cba;
}

/* Description field container transition */
#description_field_container {
    transition: all 0.3s ease;
    overflow: hidden;
}

#description_field_container.show {
    display: block !important;
    animation: slideDown 0.3s ease;
}

#description_field_container.hide {
    animation: slideUp 0.3s ease;
}

/* ADDED - Recurring impact message styling */
.recurring-impact-message {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.impact-title {
    color: #28a745;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    text-decoration: underline;
}

.impact-subtitle {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
    line-height: 1.4;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 100px;
        margin-bottom: 20px;
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        max-height: 100px;
        margin-bottom: 20px;
    }
    to {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
    }
}

/* =====================================================
   THANK YOU POPUP STYLING
   ===================================================== */
/* Popup Overlay */
.nmi-thank-you-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 99999 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    align-content: center !important;
    flex-direction: column !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.nmi-thank-you-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Popup Content */
.nmi-thank-you-popup {
    background: white !important;
    border-radius: 12px !important;
    padding: 40px 30px !important;
    max-width: 500px !important;
    width: 90% !important;
    max-height: 90vh !important;
    text-align: center !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    transform: scale(0.8) translateY(-50px);
    transition: all 0.3s ease;
    position: relative !important;
    margin: 0 auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}

.nmi-thank-you-overlay.show .nmi-thank-you-popup {
    transform: scale(1) translateY(0);
}

/* Thank You Title */
.nmi-thank-you-title {
    font-size: 36px;
    font-weight: bold;
    color: #28a745;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

/* Subtitle */
.nmi-thank-you-subtitle {
    font-size: 20px;
    color: #333;
    margin: 0 0 25px 0;
    font-weight: 500;
    line-height: 1.3;
}

/* Message Text */
.nmi-thank-you-message {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 25px 0;
}

/* Transaction Details */
.nmi-thank-you-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 0 0 25px 0;
    border-left: 4px solid #28a745;
}

.nmi-thank-you-details p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
}

.nmi-thank-you-details p:last-child {
    margin-bottom: 0;
}

.nmi-thank-you-details strong {
    color: #333;
    font-weight: 600;
}

/* Close Button */
.nmi-thank-you-close {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.nmi-thank-you-close:hover {
    background: #218838;
}

/* X Close Button */
.nmi-thank-you-x-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.nmi-thank-you-x-close:hover {
    background: #f0f0f0;
    color: #666;
}

/* Responsive Design */
@media (max-width: 600px) {
    .nmi-thank-you-overlay {
        padding: 20px !important;
    }
    
    .nmi-thank-you-popup {
        padding: 30px 20px !important;
        margin: 0 !important;
        width: calc(100% - 40px) !important;
        max-width: none !important;
    }
    
    .nmi-thank-you-title {
        font-size: 28px;
    }
    
    .nmi-thank-you-subtitle {
        font-size: 18px;
    }
    
    .nmi-thank-you-message {
        font-size: 15px;
    }
}

/* Additional centering fallback for stubborn themes */
body.nmi-popup-open {
    overflow: hidden !important;
}

.nmi-thank-you-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Animation for entrance */
@keyframes thankYouFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.nmi-thank-you-popup.animate-in {
    animation: thankYouFadeIn 0.4s ease forwards;
}

/* =====================================================
   THEME OVERRIDE SECTION - Elementor Compatibility
   ===================================================== */

/* Add these enhanced color overrides to your existing CSS file */

/* More specific selectors to override Elementor themes */
.nmi-payment-form-container .nmi-give-button,
.nmi-payment-form-container .nmi-pay-button {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

.nmi-payment-form-container .nmi-give-button:hover,
.nmi-payment-form-container .nmi-pay-button:hover {
    background-color: #218838 !important;
    color: white !important;
    border-color: #218838 !important;
}

.nmi-payment-form-container .nmi-give-button:disabled,
.nmi-payment-form-container .nmi-pay-button:disabled {
    background-color: #ccc !important;
    color: #666 !important;
    border-color: #ccc !important;
    cursor: not-allowed !important;
}

/* Back button overrides */
.nmi-payment-form-container .nmi-back-button {
    background-color: #6c757d !important;
    color: white !important;
    border-color: #6c757d !important;
}

.nmi-payment-form-container .nmi-back-button:hover {
    background-color: #5a6268 !important;
    color: white !important;
    border-color: #5a6268 !important;
}

/* Amount buttons */
.nmi-payment-form-container .amount-btn {
    background-color: #f8f9fa !important;
    color: #333 !important;
    border-color: #e1e5e9 !important;
}

.nmi-payment-form-container .amount-btn:hover {
    background-color: #e9ecef !important;
    color: #333 !important;
    border-color: #28a745 !important;
}

.nmi-payment-form-container .amount-btn.selected {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

/* Frequency buttons */
.nmi-payment-form-container .frequency-btn {
    background-color: #f8f9fa !important;
    color: #333 !important;
    border-color: #e1e5e9 !important;
}

.nmi-payment-form-container .frequency-btn:hover {
    background-color: #e9ecef !important;
    color: #333 !important;
    border-color: #28a745 !important;
}

.nmi-payment-form-container .frequency-btn.selected {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

/* Payment type tabs */
.nmi-payment-form-container .payment-type-tab {
    background-color: #f8f9fa !important;
    color: #666 !important;
    border-color: #e1e5e9 !important;
}

.nmi-payment-form-container .payment-type-tab:hover {
    background-color: #e9ecef !important;
    color: #666 !important;
}

.nmi-payment-form-container .payment-type-tab.active {
    background-color: #28a745 !important;
    color: white !important;
}

/* Other amount toggle */
.nmi-payment-form-container .other-amount-toggle {
    background-color: #f8f9fa !important;
    color: #333 !important;
    border-color: #e1e5e9 !important;
}

.nmi-payment-form-container .other-amount-toggle:hover {
    background-color: #e9ecef !important;
    color: #333 !important;
    border-color: #28a745 !important;
}

.nmi-payment-form-container .other-amount-toggle.active {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

/* Form inputs to prevent theme interference */
.nmi-payment-form-container input[type="text"],
.nmi-payment-form-container input[type="email"],
.nmi-payment-form-container input[type="number"],
.nmi-payment-form-container select {
    background-color: white !important;
    color: #333 !important;
    border-color: #e1e5e9 !important;
}

.nmi-payment-form-container input[type="text"]:focus,
.nmi-payment-form-container input[type="email"]:focus,
.nmi-payment-form-container input[type="number"]:focus,
.nmi-payment-form-container select:focus {
    border-color: #007cba !important;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1) !important;
    outline: none !important;
}

/* Error states */
.nmi-payment-form-container input.error,
.nmi-payment-form-container select.error {
    border-color: #dc3232 !important;
}

/* Ultra-specific selectors for stubborn themes */
div.nmi-payment-form-container button.nmi-give-button,
div.nmi-payment-form-container button.nmi-pay-button,
div.nmi-payment-form-container .nmi-payment-form button.nmi-pay-button {
    background: #28a745 !important;
    background-color: #28a745 !important;
    color: #ffffff !important;
    border: 2px solid #28a745 !important;
    border-color: #28a745 !important;
}

div.nmi-payment-form-container button.nmi-give-button:hover,
div.nmi-payment-form-container button.nmi-pay-button:hover,
div.nmi-payment-form-container .nmi-payment-form button.nmi-pay-button:hover {
    background: #218838 !important;
    background-color: #218838 !important;
    color: #ffffff !important;
    border-color: #218838 !important;
}

/* Reset any potential CSS variables that might interfere */
.nmi-payment-form-container {
    --primary-color: #28a745;
    --primary-hover-color: #218838;
    --secondary-color: #6c757d;
    --secondary-hover-color: #5a6268;
    --light-bg: #f8f9fa;
    --light-hover-bg: #e9ecef;
    --border-color: #e1e5e9;
    --text-color: #333;
    --white: #ffffff;
}

/* Additional button reset to override any inherited styles */
.nmi-payment-form-container button {
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
}