/* Base PayFast button */
.cf7-payfast-button {
    background-color: #5F5F5F;
    color: #fff;
    border: none;
    padding: 14px 24px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 5px;
    position: relative;

    /* Smooth transitions */
    transition:
        background-color 0.4s ease,
        transform 0.25s ease,
        box-shadow 0.4s ease;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Hover state (only when NOT loading/disabled) */
.cf7-payfast-button:not(.is-loading):hover {
    background-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* Loading / disabled state */
.cf7-payfast-button.is-loading {
    pointer-events: none;
    opacity: 0.85;
    cursor: default;
    padding-right: 3em; /* space for spinner */
}

/* Spinner */
.cf7-payfast-button.is-loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-top-color: transparent;
    border-radius: 50%;
    position: absolute;
    right: 1em;
    top: 50%;
    transform: translateY(-50%);
    animation: cf7pf-spin 0.8s linear infinite;
}

@keyframes cf7pf-spin {
    from {
        transform: translateY(-50%) rotate(0deg);
    }
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Section wrapper */
.cf7-payfast-extra-section {
    margin: 10px 0;
}

/* Checkbox container */
.cf7-payfast-extra {
    margin-left: 2px;
}

/* Section heading */
.cf7-payfast-extra-heading {
    display: block;
    margin-bottom: 8px;
}

/* Label styling */
.cf7-payfast-extra label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #333333;
    line-height: 1.5;
    cursor: pointer;
}

/* Amount emphasis */
.cf7-payfast-extra-amount {
    font-weight: 600;
    color: #333333;
}

/* Total preview underneath the donation checkbox */
.cf7-payfast-total-preview {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
}

/* Currency input styling */
.wpcf7-form input[name="donation_amount"] {
    box-sizing: border-box;
    padding-left: 28px;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: 10px center;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ctext x='0' y='13' font-size='14' font-family='system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif' fill='%23555'%3ER%3C/text%3E%3C/svg%3E");
}

/* Remove number spinners (Chrome, Edge, Safari) */
.wpcf7-form input[name="donation_amount"]::-webkit-inner-spin-button,
.wpcf7-form input[name="donation_amount"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Remove number spinners (Firefox) */
.wpcf7-form input[name="donation_amount"] {
    -moz-appearance: textfield;
    appearance: textfield;
}