/* Payment Method Selector Container */
.payment-method-selector {
    margin: 20px 0;
}

/* Heading Style */
.payment-method-selector h6 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f1f1f;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}

/* Radio Container */
.payment-method-selector .freeform-fieldtype-radios {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* Hide default radio buttons */
.payment-method-selector .freeform-fieldtype-radios input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Label styling - Modern button look (reduced width) */
.payment-method-selector .freeform-fieldtype-radios label {
    flex: 0 1 auto;
    min-width: 200px;
    max-width: 250px;
    padding: 14px 20px;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    font-size: 0.95rem;
    color: #1f1f1f;
    display: inline-block;
    margin: 0;
    position: relative;
}

/* Hover state */
.payment-method-selector .freeform-fieldtype-radios label:hover {
    border-color: #D52B1E;
    background-color: #fff5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(213, 43, 30, 0.1);
}

/* Selected state - Credit Card */
.payment-method-selector .freeform-fieldtype-radios input[type="radio"]:checked + label,
.payment-method-selector .freeform-fieldtype-radios label:has(input[type="radio"]:checked) {
    background-color: #D52B1E;
    border-color: #D52B1E;
    color: white;
    box-shadow: 0 4px 12px rgba(213, 43, 30, 0.3);
}

/* Selected state - Direct Debit/Cheque */
.payment-method-selector .freeform-fieldtype-radios input#init-paymentMethod-cheque:checked ~ label,
.payment-method-selector .freeform-fieldtype-radios label:has(input#init-paymentMethod-cheque:checked) {
    background-color: #1f1f1f;
    border-color: #1f1f1f;
    color: white;
    box-shadow: 0 4px 12px rgba(31, 31, 31, 0.3);
}

/* Checkmark indicator for selected */
.payment-method-selector .freeform-fieldtype-radios label::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.payment-method-selector .freeform-fieldtype-radios input[type="radio"]:checked + label::after,
.payment-method-selector .freeform-fieldtype-radios label:has(input[type="radio"]:checked)::after {
    content: '✓';
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Form containers */
.giving-day-credit-card,
.giving-day-debit-cheque {
    margin-top: 30px;
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    animation: fadeIn 0.3s ease-in;
}

/* Submit Button Styles */
button[type="submit"].btn-primary,
button.btn-primary[name="form_page_submit"],
button[data-freeform-action="submit"] {
    background-color: #D52B1E;
    border-color: #D52B1E;
    color: white;
    font-weight: 600;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(213, 43, 30, 0.2);
}

/* Hover state */
button[type="submit"].btn-primary:hover,
button.btn-primary[name="form_page_submit"]:hover,
button[data-freeform-action="submit"]:hover {
    background-color: #b8251a;
    border-color: #b8251a;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(213, 43, 30, 0.3);
}

/* Active/Focus state */
button[type="submit"].btn-primary:active,
button.btn-primary[name="form_page_submit"]:active,
button[data-freeform-action="submit"]:active,
button[type="submit"].btn-primary:focus,
button.btn-primary[name="form_page_submit"]:focus,
button[data-freeform-action="submit"]:focus {
    background-color: #a02015;
    border-color: #a02015;
    color: white;
    box-shadow: 0 2px 4px rgba(213, 43, 30, 0.4);
    outline: none;
}

/* Disabled state */
button[type="submit"].btn-primary:disabled,
button.btn-primary[name="form_page_submit"]:disabled,
button[data-freeform-action="submit"]:disabled {
    background-color: #cccccc;
    border-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

/* Processing state (when data-processing-text is active) */
/*
button[type="submit"].btn-primary[data-processing-text]:not([disabled]) {
    position: relative;
    pointer-events: none;
}

button[type="submit"].btn-primary[data-processing-text]:not([disabled])::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
*/

/* Back Button Styles */
button[type="submit"].btn-secondary,
button.btn-secondary[name="form_previous_page_button"],
button[data-freeform-action="back"] {
    background-color: #231F20;
    border-color: #231F20;
    color: white;
    font-weight: 600;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(35, 31, 32, 0.2);
}

/* Hover state */
button[type="submit"].btn-secondary:hover,
button.btn-secondary[name="form_previous_page_button"]:hover,
button[data-freeform-action="back"]:hover {
    background-color: #1a1718;
    border-color: #1a1718;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(35, 31, 32, 0.3);
}

/* Active/Focus state */
button[type="submit"].btn-secondary:active,
button.btn-secondary[name="form_previous_page_button"]:active,
button[data-freeform-action="back"]:active,
button[type="submit"].btn-secondary:focus,
button.btn-secondary[name="form_previous_page_button"]:focus,
button[data-freeform-action="back"]:focus {
    background-color: #0f0e0e;
    border-color: #0f0e0e;
    color: white;
    box-shadow: 0 2px 4px rgba(35, 31, 32, 0.4);
    outline: none;
}

/* Disabled state */
button[type="submit"].btn-secondary:disabled,
button.btn-secondary[name="form_previous_page_button"]:disabled,
button[data-freeform-action="back"]:disabled {
    background-color: #cccccc;
    border-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

/* Processing state (when data-processing-text is active) */
/*
button[type="submit"].btn-secondary[data-processing-text]:not([disabled]) {
    position: relative;
    pointer-events: none;
}

button[type="submit"].btn-secondary[data-processing-text]:not([disabled])::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
*/

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

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

/* Clear div */
.clear {
    clear: both;
}

/* Responsive */
@media (max-width: 768px) {
   .payment-method-selector .freeform-fieldtype-radios {
        flex-direction: column;
    }
    
   .payment-method-selector .freeform-fieldtype-radios label {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
    }
    
    .payment-method-selector h6 {
        font-size: 1.1rem;
    }
}