/**
 * WooCommerce Payment Forms - Public Styles
 */

/* Form Wrapper */
.wpf-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

/* Floating help button copied from the legacy BCAA payment page */
.wpf-help-button.button-link {
    position: fixed;
    right: 24px;
    bottom: 60px;
    z-index: 2000;
    display: flex;
    align-items: center;
    width: 280px;
    max-width: calc(100vw - 32px);
    min-height: 48px;
    padding: 7px 7px 7px 12px;
    border-radius: 10px;
    background-color: #eaa8ad;
    box-sizing: border-box;
}

.wpf-help-button.button-link .wpf-help-button-anchor {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
    min-height: 34px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}

.wpf-help-button.button-link .wpf-help-button-anchor:hover,
.wpf-help-button.button-link .wpf-help-button-anchor:focus,
.wpf-help-button.button-link .wpf-help-button-anchor:active {
    color: #fff;
    text-decoration: none;
}

.wpf-help-button.button-link .wpf-help-button-anchor:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.wpf-help-button.button-link .img-button,
.wpf-help-button.button-link .text-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wpf-help-button.button-link .img-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    color: #eaa8ad;
}

.wpf-help-button.button-link .text-button {
    flex: 1;
    padding: 0 0 0 15px;
}

.wpf-help-button.button-link .wpf-help-button-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.wpf-help-button.button-link .wpf-help-button-close:hover,
.wpf-help-button.button-link .wpf-help-button-close:focus,
.wpf-help-button.button-link .wpf-help-button-close:active {
    background: transparent;
    color: #fff;
}

.wpf-help-button.button-link .wpf-help-button-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
    border-radius: 4px;
}

.wpf-help-button.button-link .text-close-button {
    width: 20px;
    height: 20px;
    color: #fff;
}

.wpf-help-button.is-hidden {
    display: none;
}

.wpf-help-button.button-link .img-button svg {
    width: 18px;
    height: 18px;
}

.wpf-help-button.button-link .text-close-button svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 600px) {
    .wpf-help-button.button-link {
        right: 16px;
        bottom: 20px;
        width: auto;
        left: 16px;
        max-width: none;
    }
}

/* Form Container */
.wpf-payment-form {
    padding: 30px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    font-family: "Open Sans", sans-serif;
}

/* Fields Container */
.wpf-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

/* Field Base Styles */
.wpf-field {
    margin-bottom: 0;
}

.wpf-conditional-hidden {
    display: none !important;
}

.wpf-field-full {
    width: 100%;
}

.wpf-field-half {
    width: calc(50% - 12px);
}

@media (max-width: 600px) {
    .wpf-field-half {
        width: 100%;
    }
}

/* Labels */
.wpf-field label,
.wpf-group-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
}

.wpf-required {
    color: #d63638;
    margin-left: 3px;
}

/* Input Fields */
.wpf-field input[type="text"],
.wpf-field input[type="email"],
.wpf-field input[type="tel"],
.wpf-field input[type="number"],
.wpf-field input[type="date"],
.wpf-field textarea,
.wpf-field select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
    color: #1d2327;
}

.wpf-field input[type="text"]:focus,
.wpf-field input[type="email"]:focus,
.wpf-field input[type="tel"]:focus,
.wpf-field input[type="number"]:focus,
.wpf-field input[type="date"]:focus,
.wpf-field textarea:focus,
.wpf-field select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.wpf-field textarea {
    resize: vertical;
    min-height: 100px;
}

.wpf-field-size-small input[type="text"],
.wpf-field-size-small input[type="email"],
.wpf-field-size-small input[type="tel"],
.wpf-field-size-small input[type="number"],
.wpf-field-size-small input[type="date"],
.wpf-field-size-small textarea,
.wpf-field-size-small select {
    padding: 10px 12px;
    font-size: 14px;
}

