/*
 * Payment form.
 *
 * Every visual decision reads a custom property. FormAppearance writes them
 * on the wrapper from the form's skin and customisations, so a skin is a set
 * of values rather than a second stylesheet, and the admin preview uses this
 * same file to show exactly what the customer will see.
 *
 * The defaults below are the Clean skin, for a form rendered without them.
 * There is no dark mode guessed from the reader's system preference: the form
 * sits inside somebody else's theme, and a dark skin is a choice the merchant
 * makes to match it.
 */
.wpayme-pay-form-wrap {
    --wpay-width: 540px;
    --wpay-margin: 0 auto;
    --wpay-padding: 26px;
    --wpay-gap: 22px;
    --wpay-surface: #ffffff;
    --wpay-border: #e3e6eb;
    --wpay-card-border-width: 1px;
    --wpay-radius: 14px;
    --wpay-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
    --wpay-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --wpay-font-size: 15px;
    --wpay-text: #1d2327;
    --wpay-muted: #646970;
    --wpay-legend-size: 11px;
    --wpay-legend-transform: uppercase;
    --wpay-legend-spacing: 0.06em;
    --wpay-legend-color: var(--wpay-muted);
    --wpay-input-height: 46px;
    --wpay-radius-sm: 10px;
    --wpay-input-bg: #ffffff;
    --wpay-border-strong: #cdd2da;
    --wpay-accent: #0073aa;
    --wpay-button-bg: var(--wpay-accent);
    --wpay-button-text: #ffffff;
    --wpay-button-radius: var(--wpay-radius-sm);
    --wpay-button-height: 52px;
    --wpay-button-font-size: 16px;
    --wpay-button-width: 100%;
    --wpay-danger: #d63638;
    --wpay-success: #0a7d55;

    /* Derived, so a custom background keeps its tints in step. */
    --wpay-surface-muted: color-mix(in srgb, var(--wpay-text) 4%, var(--wpay-surface));

    width: 100%;
    max-width: var(--wpay-width);
    margin: var(--wpay-margin);
    color: var(--wpay-text);
    font-family: var(--wpay-font);
    font-size: var(--wpay-font-size);
    line-height: 1.5;
    accent-color: var(--wpay-accent);
}

.wpayme-pay-form-wrap * {
    box-sizing: border-box;
}

.wpayme-pay-form {
    padding: var(--wpay-padding);
    border: var(--wpay-card-border-width) solid var(--wpay-border);
    border-radius: var(--wpay-radius);
    background: var(--wpay-surface);
    box-shadow: var(--wpay-shadow);
    color: var(--wpay-text);
}

/* A theme's own text colours would otherwise win inside a dark skin. */
.wpayme-pay-form p,
.wpayme-pay-form li,
.wpayme-pay-form label,
.wpayme-pay-form h2,
.wpayme-pay-form h3 {
    color: inherit;
}

/* Product */

.wpayme-pay-product-image {
    margin-bottom: 16px;
}

.wpayme-pay-product-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--wpay-radius-sm);
}

.wpayme-pay-product-description {
    margin-bottom: 20px;
    color: var(--wpay-muted);
}

/*
 * The fieldsets carry the grouping for screen readers, but their borders and
 * legends drew a box inside a box; the heading does the visible work instead.
 */
.wpayme-pay-form fieldset {
    margin: 0 0 var(--wpay-gap);
    padding: 0;
    border: 0;
}

.wpayme-pay-form fieldset:last-of-type {
    margin-bottom: 0;
}

.wpayme-pay-form legend,
.wpayme-pay-section-title {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    padding: 0;
    color: var(--wpay-legend-color);
    font-size: var(--wpay-legend-size);
    font-weight: 700;
    letter-spacing: var(--wpay-legend-spacing);
    text-transform: var(--wpay-legend-transform);
}

.wpayme-pay-section {
    margin-bottom: var(--wpay-gap);
}

.wpayme-pay-section:last-child {
    margin-bottom: 0;
}

/* Amount */

.wpayme-pay-fixed-price {
    padding: 16px 18px;
    border: 1px solid var(--wpay-border);
    border-radius: var(--wpay-radius-sm);
    background: var(--wpay-surface-muted);
    text-align: center;
}

.wpayme-pay-price-display {
    font-size: calc(var(--wpay-font-size) * 2);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.wpayme-pay-amount-input-only {
    position: relative;
}

.wpayme-pay-amount-input-only .wpayme-pay-currency-symbol {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--wpay-muted);
    font-weight: 600;
}

.wpayme-pay-amount-input-only .wpayme-pay-amount-input {
    padding-left: 34px;
}

/* Choices, variants and methods all read as one kind of control. */
.wpayme-pay-amount-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.wpayme-pay-amount-choice {
    position: relative;
}

.wpayme-pay-amount-choice input[type="radio"] {
    position: absolute;
    top: 16px;
    left: 12px;
    margin: 0;
}

.wpayme-pay-amount-choice label {
    display: flex;
    align-items: center;
    min-height: var(--wpay-input-height);
    padding: 10px 12px 10px 34px;
    border: 1px solid var(--wpay-border-strong);
    border-radius: var(--wpay-radius-sm);
    background: var(--wpay-input-bg);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wpayme-pay-amount-choice label:hover {
    border-color: var(--wpay-accent);
}

.wpayme-pay-amount-choice input[type="radio"]:checked + label {
    border-color: var(--wpay-accent);
    box-shadow: inset 0 0 0 1px var(--wpay-accent);
}

.wpayme-pay-custom-amount {
    grid-column: 1 / -1;
}

/* Billing: one time or recurring, as two equal options. */
.wpayme-pay-recurring-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.wpayme-pay-recurring-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--wpay-input-height);
    padding: 8px 12px;
    border: 1px solid var(--wpay-border-strong);
    border-radius: var(--wpay-radius-sm);
    background: var(--wpay-input-bg);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wpayme-pay-recurring-option:hover {
    border-color: var(--wpay-accent);
}