.wpf-field-size-large input[type="text"],
.wpf-field-size-large input[type="email"],
.wpf-field-size-large input[type="tel"],
.wpf-field-size-large input[type="number"],
.wpf-field-size-large input[type="date"],
.wpf-field-size-large textarea,
.wpf-field-size-large select {
    padding: 16px 18px;
    font-size: 17px;
}

/* Checkbox & Radio */
.wpf-field-checkbox label,
.wpf-checkbox-option,
.wpf-radio-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
}

.wpf-field-checkbox input[type="checkbox"],
.wpf-checkbox-option input[type="checkbox"],
.wpf-radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.wpf-checkbox-options,
.wpf-radio-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wpf-option-label-text {
    flex: 1;
    display: block;
    line-height: 1.5;
    word-break: break-word;
}

.wpf-layout-horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
}

.wpf-layout-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}

.wpf-layout-columns .wpf-option-column {
    display: grid;
    gap: 10px;
}

/* Amount Field */
.wpf-amount-display {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #1d2327;
    padding: 12px 15px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #f8fafc;
}

.wpf-amount-input-wrapper {
    display: flex;
    align-items: stretch;
    min-height: 0;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wpf-amount-input-wrapper .wpf-currency {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    min-width: 68px;
    font-size: 15px;
    font-weight: 700;
    color: #1f2933;
    background: #eef1f5;
    border-right: 1px solid #d0d4dc;
    border-radius: 4px 0 0 4px;
    line-height: 1;
}

.wpf-field .wpf-amount-input-wrapper input {
    flex: 1;
    padding: 12px 15px;
    border: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
    font-size: 16px;
}

/* Prevent generic .wpf-field input:focus styles from adding an inner outline */
.wpf-field .wpf-amount-input-wrapper input:focus {
    border: 0;
    box-shadow: none;
    outline: none;
}

.wpf-amount-input-wrapper:focus-within {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.wpf-field-size-small .wpf-amount-input-wrapper {
    min-height: 46px;
}

.wpf-field-size-small .wpf-amount-input-wrapper .wpf-currency {
    padding: 10px 12px;
    min-width: 60px;
}

.wpf-field-size-small .wpf-amount-input-wrapper input {
    padding: 10px 12px;
    font-size: 15px;
}

.wpf-field-size-large .wpf-amount-input-wrapper {
    min-height: 58px;
}

.wpf-field-size-large .wpf-amount-input-wrapper .wpf-currency {
    padding: 14px 16px;
    min-width: 74px;
}

.wpf-field-size-large .wpf-amount-input-wrapper input {
    padding: 14px 16px;
    font-size: 17px;
}

.wpf-amount-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wpf-amount-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border: 2px solid #dcdcde;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.wpf-amount-option:hover {
    border-color: #2271b1;
    background: #f8fafc;
}

.wpf-amount-option input[type="radio"]:checked + .wpf-amount-option-label {
    font-weight: 600;
}

.wpf-amount-option input[type="radio"] {
    width: 20px;
    height: 20px;
}

.wpf-amount-option-label {
    font-size: 16px;
}

/* Priced Text Field */
.wpf-priced-text-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.wpf-priced-text-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #eef1f5;
    border: 1px solid #d0d4dc;
    border-radius: 999px;
    color: #1f2933;
    font-weight: 700;
    font-size: 13px;
}

.wpf-priced-text-input input {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid #8c8f94;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.wpf-priced-text-input input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.wpf-field-size-small .wpf-priced-text-input input {
    min-height: 46px;
    padding: 10px 12px;
    font-size: 15px;
}

.wpf-field-size-large .wpf-priced-text-input input {
    min-height: 58px;
    padding: 14px 16px;
    font-size: 17px;
}

/* Divider */
.wpf-divider {
    padding: 20px 0;
    width: 100%;
}

.wpf-divider-line {
    border-bottom: 1px solid #dcdcde;
}

.wpf-divider-title {
    display: inline-block;
    background: #fff;
    padding: 0 15px;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    position: relative;
    top: 10px;
    margin-left: 20px;
}

/* HTML Content */
.wpf-html-content {
    padding: 10px 0;
}

/* Repeater Field */
.wpf-field-repeater {
    width: 100%;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 20px;
    background: #f9f9f9;
}

.wpf-repeater-rows {
    margin-bottom: 15px;
}

.wpf-repeater-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 15px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    margin-bottom: 10px;
}

.wpf-repeater-row-fields {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.wpf-repeater-row-fields .wpf-field {
    margin-bottom: 0;
}

.wpf-repeater-remove-row {
    background: none;
    border: none;
    color: #d63638;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
}

.wpf-repeater-remove-row:hover {
    background: #fcf0f1;
}

.wpf-repeater-add-row {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #2271b1;
    color: #2271b1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.wpf-repeater-add-row:hover {
    background: #2271b1;
    color: #fff;
}

/* Stripe Card Element */
.wpf-stripe-elements {
    margin: 20px 0;
}

.wpf-card-element {
    padding: 15px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
}

.wpf-card-errors {
    color: #d63638;
    font-size: 14px;
    margin-top: 8px;
}

/* PayPal Buttons */
.wpf-paypal-buttons {
    margin: 20px 0;
}

/* Submit Button */
.wpf-submit-wrapper {
    margin-top: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.wpf-submit-left {
    justify-content: flex-start;
}

.wpf-submit-center {
    justify-content: center;
}

.wpf-submit-right {
    justify-content: flex-end;
}

.wpf-submit-full .wpf-submit-button {
    width: 100%;
}

.wpf-submit-button {
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #2271b1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wpf-submit-button:hover {
    background: #135e96;
}

.wpf-submit-button:disabled {
    background: #a7aaad;
    cursor: not-allowed;
}

/* Spinner */
.wpf-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: wpf-spin 1s linear infinite;
}

.wpf-form-loading .wpf-spinner {
    display: inline-block;
}

.wpf-form-loading .wpf-submit-button {
    opacity: 0.7;
    pointer-events: none;
}

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

/* Messages */
.wpf-messages {
    margin-top: 20px;
}

.wpf-success-message {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #0a3622;
    font-size: 16px;
    text-align: center;
}

.wpf-success-message.wpf-visible {
    display: block;
    animation: wpf-fadeIn 0.3s ease;
}

.wpf-error-message {
    padding: 20px;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 6px;
    color: #842029;
    font-size: 16px;
    text-align: center;
}

.wpf-error-message.wpf-visible {
    display: block;
    animation: wpf-fadeIn 0.3s ease;
}

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

/* Error State for Fields */
.wpf-field-error input,
.wpf-field-error textarea,
.wpf-field-error select {
    border-color: #d63638;
}

.wpf-field-error-message {
    color: #d63638;
    font-size: 13px;
    margin-top: 5px;
}

/* Accessibility */
.wpf-field input:focus-visible,
.wpf-field textarea:focus-visible,
.wpf-field select:focus-visible,
.wpf-submit-button:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Form Error State */
.wpf-error {
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 6px;
    color: #842029;
}

/* =====================================================
   Multi-Step Form Styles
   ===================================================== */
.wpf-multistep-progress {
    margin-bottom: 30px;
}

/* Progress Bar Style */
.wpf-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.wpf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #135e96);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.wpf-progress-text {
    text-align: center;
    font-size: 14px;
    color: #646970;
}