.wpayme-pay-recurring-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wpayme-pay-recurring-option:has(input:checked) {
    border-color: var(--wpay-accent);
    box-shadow: inset 0 0 0 1px var(--wpay-accent);
    color: var(--wpay-accent);
}

.wpayme-pay-recurring-option:has(input:focus-visible) {
    outline: 2px solid var(--wpay-accent);
    outline-offset: 2px;
}

.wpayme-pay-recurring-note {
    margin: 8px 0 0;
    color: var(--wpay-muted);
    font-size: 0.9em;
}

.wpayme-pay-custom-amount-label {
    gap: 8px;
}

.wpayme-pay-custom-amount-input {
    flex: 1 1 auto;
    min-width: 0;
}

/* Fields */

.wpayme-pay-form input[type="text"],
.wpayme-pay-form input[type="email"],
.wpayme-pay-form input[type="number"],
.wpayme-pay-form input[type="tel"],
.wpayme-pay-form input[type="url"],
.wpayme-pay-form input[type="date"],
.wpayme-pay-form select,
.wpayme-pay-form textarea {
    width: 100%;
    max-width: 100%;
    height: var(--wpay-input-height);
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--wpay-border-strong);
    border-radius: var(--wpay-radius-sm);
    background-color: var(--wpay-input-bg);
    box-shadow: none;
    color: var(--wpay-text);
    font-family: inherit;
    font-size: var(--wpay-font-size);
    line-height: calc(var(--wpay-input-height) - 2px);
}

.wpayme-pay-form input::placeholder {
    color: var(--wpay-muted);
    opacity: 0.7;
}

/* A text area grows with its content rather than holding one line's height. */
.wpayme-pay-form textarea {
    height: auto;
    min-height: calc(var(--wpay-input-height) * 2);
    padding: 10px 14px;
    line-height: 1.5;
    resize: vertical;
}

.wpayme-pay-form input:focus,
.wpayme-pay-form select:focus,
.wpayme-pay-form textarea:focus {
    border-color: var(--wpay-accent);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wpay-accent) 22%, transparent);
}

.wpayme-pay-field {
    margin: 0 0 calc(var(--wpay-gap) * 0.65);
}

.wpayme-pay-field:last-child {
    margin-bottom: 0;
}

.wpayme-pay-customer label {
    display: block;
    margin-bottom: 5px;
    font-size: calc(var(--wpay-font-size) - 2px);
    font-weight: 600;
}

.wpayme-pay-required {
    color: var(--wpay-danger);
}

/* Quantity */

.wpayme-pay-quantity-controls {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--wpay-border-strong);
    border-radius: var(--wpay-radius-sm);
}

.wpayme-pay-quantity-controls button {
    width: calc(var(--wpay-input-height) - 2px);
    height: calc(var(--wpay-input-height) - 2px);
    border: 0;
    background: var(--wpay-surface-muted);
    color: var(--wpay-text);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.wpayme-pay-quantity-controls button:hover {
    background: var(--wpay-border);
}

.wpayme-pay-form .wpayme-pay-quantity-input {
    width: 74px;
    height: calc(var(--wpay-input-height) - 2px);
    border: 0;
    border-left: 1px solid var(--wpay-border);
    border-right: 1px solid var(--wpay-border);
    border-radius: 0;
    text-align: center;
}

.wpayme-pay-stock-info {
    margin-top: 8px;
    color: var(--wpay-muted);
    font-size: 13px;
}

.wpayme-pay-out-of-stock {
    padding: 12px 14px;
    border-radius: var(--wpay-radius-sm);
    background: color-mix(in srgb, var(--wpay-danger) 10%, var(--wpay-surface));
    color: var(--wpay-danger);
    font-weight: 600;
}

/* Coupon */

.wpayme-coupon-container {
    padding: 14px;
    border: 1px dashed var(--wpay-border-strong);
    border-radius: var(--wpay-radius-sm);
    background: var(--wpay-surface-muted);
}

.wpayme-coupon-header {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
}

.wpayme-coupon-field {
    display: flex;
    gap: 8px;
}

.wpayme-coupon-field .wpayme-coupon-input {
    flex: 1 1 auto;
    min-width: 0;
}

.wpayme-apply-coupon-btn {
    flex: 0 0 auto;
    height: var(--wpay-input-height);
    padding: 0 18px;
    border: 1px solid var(--wpay-accent);
    border-radius: var(--wpay-radius-sm);
    background: transparent;
    color: var(--wpay-accent);
    font-family: inherit;
    font-size: calc(var(--wpay-font-size) - 1px);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.wpayme-apply-coupon-btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--wpay-accent) 10%, transparent);
}

.wpayme-apply-coupon-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.wpayme-coupon-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: var(--wpay-radius-sm);
    background: color-mix(in srgb, var(--wpay-success) 12%, var(--wpay-surface));
    color: var(--wpay-success);
    font-weight: 600;
}

.wpayme-remove-coupon-btn {
    border: 0;
    background: none;
    color: inherit;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.wpayme-pay-discounted-price-indicator,
.wpayme-pay-after-discount {
    border-radius: var(--wpay-radius-sm);
}

/* Price breakdown */

.wpayme-pay-price-breakdown {
    overflow: hidden;
    border: 1px solid var(--wpay-border);
    border-radius: var(--wpay-radius-sm);
}

.wpayme-pay-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    font-size: calc(var(--wpay-font-size) - 1px);
}

.wpayme-pay-price-row + .wpayme-pay-price-row {
    border-top: 1px solid var(--wpay-border);
}

.wpayme-pay-price-row .wpayme-pay-price-label {
    color: var(--wpay-muted);
}

.wpayme-pay-price-row.wpayme-pay-total {
    background: var(--wpay-surface-muted);
    font-size: calc(var(--wpay-font-size) + 1px);
    font-weight: 700;
}

.wpayme-pay-price-row.wpayme-pay-total .wpayme-pay-price-label {
    color: var(--wpay-text);
}

.wpayme-pay-discount .wpayme-pay-price-value,
.wpayme-pay-after-discount .wpayme-pay-price-value {
    color: var(--wpay-success);
    font-weight: 600;
}

/* Payment methods */

.wpayme-pay-payment-methods-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* The gateway choice sits above the methods of the chosen gateway. */
.wpayme-pay-gateway-list {
    margin-bottom: 12px;
}

.wpayme-pay-payment-method-item {
    position: relative;
    margin: 0;
}

.wpayme-pay-payment-method-item input[type="radio"] {
    position: absolute;
    top: 50%;
    left: 14px;
    margin: 0;
    transform: translateY(-50%);
}

.wpayme-pay-payment-method-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: calc(var(--wpay-input-height) + 6px);
    padding: 8px 14px 8px 38px;
    border: 1px solid var(--wpay-border-strong);
    border-radius: var(--wpay-radius-sm);
    background: var(--wpay-input-bg);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wpayme-pay-payment-method-item label:hover {
    border-color: var(--wpay-accent);
}

.wpayme-pay-payment-method-item input[type="radio"]:checked + label {
    border-color: var(--wpay-accent);
    box-shadow: inset 0 0 0 1px var(--wpay-accent);
}

.wpayme-pay-method-icon img {
    display: block;
    width: 32px;
    height: auto;
}

.wpayme-pay-method-name {
    font-weight: 600;
}

.wpayme-pay-method-recurring {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--wpay-accent) 12%, var(--wpay-surface));
    color: var(--wpay-accent);
    font-size: 12px;
    font-weight: 600;
}

.wpayme-pay-payment-methods-container .wpayme-pay-error {
    margin: 0;
    color: var(--wpay-danger);
    font-size: calc(var(--wpay-font-size) - 1px);
}

.wpayme-pay-loading,
.wpayme-pay-no-methods {
    margin: 0;
    color: var(--wpay-muted);
    font-size: 14px;
}

/* Errors */

.wpayme-pay-errors {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--wpay-danger) 35%, var(--wpay-surface));
    border-left-width: 3px;
    border-radius: var(--wpay-radius-sm);
    background: color-mix(in srgb, var(--wpay-danger) 8%, var(--wpay-surface));
}

.wpayme-pay-errors .wpayme-pay-error {
    margin: 4px 0;
    color: var(--wpay-danger);
    font-size: 14px;
}

/* VAT */

.wpayme-pay-vat-status {
    display: block;
    margin-top: 5px;
    color: var(--wpay-muted);
    font-size: 13px;
    font-weight: 400;
}

.wpayme-pay-vat-status.is-valid {
    color: var(--wpay-success);
}

.wpayme-pay-vat-status.is-invalid {
    color: var(--wpay-danger);
}

/* Submit */

.wpayme-pay-submit {
    display: flex;
    justify-content: flex-start;
    margin-top: var(--wpay-gap);
    background: none !important;
}

.wpayme-pay-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: var(--wpay-button-width);
    min-height: var(--wpay-button-height);
    padding: 0 28px;
    border: 0;
    border-radius: var(--wpay-button-radius);
    background: var(--wpay-button-bg);
    color: var(--wpay-button-text);
    font-family: inherit;
    font-size: var(--wpay-button-font-size);
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.wpayme-pay-button:hover:not(:disabled) {
    filter: brightness(1.08);
}

.wpayme-pay-button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--wpay-accent) 40%, transparent);
    outline-offset: 2px;
}

/* Submitting leaves the page, so the button says so and cannot be pressed twice. */
.wpayme-pay-button.is-busy,
.wpayme-pay-button:disabled {
    opacity: 0.75;
    cursor: default;
}

.wpayme-pay-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: wpayme-pay-spin 0.7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .wpayme-pay-spinner {
        animation-duration: 2.4s;
    }
}

/*
 * Wallets.
 *
 * Apple's own button is drawn by Safari from the -apple-pay-button
 * appearance, which is what Apple's guidelines ask for, so the label is only
 * a fallback for a browser that does not draw it. The Google Pay button is a
 * plain black button with its name, which stays inside Google's brand rules
 * without borrowing its logo.
 */
.wpayme-pay-wallets {
    margin-top: 22px;
}

.wpayme-pay-wallet-buttons {
    display: grid;
    gap: 10px;
}

.wpayme-pay-wallet {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--wpay-button-height);
    padding: 0 20px;
    border: 0;
    border-radius: var(--wpay-button-radius);
    background: #000;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.wpayme-pay-wallet:hover {
    opacity: 0.88;
}

.wpayme-pay-wallet:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--wpay-accent) 45%, transparent);
    outline-offset: 2px;
}

@supports (-webkit-appearance: -apple-pay-button) {
    .wpayme-pay-wallet--apple-pay {
        -webkit-appearance: -apple-pay-button;
        -apple-pay-button-type: plain;
        -apple-pay-button-style: black;
        padding: 0;
    }

    .wpayme-pay-wallet--apple-pay .wpayme-pay-wallet-label {
        display: none;
    }
}