/* Step Indicators Style */
.wpf-step-indicators {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.wpf-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.wpf-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #646970;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.wpf-step-indicator.wpf-step-active .wpf-step-number,
.wpf-step-indicator.wpf-step-completed .wpf-step-number {
    background: #2271b1;
    color: #fff;
}

.wpf-step-indicator.wpf-step-completed .wpf-step-number {
    background: #0a9b4f;
}

.wpf-step-label {
    font-size: 12px;
    color: #646970;
    text-align: center;
    max-width: 100px;
}

.wpf-step-indicator.wpf-step-active .wpf-step-label {
    color: #1d2327;
    font-weight: 600;
}

.wpf-step-connector {
    width: 60px;
    height: 3px;
    background: #e9ecef;
    margin: 0 10px;
    position: relative;
    top: -18px;
}

.wpf-step-connector.wpf-connector-active {
    background: #2271b1;
}

/* Step Content */
.wpf-form-step {
    animation: wpf-fadeIn 0.3s ease;
}

.wpf-step-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.wpf-step-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 600;
    color: #1d2327;
}

.wpf-step-subtitle {
    margin: 0;
    font-size: 14px;
    color: #646970;
}

/* Multi-step Navigation */
.wpf-prev-button,
.wpf-next-button {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.wpf-prev-button {
    background: #f0f0f1;
    color: #1d2327;
    border: 1px solid #c3c4c7;
}

.wpf-prev-button:hover {
    background: #e9ecef;
    border-color: #8c8f94;
}

.wpf-next-button {
    background: #2271b1;
    color: #fff;
    border: none;
}

.wpf-next-button:hover {
    background: #135e96;
}

.wpf-next-button:disabled,
.wpf-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* =====================================================
   PowerTranz Card Fields
   ===================================================== */
.wpf-powertranz-fields {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

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

.wpf-card-row .wpf-field-half {
    flex: 1;
}

.wpf-powertranz-fields .wpf-field {
    margin-bottom: 15px;
}

.wpf-powertranz-fields .wpf-field:last-child {
    margin-bottom: 0;
}

/* Card number formatting */
.wpf-card-number {
    letter-spacing: 2px;
}

/* Card type icons */
.wpf-card-icons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.wpf-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wpf-card-icon svg {
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Card field validation states */
.wpf-card-number.wpf-valid,
.wpf-card-expiry.wpf-valid,
input[type="email"].wpf-valid {
    border-color: #28a745 !important;
    background-color: #f8fff9;
}

.wpf-card-number.wpf-invalid,
.wpf-card-expiry.wpf-invalid,
input[type="email"].wpf-invalid {
    border-color: #dc3545 !important;
    background-color: #fff8f8;
}

/* Inline field error message */
span.wpf-field-error {
    display: block;
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.4;
}

/* Helper text for amount input */
.wpf-amount-help {
    color: #646970;
    font-size: 13px;
    margin: 8px 0 0;
    line-height: 1.5;
}

/* Inline confirmation shown when amount becomes valid */
.wpf-inline-confirmation {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0c5422;
    background-color: #f1fcf4;
    border: 1px solid #c3e6cb;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    animation: wpf-slideDown 0.2s ease-out;
}

@keyframes wpf-slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.wpf-card-expiry {
    width: 100%;
}

.wpf-card-cvv {
    width: 100%;
}

@media (max-width: 480px) {
    .wpf-card-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .wpf-card-row .wpf-field-half {
        width: 100%;
    }
    
    .wpf-step-indicators {
        flex-wrap: wrap;
    }
    
    .wpf-step-connector {
        display: none;
    }
}

/* =====================================================
   Payment Summary & Checkout Styles
   ===================================================== */

/* Section Title */
.wpf-section-title {
    margin: 0 0 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
    text-align: center;
}

/* Summary Box */
.wpf-summary-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #dcdcde;
}

.wpf-payment-disclaimer {
    font-size: 13px;
    color: #50575e;
    background: #f8f9fb;
    border: 1px dashed #c3c4c7;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 12px;
}

.wpf-payment-disclaimer p:last-child {
    margin-bottom: 0;
}

.wpf-payment-disclaimer-compact {
    margin-top: 14px;
}

.wpf-summary-compact {
    padding: 20px;
    margin-bottom: 20px;
}

.wpf-invoice-group {
    margin: 0 0 24px;
    padding: 18px;
    border: 1px solid #dcdcde;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%);
}

.wpf-invoice-group-header {
    margin-bottom: 14px;
}

.wpf-invoice-group-title {
    display: inline-block;
    font-size: 15px;
    font-weight: 700;
    color: #1d2327;
}

.wpf-invoice-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wpf-invoice-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e2e4e7;
    border-radius: 10px;
    background: #fff;
}

.wpf-invoice-row .wpf-field {
    margin-bottom: 0;
    flex: 1 1 240px;
}

.wpf-invoice-remove-row {
    flex: 0 0 auto;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d63638;
    border-radius: 8px;
    background: #fff5f5;
    color: #b42318;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.wpf-invoice-remove-row:hover {
    background: #fee4e2;
}

.wpf-invoice-add-row {
    margin-top: 14px;
}

.wpf-invoice-summary-list {
    margin-bottom: 16px;
    border: 1px solid #dcdcde;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.wpf-invoice-summary-list-compact {
    margin-bottom: 14px;
}

.wpf-invoice-summary-header {
    padding: 12px 16px;
    background: #f6f7f7;
    border-bottom: 1px solid #e2e4e7;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #50575e;
}

.wpf-invoice-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f1;
}