/* A line with words across it, so the wallets read as a shortcut, not a step. */
.wpayme-pay-wallet-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 0;
    color: var(--wpay-muted);
    font-size: 13px;
}

.wpayme-pay-wallet-divider::before,
.wpayme-pay-wallet-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--wpay-border);
}

.wpayme-pay-wallets + .wpayme-pay-submit {
    margin-top: 14px;
}

.wpayme-pay-out-of-stock-button {
    opacity: 0.7;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .wpayme-pay-form {
        padding: min(var(--wpay-padding), 18px);
    }

    .wpayme-coupon-field {
        flex-wrap: wrap;
    }

    .wpayme-apply-coupon-btn {
        width: 100%;
    }
}

/*
 * Members-only forms: the sign-in box in the form's place.
 */
.wpayme-pay-gate {
    padding: var(--wpay-padding);
    border: var(--wpay-card-border-width) solid var(--wpay-border);
    border-radius: var(--wpay-radius);
    background: var(--wpay-surface);
    box-shadow: var(--wpay-shadow);
    text-align: center;
}

.wpayme-pay-gate-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 10px;
    border-radius: 16px;
    background: var(--wpay-accent);
    color: var(--wpay-button-text);
}

.wpayme-pay-gate-icon svg {
    width: 24px;
    height: 24px;
}

.wpayme-pay-gate-title {
    margin: 0 0 4px;
    color: var(--wpay-text);
    font-size: 20px;
}

.wpayme-pay-gate-text {
    margin: 0 0 18px;
    color: var(--wpay-muted);
}

.wpayme-pay-gate form {
    text-align: left;
}

.wpayme-pay-gate form p {
    margin: 0 0 14px;
}

.wpayme-pay-gate label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.wpayme-pay-gate input[type="text"],
.wpayme-pay-gate input[type="password"] {
    width: 100%;
    height: var(--wpay-input-height);
    padding: 0 14px;
    border: 1px solid var(--wpay-border-strong);
    border-radius: var(--wpay-radius-sm);
    background: var(--wpay-input-bg);
    color: var(--wpay-text);
    font: inherit;
}

.wpayme-pay-gate .login-remember label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}

.wpayme-pay-gate .login-submit input[type="submit"] {
    width: 100%;
    min-height: var(--wpay-button-height);
    border: 0;
    border-radius: var(--wpay-button-radius);
    background: var(--wpay-button-bg);
    color: var(--wpay-button-text);
    font: inherit;
    font-size: var(--wpay-button-font-size);
    font-weight: 600;
    cursor: pointer;
}

.wpayme-pay-gate-links {
    margin: 4px 0 0;
    color: var(--wpay-muted);
    font-size: 14px;
}

.wpayme-pay-gate-links a {
    color: var(--wpay-accent);
}

.wpayme-pay-account-opt,
.wpayme-pay-account-note,
.wpayme-pay-sms-opt {
    padding: 12px 14px;
    border: 1px dashed color-mix(in srgb, var(--wpay-accent) 40%, var(--wpay-border));
    border-radius: var(--wpay-radius-sm);
    background: color-mix(in srgb, var(--wpay-accent) 5%, var(--wpay-surface));
}

.wpayme-pay-account-opt .wpayme-pay-field-help,
.wpayme-pay-sms-opt .wpayme-pay-field-help {
    display: block;
    margin: 4px 0 0 26px;
}

/*
 * Donations.
 *
 * Progress, suggested amounts, covering the fees, dedications, Gift Aid and
 * the donor wall. Like the rest of the form, every colour and size comes from
 * the skin's custom properties, so the dark skins need no rules of their own.
 */

.wpayme-pay-form-wrap .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Progress */

.wpayme-donate-progress {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 var(--wpay-gap);
    padding: 18px 18px 16px;
    border: 1px solid var(--wpay-border);
    border-radius: var(--wpay-radius-sm);
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--wpay-accent) 9%, transparent) 0%, transparent 60%),
        var(--wpay-surface-muted);
    color: var(--wpay-text);
}

.wpayme-donate-progress-body {
    flex: 1 1 auto;
    min-width: 0;
}

.wpayme-donate-headline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    margin: 0 0 12px;
    line-height: 1.2;
}

.wpayme-donate-raised {
    color: var(--wpay-text);
    font-size: calc(var(--wpay-font-size) * 1.85);
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.wpayme-donate-goal {
    color: var(--wpay-muted);
    font-size: calc(var(--wpay-font-size) - 1px);
}

.wpayme-donate-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    /* Logical, because this stylesheet is also printed as-is on right-to-left sites. */
    margin-inline-start: auto;
    padding: 3px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--wpay-success) 14%, var(--wpay-surface));
    color: var(--wpay-success);
    font-size: 12px;
    font-weight: 700;
}

.wpayme-donate-badge svg {
    width: 14px;
    height: 14px;
}

.wpayme-donate-bar {
    position: relative;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--wpay-accent) 14%, var(--wpay-surface));
}

.wpayme-donate-bar-fill {
    display: block;
    height: 100%;
    min-width: 6px;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--wpay-accent) 75%, var(--wpay-surface)), var(--wpay-accent));
    transform-origin: left center;
    animation: wpayme-donate-grow 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.is-reached .wpayme-donate-bar-fill {
    background: linear-gradient(90deg, color-mix(in srgb, var(--wpay-success) 70%, var(--wpay-surface)), var(--wpay-success));
}

.wpayme-pay-form-wrap:dir(rtl) .wpayme-donate-bar-fill {
    transform-origin: right center; /*rtl:ignore*/
}

@keyframes wpayme-donate-grow {
    from {
        transform: scaleX(0);
    }
}

.wpayme-donate-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    color: var(--wpay-muted);
    font-size: calc(var(--wpay-font-size) - 2px);
}

.wpayme-donate-facts li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.wpayme-donate-facts svg {
    width: 15px;
    height: 15px;
    flex: none;
    color: var(--wpay-accent);
}

.wpayme-donate-others {
    margin: 8px 0 0;
    color: var(--wpay-muted);
    font-size: 12px;
}

.wpayme-donate-progress.is-ended .wpayme-donate-facts li:last-child {
    color: var(--wpay-danger);
}

.wpayme-donate-ring {
    position: relative;
    flex: 0 0 auto;
    width: 112px;
    height: 112px;
}

.wpayme-donate-ring svg {
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.wpayme-donate-ring circle {
    fill: none;
    stroke-width: 10;
}

.wpayme-donate-ring-track {
    stroke: color-mix(in srgb, var(--wpay-accent) 14%, var(--wpay-surface));
}

.wpayme-donate-ring-fill {
    stroke: var(--wpay-accent);
    stroke-linecap: round;
    animation: wpayme-donate-ring 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.is-reached .wpayme-donate-ring-fill {
    stroke: var(--wpay-success);
}

@keyframes wpayme-donate-ring {
    from {
        stroke-dasharray: 0 400;
    }
}

.wpayme-donate-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wpay-text);
    font-size: 26px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.wpayme-donate-ring-label small {
    font-size: 14px;
    font-weight: 700;
}

.wpayme-donate-progress--compact {
    padding: 12px 14px;
}

.wpayme-donate-progress--compact .wpayme-donate-headline {
    margin-bottom: 8px;
}

.wpayme-donate-progress--compact .wpayme-donate-raised {
    font-size: calc(var(--wpay-font-size) * 1.2);
}

.wpayme-donate-progress--compact .wpayme-donate-bar {
    height: 6px;
}

.wpayme-donate-progress--compact .wpayme-donate-facts {
    margin-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .wpayme-donate-bar-fill,
    .wpayme-donate-ring-fill {
        animation: none;
    }
}

@media (max-width: 420px) {
    .wpayme-donate-progress--circle {
        flex-direction: column;
        text-align: center;
    }

    .wpayme-donate-progress--circle .wpayme-donate-headline,
    .wpayme-donate-progress--circle .wpayme-donate-facts {
        justify-content: center;
    }
}

/* Once or monthly */

.wpayme-donate-frequency {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 0 0 8px;
    padding: 4px;
    border: 1px solid var(--wpay-border);
    border-radius: calc(var(--wpay-radius-sm) + 4px);
    background: var(--wpay-surface-muted);
}

.wpayme-donate-frequency-option {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.wpayme-donate-frequency-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wpayme-donate-frequency-option > span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: calc(var(--wpay-input-height) - 6px);
    padding: 6px 12px;
    border-radius: var(--wpay-radius-sm);
    color: var(--wpay-muted);
    font-weight: 700;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.wpayme-donate-frequency-option > span svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.wpayme-donate-frequency-option:hover > span {
    color: var(--wpay-text);
}

.wpayme-donate-frequency-option input:checked + span {
    background: var(--wpay-button-bg);
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.18);
    color: var(--wpay-button-text);
}

.wpayme-donate-frequency-option input:checked + span svg {
    fill: currentColor;
}

.wpayme-donate-frequency-option input:focus-visible + span {
    outline: 2px solid var(--wpay-accent);
    outline-offset: 2px;
}

.wpayme-donate-frequency-note {
    margin: 0 0 14px;
    text-align: center;
}

/* Suggested amounts */

.wpayme-donate-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.wpayme-donate-tiles--1 {
    grid-template-columns: minmax(0, 1fr);
}

.wpayme-donate-tiles--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wpayme-donate-tiles--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* On a phone, rows of three or four become two, so an amount never has to wrap. */
@media (max-width: 480px) {
    .wpayme-donate-tiles--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wpayme-donate-tile {
        padding: 12px 6px 10px;
    }
}

/* The section title names the amounts; the fieldset legend stays for screen readers. */
.wpayme-pay-form--donation .wpayme-pay-product-options > legend {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.wpayme-donate-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: calc(var(--wpay-input-height) + 16px);
    margin: 0;
    padding: 14px 10px 12px;
    border: 1.5px solid var(--wpay-border-strong);
    border-radius: var(--wpay-radius-sm);
    background: var(--wpay-input-bg);
    color: var(--wpay-text);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.wpayme-donate-tile:hover {
    border-color: var(--wpay-accent);
    transform: translateY(-1px);
}

.wpayme-donate-tile input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wpayme-donate-tile-amount {
    font-size: calc(var(--wpay-font-size) * 1.35);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.wpayme-donate-tile-label {
    color: var(--wpay-muted);
    font-size: calc(var(--wpay-font-size) - 3px);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.wpayme-donate-tile-flag {
    position: absolute;
    top: -9px;
    left: 50%;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--wpay-accent);
    color: var(--wpay-button-text);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 16px;
    text-transform: uppercase;
    white-space: nowrap;
    transform: translateX(-50%);
}

.wpayme-donate-tile:has(input:checked) {
    border-color: var(--wpay-accent);
    background: color-mix(in srgb, var(--wpay-accent) 8%, var(--wpay-input-bg));
    box-shadow: inset 0 0 0 1px var(--wpay-accent);
}

.wpayme-donate-tile:has(input:checked) .wpayme-donate-tile-amount {
    color: var(--wpay-accent);
}

.wpayme-donate-tile:has(input:focus-visible) {
    outline: 2px solid var(--wpay-accent);
    outline-offset: 2px;
}

.wpayme-donate-custom {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: calc(var(--wpay-input-height) + 4px);
    margin: 10px 0 0;
    padding: 0 14px;
    border: 1.5px solid var(--wpay-border-strong);
    border-radius: var(--wpay-radius-sm);
    background: var(--wpay-input-bg);
    cursor: text;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wpayme-donate-custom--only {
    min-height: calc(var(--wpay-input-height) + 14px);
}

.wpayme-donate-custom:has(input:checked),
.wpayme-donate-custom:focus-within {
    border-color: var(--wpay-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wpay-accent) 18%, transparent);
}

.wpayme-donate-custom-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wpayme-donate-custom-symbol {
    color: var(--wpay-muted);
    font-size: calc(var(--wpay-font-size) + 2px);
    font-weight: 700;
}

.wpayme-pay-form .wpayme-donate-custom input[type="number"] {
    flex: 1 1 auto;
    min-width: 0;
    height: calc(var(--wpay-input-height) - 2px);
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: calc(var(--wpay-font-size) + 2px);
    font-weight: 700;
}

.wpayme-pay-form .wpayme-donate-custom input[type="number"]:focus {
    box-shadow: none;
}

.wpayme-donate-hint {
    margin: 6px 0 0;
    color: var(--wpay-muted);
    font-size: 12.5px;
}

/* Cover the fees */

.wpayme-donate-fees {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 14px 0 0;
    padding: 12px 14px;
    border: 1px dashed color-mix(in srgb, var(--wpay-accent) 45%, var(--wpay-border));
    border-radius: var(--wpay-radius-sm);
    background: color-mix(in srgb, var(--wpay-accent) 5%, var(--wpay-surface));
    cursor: pointer;
}

.wpayme-donate-fees input,
.wpayme-donate-check input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--wpay-accent);
}

.wpayme-donate-fees > span,
.wpayme-donate-check > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wpayme-donate-fees strong,
.wpayme-donate-check strong {
    font-weight: 600;
}

.wpayme-donate-fees small,
.wpayme-donate-check small {
    color: var(--wpay-muted);
    font-size: 12.5px;
    line-height: 1.45;
}

.wpayme-donate-summary {
    margin: 14px 0 0;
    padding: 10px 14px;
    border-radius: var(--wpay-radius-sm);
    background: var(--wpay-surface-muted);
    color: var(--wpay-text);
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Make it personal */

.wpayme-donate-card {
    margin: 0 0 12px;
    padding: 14px;
    border: 1px solid var(--wpay-border);
    border-radius: var(--wpay-radius-sm);
    background: var(--wpay-surface);
}

.wpayme-donate-card[hidden] {
    display: none;
}

.wpayme-donate-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.wpayme-donate-card-head > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wpayme-donate-card-head small {
    color: var(--wpay-muted);
    font-size: 12.5px;
    line-height: 1.45;
}

.wpayme-donate-card-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--wpay-accent) 12%, var(--wpay-surface));
    color: var(--wpay-accent);
}