.wpf-invoice-summary-row:last-child {
    border-bottom: none;
}

.wpf-invoice-summary-label {
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.wpf-invoice-summary-value {
    font-size: 14px;
    font-weight: 700;
    color: #2271b1;
    white-space: nowrap;
}

.wpf-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.wpf-summary-row:last-child {
    border-bottom: none;
}

.wpf-summary-label {
    font-size: 15px;
    color: #50575e;
}

.wpf-summary-value {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.wpf-summary-total {
    padding-top: 18px;
    margin-top: 8px;
    border-top: 2px solid #2271b1;
    border-bottom: none !important;
}

.wpf-summary-total .wpf-summary-label {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.wpf-summary-total .wpf-summary-value,
.wpf-total-value {
    font-size: 24px;
    font-weight: 700;
    color: #2271b1;
}

.wpf-summary-service-charge .wpf-summary-label {
    font-size: 13px;
    color: #757575;
    font-style: italic;
}

.wpf-summary-service-charge .wpf-summary-value {
    font-size: 16px;
    color: #757575;
}

/* Summary Actions */
.wpf-summary-actions {
    display: flex;
    gap: 15px;
    justify-content: space-between;
}

.wpf-summary-actions .button {
    flex: 1;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.wpf-back-to-form,
.wpf-back-to-summary {
    background: #f0f0f1;
    color: #1d2327;
    border: 1px solid #c3c4c7;
}

.wpf-back-to-form:hover,
.wpf-back-to-summary:hover {
    background: #e5e5e5;
    border-color: #8c8f94;
}

.wpf-proceed-to-payment {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    border: none;
}

.wpf-proceed-to-payment:hover {
    background: linear-gradient(135deg, #135e96 0%, #0a4570 100%);
    color: #fff;
}

/* Checkout Actions */
.wpf-checkout-actions {
    margin-top: 20px;
}

.wpf-checkout-actions .button {
    padding: 12px 25px;
    font-size: 14px;
    border-radius: 4px;
}

/* Card Details Section */
.wpf-checkout-card-fields {
    margin-top: 25px;
}

.wpf-checkout-card-fields .wpf-field {
    margin-bottom: 18px;
}

.wpf-checkout-card-fields .wpf-field:last-child {
    margin-bottom: 0;
}

.wpf-checkout-card-fields label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
}

.wpf-checkout-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #dcdcde;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

.wpf-checkout-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
    outline: none;
}

.wpf-checkout-input:invalid:not(:placeholder-shown) {
    border-color: #d63638;
}

/* Card Icons */
.wpf-card-icons {
    display: inline-flex;
    gap: 5px;
    margin-left: auto;
    font-size: 20px;
}

.wpf-card-icon {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.wpf-card-icon.active {
    opacity: 1;
}

/* Checkout Card Row */
.wpf-checkout-card-fields .wpf-card-row {
    display: flex;
    gap: 15px;
}

.wpf-checkout-card-fields .wpf-card-row .wpf-field-half {
    flex: 1;
}

/* Form Section transitions */
.wpf-form-section,
.wpf-checkout-section {
    animation: wpf-fadeIn 0.3s ease;
}

/* Responsive checkout */
@media (max-width: 600px) {
    .wpf-invoice-row {
        flex-direction: column;
        align-items: stretch;
    }

    .wpf-invoice-remove-row {
        width: 100%;
    }

    .wpf-invoice-summary-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .wpf-summary-actions {
        flex-direction: column;
    }
    
    .wpf-summary-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .wpf-summary-value {
        align-self: flex-end;
    }
    
    .wpf-checkout-card-fields .wpf-card-row {
        flex-direction: column;
    }
    
    .wpf-checkout-card-fields .wpf-card-row .wpf-field-half {
        width: 100%;
    }
}

/* reCAPTCHA Widget */
.wpf-recaptcha-wrapper {
    margin: 20px 0;
    display: flex;
    justify-content: flex-start;
}

.wpf-recaptcha-wrapper .g-recaptcha {
    transform-origin: left top;
}

@media (max-width: 400px) {
    .wpf-recaptcha-wrapper .g-recaptcha {
        transform: scale(0.9);
        transform-origin: left top;
    }
}

/* Card Type Detection */
.wpf-card-icon {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.wpf-card-icon.wpf-card-dimmed {
    opacity: 0.3;
}

.wpf-card-icon.wpf-card-detected {
    opacity: 1;
    transform: scale(1.15);
}

/* Better Loading States */
.wpf-form-loading .wpf-submit-button {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.wpf-form-loading .wpf-submit-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wpf-button-spin 0.8s linear infinite;
}

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

.wpf-form-loading .wpf-submit-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Processing message */
.wpf-form-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 100;
    pointer-events: all;
}

.wpf-payment-form {
    position: relative;
}

/* ==========================================================================
   3DS2 Authentication Modal
   ========================================================================== */

.wpf-3ds-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpf-3ds-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.wpf-3ds-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 650px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    animation: wpf-3ds-slide-in 0.3s ease-out;
}

@keyframes wpf-3ds-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wpf-3ds-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    text-align: center;
}

.wpf-3ds-header h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.wpf-3ds-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    color: #fff;
}

.wpf-3ds-content {
    position: relative;
    min-height: 450px;
    background: #f8f9fa;
}

.wpf-3ds-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.wpf-3ds-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #2271b1;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: wpf-3ds-spin 1s linear infinite;
}

@keyframes wpf-3ds-spin {
    to {
        transform: rotate(360deg);
    }
}

.wpf-3ds-loading p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.wpf-3ds-iframe {
    display: none;
    width: 100%;
    height: 450px;
    border: none;
    background: #fff;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .wpf-3ds-container {
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }

    .wpf-3ds-content {
        min-height: calc(100vh - 100px);
    }

    .wpf-3ds-iframe {
        height: calc(100vh - 100px);
    }
}

/* PowerTranz challenge window sizes (ChallengeWindowSize parameter) */
/* Size 4 = 600x400 - default */
.wpf-3ds-iframe {
    min-height: 400px;
}

/* Receipt (Success Page) */
.wpf-receipt-table {
    width: 100%;
}

.wpf-receipt-table td {
    text-align: left !important;
    vertical-align: top !important;
}

.wpf-receipt-table .wpf-receipt-label {
    text-align: left !important;
}

.wpf-receipt-table .wpf-receipt-value {
    text-align: left !important;
}

@media (min-width: 768px) {
    .wpf-receipt-table .wpf-receipt-label {
        width: 260px;
        white-space: nowrap;
    }
}