.wpayme-donate-card-icon svg {
    width: 18px;
    height: 18px;
}

.wpayme-donate-giftaid-mark {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 36px;
    padding: 0 8px;
    border-radius: 10px;
    background: var(--wpay-accent);
    color: var(--wpay-button-text);
    font-size: 13px;
    font-weight: 800;
}

.wpayme-donate-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wpayme-donate-choice label {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.wpayme-donate-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wpayme-donate-choice span {
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid var(--wpay-border-strong);
    border-radius: 999px;
    background: var(--wpay-input-bg);
    color: var(--wpay-text);
    font-size: calc(var(--wpay-font-size) - 2px);
    font-weight: 600;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.wpayme-donate-choice label:hover span {
    border-color: var(--wpay-accent);
}

.wpayme-donate-choice input:checked + span {
    border-color: var(--wpay-accent);
    background: var(--wpay-accent);
    color: var(--wpay-button-text);
}

.wpayme-donate-choice input:focus-visible + span {
    outline: 2px solid var(--wpay-accent);
    outline-offset: 2px;
}

/* Fields that belong to an option: CSS alone opens them, so the form works without the script. */
.wpayme-donate-reveal {
    display: none;
    margin-top: 12px;
}

.wpayme-donate-reveal.is-open,
.wpayme-donate-tribute:has(input[name="wpayme_pay_tribute_type"]:not([value=""]):checked) > [data-donate-reveal="tribute"],
.wpayme-donate-reveal:has(input[name="wpayme_pay_tribute_notify"]:checked) > [data-donate-reveal="notify"],
.wpayme-donate-giftaid:has(input[name="wpayme_pay_gift_aid"]:checked) > [data-donate-reveal="giftaid"] {
    display: block;
    animation: wpayme-donate-open 0.2s ease both;
}

.wpayme-donate-reveal.wpayme-donate-grid.is-open,
.wpayme-donate-reveal:has(input[name="wpayme_pay_tribute_notify"]:checked) > .wpayme-donate-grid[data-donate-reveal="notify"] {
    display: grid;
}

@keyframes wpayme-donate-open {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .wpayme-donate-reveal {
        animation: none !important;
    }
}

/* A reveal that is also a grid stays hidden until it opens: the rule above makes it a grid then. */
.wpayme-donate-grid:not(.wpayme-donate-reveal) {
    display: grid;
}

.wpayme-donate-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 0 12px;
}

.wpayme-donate-grid > .wpayme-donate-hint {
    grid-column: 1 / -1;
    margin-top: 0;
}

.wpayme-pay-donation-extras .wpayme-pay-field > label {
    display: block;
    margin-bottom: 5px;
    font-size: calc(var(--wpay-font-size) - 2px);
    font-weight: 600;
}

.wpayme-donate-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 0;
    cursor: pointer;
}

.wpayme-donate-declaration > span {
    display: block;
}

.wpayme-donate-declaration {
    padding: 12px;
    border-radius: var(--wpay-radius-sm);
    background: var(--wpay-surface-muted);
    font-size: 13px;
    line-height: 1.55;
}

.wpayme-donate-declaration [data-gift-aid-amount] {
    font-weight: 700;
}

.wpayme-donate-anonymous {
    padding: 12px 14px;
    border: 1px dashed var(--wpay-border-strong);
    border-radius: var(--wpay-radius-sm);
}

/* Progress and walls placed on their own */

.wpayme-pay-form-wrap.wpayme-donate-embed {
    max-width: 100%;
    margin: 0;
}

.wpayme-donate-embed-outer {
    margin-bottom: 1.5em;
}

.wpayme-donate-embed .wpayme-donate-progress {
    margin: 0;
    box-shadow: var(--wpay-shadow);
}

/* Donor wall */

.wpayme-donor-wall {
    padding: var(--wpay-padding);
    border: var(--wpay-card-border-width) solid var(--wpay-border);
    border-radius: var(--wpay-radius);
    background: var(--wpay-surface);
    box-shadow: var(--wpay-shadow);
    color: var(--wpay-text);
}

.wpayme-donor-wall-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--wpay-text);
    font-size: calc(var(--wpay-font-size) + 3px);
    font-weight: 700;
}

.wpayme-donor-wall-title svg {
    width: 20px;
    height: 20px;
    color: var(--wpay-accent);
    fill: color-mix(in srgb, var(--wpay-accent) 20%, transparent);
}

.wpayme-donor-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wpayme-donor {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--wpay-border);
    border-radius: var(--wpay-radius-sm);
    background: var(--wpay-surface-muted);
}

.wpayme-donor-avatar {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: hsl(var(--wpayme-donor-hue, 220) 62% 88%);
    color: hsl(var(--wpayme-donor-hue, 220) 45% 26%);
    font-size: 14px;
    font-weight: 800;
}

.wpayme-donor.is-anonymous .wpayme-donor-avatar {
    background: color-mix(in srgb, var(--wpay-accent) 14%, var(--wpay-surface));
    color: var(--wpay-accent);
}

.wpayme-donor-avatar svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.wpayme-donor-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wpayme-donor-name {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wpayme-donor.is-anonymous .wpayme-donor-name {
    color: var(--wpay-muted);
    font-style: italic;
}

.wpayme-donor-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    color: var(--wpay-muted);
    font-size: 12.5px;
}

.wpayme-donor-monthly {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--wpay-accent);
    font-weight: 600;
}

.wpayme-donor-monthly svg {
    width: 12px;
    height: 12px;
}

.wpayme-donor-tribute {
    overflow: hidden;
    color: var(--wpay-muted);
    font-size: 12.5px;
    font-style: italic;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wpayme-donor-amount {
    flex: none;
    margin-inline-start: auto;
    color: var(--wpay-text);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.wpayme-donor-rank {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
}

.wpayme-donor-rank--1 {
    background: #f6d365;
    color: #5c4300;
}

.wpayme-donor-rank--2 {
    background: #dfe3e8;
    color: #3d4650;
}

.wpayme-donor-rank--3 {
    background: #f0c4a0;
    color: #5a3413;
}

.wpayme-donor-wall-empty {
    padding: 24px 12px;
    color: var(--wpay-muted);
    text-align: center;
}

.wpayme-donor-wall-empty svg {
    width: 30px;
    height: 30px;
    color: var(--wpay-accent);
}

.wpayme-donor-wall-empty p {
    margin: 8px 0 0;
}
/* -------------------------------------------------------------------------
 * Steps
 *
 * The progress indicator is a list of numbered dots with their titles. On a
 * phone the titles would wrap into three lines each, so below 480px only the
 * current step keeps its title and the rest are dots.
 * ------------------------------------------------------------------------- */

.wpayme-pay-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 4px;
    margin: 0 0 6px;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.wpayme-pay-step-mark {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    min-width: 0;
    margin: 0;
}

.wpayme-pay-step-dot {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 6px 2px;
    border: 0;
    border-top: 3px solid var(--wpay-border);
    border-radius: 0;
    background: none;
    color: var(--wpay-muted);
    font: inherit;
    font-size: 13px;
    text-align: start;
    cursor: default;
}

.wpayme-pay-step-dot:not(:disabled) {
    cursor: pointer;
}

.wpayme-pay-step-mark.is-done .wpayme-pay-step-dot,
.wpayme-pay-step-mark.is-current .wpayme-pay-step-dot {
    border-top-color: var(--wpay-accent);
    color: var(--wpay-text);
}

.wpayme-pay-step-dot:focus-visible {
    outline: 2px solid var(--wpay-accent);
    outline-offset: 2px;
}

.wpayme-pay-step-number {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--wpay-border-strong);
    border-radius: 50%;
    background: var(--wpay-surface);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.wpayme-pay-step-mark.is-current .wpayme-pay-step-number {
    border-color: var(--wpay-accent);
    background: var(--wpay-accent);
    color: var(--wpay-button-text);
}

.wpayme-pay-step-mark.is-done .wpayme-pay-step-number {
    border-color: var(--wpay-accent);
    color: var(--wpay-accent);
}

.wpayme-pay-step-label {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wpayme-pay-step-position {
    margin: 0 0 14px;
    color: var(--wpay-muted);
    font-size: 12.5px;
}

.wpayme-pay-step {
    display: flex;
    flex-direction: column;
    gap: var(--wpay-gap);
}

/* A step that is not the current one. display:flex above would otherwise win over [hidden]. */
.wpayme-pay-step[hidden] {
    display: none;
}

.wpayme-pay-step:focus {
    outline: none;
}

.wpayme-pay-step-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wpayme-pay-step-next,
.wpayme-pay-step-back {
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid var(--wpay-border-strong);
    border-radius: var(--wpay-button-radius);
    background: var(--wpay-surface);
    color: var(--wpay-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.wpayme-pay-step-next {
    flex: 1 1 auto;
    order: 2;
    border-color: var(--wpay-button-bg);
    background: var(--wpay-button-bg);
    color: var(--wpay-button-text);
}

.wpayme-pay-step-back {
    order: 1;
}

.wpayme-pay-step-next:hover,
.wpayme-pay-step-back:hover {
    filter: brightness(0.96);
}

.wpayme-pay-step-next:focus-visible,
.wpayme-pay-step-back:focus-visible {
    outline: 2px solid var(--wpay-accent);
    outline-offset: 2px;
}

/* Scoped to the wrapper so a theme's own paragraph colour does not win. */
.wpayme-pay-form-wrap .wpayme-pay-step-problem {
    margin: 0;
    color: var(--wpay-danger);
    font-size: 13.5px;
    font-weight: 600;
}

@media (max-width: 480px) {
    .wpayme-pay-step-mark:not(.is-current) .wpayme-pay-step-label {
        display: none;
    }

    .wpayme-pay-step-mark:not(.is-current) {
        flex: 0 0 auto;
    }
}

/* -------------------------------------------------------------------------
 * How many are left, and a file to attach
 * ------------------------------------------------------------------------- */

.wpayme-pay-remaining {
    margin: 0 0 10px;
    color: var(--wpay-accent);
    font-size: 13.5px;
    font-weight: 700;
}

.wpayme-pay-field--file input[type="file"] {
    width: 100%;
    min-height: var(--wpay-input-height);
    padding: 9px 12px;
    border: 1px dashed var(--wpay-border-strong);
    border-radius: var(--wpay-radius-sm);
    background: var(--wpay-input-bg);
    color: var(--wpay-text);
    font: inherit;
    font-size: 14px;
}

.wpayme-pay-field--file input[type="file"]::file-selector-button {
    margin-inline-end: 12px;
    padding: 6px 12px;
    border: 1px solid var(--wpay-border-strong);
    border-radius: 999px;
    background: var(--wpay-surface);
    color: var(--wpay-text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.wpayme-pay-field--file input[type="file"]:focus-visible {
    border-color: var(--wpay-accent);
    outline: 2px solid var(--wpay-accent);
    outline-offset: 1px;
}

/* What a bundle is made of, and what comes with the purchase.
 *
 * Both are told before the money is asked for: a buyer deciding whether to pay
 * should not have to work out what they are paying for from the total.
 */

.wpayme-pay-bundle-items,
.wpayme-pay-includes-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wpayme-pay-bundle-items li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--wpay-border-color, #e5e7eb);
}

.wpayme-pay-bundle-items li:last-child {
    border-bottom: 0;
}

.wpayme-pay-bundle-name {
    font-weight: 600;
}

.wpayme-pay-bundle-price {
    color: var(--wpay-muted-color, #6b7280);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.wpayme-pay-bundle-saving {
    margin: 8px 0 0;
    font-weight: 600;
}

.wpayme-pay-includes-list li {
    padding: 4px 0 4px 22px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M4 20h16'/%3E%3C/svg%3E") no-repeat 0 0.55em;
}

.wpayme-pay-includes-note {
    margin: 6px 0 0;
    color: var(--wpay-muted-color, #6b7280);
    font-size: 0.9em;
}

/* Options, as things to choose between rather than a list to unfold.
 *
 * A buyer deciding between options wants the price and what each one actually
 * is - a download, a parcel - at the same time, which a select cannot show.
 */

.wpayme-pay-variants {
    display: grid;
    gap: 10px;
}

.wpayme-pay-variant {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--wpay-border-color, #e5e7eb);
    border-radius: var(--wpay-radius, 10px);
    background: var(--wpay-surface, #fff);
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.wpayme-pay-variant:hover {
    border-color: var(--wpay-accent-color, #4f46e5);
}

.wpayme-pay-variant.is-chosen {
    border-color: var(--wpay-accent-color, #4f46e5);
    box-shadow: 0 0 0 1px var(--wpay-accent-color, #4f46e5) inset;
}

.wpayme-pay-variant input[type="radio"] {
    margin: 3px 0 0;
    flex: 0 0 auto;
}

.wpayme-pay-variant-body {
    flex: 1;
    min-width: 0;
}

.wpayme-pay-variant-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.wpayme-pay-variant-name {
    font-weight: 600;
}

.wpayme-pay-variant-price {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.wpayme-pay-variant-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.wpayme-pay-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--wpay-muted-bg, #f3f4f6);
    color: var(--wpay-muted-color, #6b7280);
    font-size: 0.8em;
    line-height: 1.6;
}

.wpayme-pay-tag--download {
    background: rgba(79, 70, 229, 0.08);
    color: #4338ca;
}

.wpayme-pay-tag--post {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

/* Where to post it, asked only when something has to be posted. */

.wpayme-pay-address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0 16px;
}
