/**
 * SyncPay Payment Gateway Styles
 * Based on BytePress CSS architecture with syncpay- prefix
 */

:root {
  --syncpay-primary-color: #0570de;
  --syncpay-primary-hover: #0b81fa;
  --syncpay-primary-active: #228cfa;
  --syncpay-background: #fff;
  --syncpay-text-color: #30313d;
  --syncpay-text-secondary: #6d6e78;
  --syncpay-text-placeholder: #757680;
  --syncpay-border-color: #bdbdbd;
  --syncpay-border-focus: rgba(5, 115, 225, 0.5);
  --syncpay-error-color: #df1b41;
  --syncpay-success-color: #30b130;
  --syncpay-warning-color: #f6e6b9;
  --syncpay-shadow: 0px 1px 1px rgba(0,0,0,0.03), 0px 3px 6px rgba(0,0,0,0.02);
  --syncpay-shadow-focus: 0px 1px 1px rgba(0,0,0,0.03), 0px 3px 6px rgba(0,0,0,0.02), 0 0 0 3px rgba(5,115,225,0.25);
  --syncpay-border-radius: 5px;
  --syncpay-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --syncpay-font-size: 16px;
  --syncpay-font-size-sm: 14px;
  --syncpay-spacing-xs: 4px;
  --syncpay-spacing-sm: 8px;
  --syncpay-spacing: 12px;
  --syncpay-spacing-lg: 16px;
  --syncpay-spacing-xl: 24px;
}

.syncpay-payment-form, .syncpay-payment-form *,
.syncpay-payment-block, .syncpay-payment-block * {
  box-sizing: border-box;
  font-family: var(--syncpay-font-family);
  -webkit-font-smoothing: antialiased;
}

.syncpay-payment-form, .syncpay-payment-block {
  background: #fff;
  border-radius: 0;
  padding: 16px;
}

.syncpay-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--syncpay-spacing-lg);
}

.syncpay-field-full { grid-column: 1 / -1; }

@media (min-width: 768px) {
  .syncpay-form-grid { grid-template-columns: 1fr 1fr; gap: var(--syncpay-spacing-lg); }
  .syncpay-field-half { grid-column: span 1; }
}

@media (min-width: 768px) {
  body .woocommerce .payment_method_sync_payment .syncpay-form-grid,
  body .wc_payment_methods .payment_method_sync_payment .syncpay-form-grid,
  body form.checkout .payment_method_sync_payment .syncpay-form-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: var(--syncpay-spacing-lg) !important;
  }
}

@media (max-width: 767px) {
  #syncpay-payment-form, .syncpay-payment-form,
  body .woocommerce .syncpay-payment-form,
  body .wc_payment_methods .syncpay-payment-form {
    padding: 0 !important; margin: 0 !important; width: 100% !important; max-width: 100% !important;
  }
  .syncpay-form-grid,
  body .woocommerce .syncpay-form-grid {
    grid-template-columns: 1fr 1fr !important; gap: 8px !important; width: 100% !important;
  }
  .syncpay-field-full { grid-column: 1 / -1 !important; }
  .syncpay-field-half { grid-column: span 1 !important; }
}

body .woocommerce .syncpay-payment-form .syncpay-field,
body .wc_payment_methods .syncpay-payment-form .syncpay-field,
.syncpay-payment-form .syncpay-field {
  position: relative !important;
  margin-bottom: 16px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: block !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
}

.syncpay-field:last-child { margin-bottom: 0; }

.syncpay-label {
  display: block;
  margin-bottom: var(--syncpay-spacing-xs);
  font-size: var(--syncpay-font-size-sm);
  font-weight: 500;
  color: var(--syncpay-text-color);
  line-height: 1.3;
}

.syncpay-label .required { color: var(--syncpay-error-color); margin-left: 2px; }

body .woocommerce .syncpay-payment-form .syncpay-input-wrapper,
body .wc_payment_methods .syncpay-payment-form .syncpay-input-wrapper,
.syncpay-payment-form .syncpay-input-wrapper {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  flex-wrap: nowrap !important;
}

body .woocommerce .syncpay-payment-form .syncpay-field .syncpay-input,
body .woocommerce .syncpay-payment-form input.syncpay-input,
body .woocommerce input#syncpay-card-number,
body .woocommerce input#syncpay-card-expiry,
body .woocommerce input#syncpay-card-cvc,
body .wc_payment_methods .syncpay-payment-form .syncpay-field .syncpay-input,
body .wc_payment_methods .syncpay-payment-form input.syncpay-input,
body .wc_payment_methods input#syncpay-card-number,
body .wc_payment_methods input#syncpay-card-expiry,
body .wc_payment_methods input#syncpay-card-cvc,
.syncpay-payment-form .syncpay-field .syncpay-input,
.syncpay-payment-form input.syncpay-input,
input#syncpay-card-number,
input#syncpay-card-expiry,
input#syncpay-card-cvc {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding: 12px !important;
  font-size: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  color: #30313d !important;
  background: #fff !important;
  border: 1px solid #bdbdbd !important;
  border-radius: 5px !important;
  box-shadow: 0px 1px 1px rgba(0,0,0,0.03), 0px 3px 6px rgba(0,0,0,0.02) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  height: auto !important;
  line-height: normal !important;
  flex: 1 !important;
  display: block !important;
}

.syncpay-payment-form input.syncpay-input::placeholder,
input#syncpay-card-number::placeholder,
input#syncpay-card-expiry::placeholder,
input#syncpay-card-cvc::placeholder {
  color: var(--syncpay-text-placeholder) !important;
  opacity: 1 !important;
}

.syncpay-payment-form .syncpay-field .syncpay-input:focus,
.syncpay-payment-form input.syncpay-input:focus,
input#syncpay-card-number:focus,
input#syncpay-card-expiry:focus,
input#syncpay-card-cvc:focus {
  border-color: rgba(5,115,225,0.5) !important;
  box-shadow: 0px 1px 1px rgba(0,0,0,0.03), 0px 3px 6px rgba(0,0,0,0.02), 0 0 0 3px rgba(5,115,225,0.25) !important;
}

body .woocommerce .syncpay-payment-form .syncpay-input-wrapper:focus-within .syncpay-input,
body .wc_payment_methods .syncpay-payment-form .syncpay-input-wrapper:focus-within .syncpay-input,
.syncpay-payment-form .syncpay-input-wrapper:focus-within .syncpay-input,
input#syncpay-card-number:focus,
input#syncpay-card-expiry:focus,
input#syncpay-card-cvc:focus {
  border-color: rgba(5,115,225,0.5) !important;
  box-shadow: 0px 1px 1px rgba(0,0,0,0.03), 0px 3px 6px rgba(0,0,0,0.02), 0 0 0 3px rgba(5,115,225,0.25) !important;
  outline: none !important;
}

.syncpay-input:disabled { background: #f2f2f2; color: var(--syncpay-text-placeholder); cursor: not-allowed; }
.syncpay-input.error { border-color: var(--syncpay-error-color); box-shadow: 0 0 0 1px var(--syncpay-error-color); }

body .woocommerce .syncpay-field-full .syncpay-input,
body .woocommerce input#syncpay-card-number,
.syncpay-field-full .syncpay-input,
input#syncpay-card-number {
  padding-right: 120px !important;
}

body .woocommerce .syncpay-payment-form .FormFieldInput-Icons,
.syncpay-payment-form .FormFieldInput-Icons {
  position: absolute !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  pointer-events: none !important;
  height: 20px !important;
  width: auto !important;
  z-index: 2 !important;
}

.FormFieldInput-IconsIcon.syncpay-hidden,
.CardFormFieldGroupIconOverflow.syncpay-hidden,
.FormFieldInput-ErrorIcon.syncpay-hidden,
body .woocommerce .syncpay-payment-form .FormFieldInput-IconsIcon.syncpay-hidden,
.syncpay-payment-form .FormFieldInput-IconsIcon.syncpay-hidden,
.syncpay-payment-form .CardFormFieldGroupIconOverflow.syncpay-hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

body .woocommerce .syncpay-payment-form .FormFieldInput-IconsIcon,
.syncpay-payment-form .FormFieldInput-IconsIcon {
  display: flex !important;
  align-items: center !important;
  opacity: 1 !important;
  transition: opacity 0.2s ease !important;
  height: 20px !important;
  max-width: 32px !important;
  min-width: 20px !important;
}

body .woocommerce .syncpay-payment-form .BrandIcon,
.syncpay-payment-form .BrandIcon,
.FormFieldInput-Icons .BrandIcon,
.CardFormFieldGroupIconOverflow .BrandIcon {
  height: 20px !important;
  width: auto !important;
  max-width: 32px !important;
  object-fit: contain !important;
  display: block !important;
  border: none !important;
  background: none !important;
}

body .woocommerce .syncpay-payment-form .CardFormFieldGroupIconOverflow,
.syncpay-payment-form .CardFormFieldGroupIconOverflow {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
}

.CardFormFieldGroupIconOverflow-Item {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.25s ease;
}
.CardFormFieldGroupIconOverflow-Item--invisible { opacity: 0; z-index: 0; }
.CardFormFieldGroupIconOverflow-Item--visible { opacity: 1; z-index: 1; }

.syncpay-payment-form .syncpay-field .syncpay-input.error:not(:focus),
input#syncpay-card-number.error:not(:focus),
input#syncpay-card-expiry.error:not(:focus),
input#syncpay-card-cvc.error:not(:focus) {
  border-color: #dc2727 !important;
  box-shadow: 0 0 0 0.1px #dc2727 !important;
  color: #dc2727 !important;
}

.syncpay-error-message,
.syncpay-payment-form .syncpay-error-message {
  display: block !important;
  margin-top: 8px !important;
  font-size: 12px !important;
  color: #dc2727 !important;
  line-height: 1.4 !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

body .woocommerce .syncpay-cvc-icon,
.syncpay-cvc-icon {
  position: absolute !important;
  right: var(--syncpay-spacing) !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 30px !important;
  height: 20px !important;
  opacity: 0.6 !important;
  pointer-events: none !important;
}

.syncpay-cvc-icon .p-CardCvcIcons-svg {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

.syncpay-errors {
  color: var(--syncpay-error-color);
  font-size: 13px;
  margin-top: 6px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}

.syncpay-field-errors {
  color: var(--syncpay-error-color);
  font-size: 13px;
  margin-top: 6px;
}

.syncpay-input.syncpay-has-error {
  border-color: var(--syncpay-error-color, #e53e3e) !important;
}

/* ==================== Trust Badge ==================== */
.syncpay-trust-badge {
    text-align: center;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.6;
}

/* ==================== Loading State ==================== */
.syncpay-loading {
    position: relative;
    pointer-events: none;
}
.syncpay-loading::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    border-radius: var(--syncpay-border-radius);
}
.syncpay-loading::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 20px; height: 20px;
    border: 2px solid var(--syncpay-border-color);
    border-top-color: var(--syncpay-primary-color);
    border-radius: 50%;
    animation: syncpay-spin 1s linear infinite;
    z-index: 1;
}
@keyframes syncpay-spin {
    to { transform: rotate(360deg); }
}

/* ==================== Fade-in Animation ==================== */
.syncpay-field {
    animation: syncpay-fade-in 0.3s ease-out;
}
@keyframes syncpay-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== Focus-visible Accessibility ==================== */
.syncpay-input:focus-visible {
    outline: 2px solid var(--syncpay-primary-color);
    outline-offset: 2px;
}

/* ==================== Dark Mode (Force White Background) ==================== */
@media (prefers-color-scheme: dark) {
    .syncpay-payment-form,
    .syncpay-payment-block {
        background: #fff !important;
        color: #30313d !important;
    }
    .syncpay-payment-form .syncpay-field .syncpay-input,
    .syncpay-payment-form input.syncpay-input,
    .checkout input#syncpay-card-number,
    .checkout input#syncpay-card-expiry,
    .checkout input#syncpay-card-cvc {
        background: #fff !important;
        color: #30313d !important;
        border: 1px solid #bdbdbd !important;
    }
    .syncpay-payment-form .syncpay-label,
    .syncpay-label {
        color: #30313d !important;
    }
    .syncpay-payment-form input.syncpay-input::placeholder,
    input#syncpay-card-number::placeholder,
    input#syncpay-card-expiry::placeholder,
    input#syncpay-card-cvc::placeholder {
        color: #757680 !important;
    }
    .syncpay-cvc-icon svg {
        filter: none !important;
    }
}

/* ==================== High Contrast Mode ==================== */
@media (prefers-contrast: high) {
    .syncpay-input {
        border-width: 2px;
    }
    .syncpay-input:focus {
        border-width: 3px;
    }
}

/* ==================== RTL Layout Support ==================== */
[dir="rtl"] .syncpay-label .required,
html[dir="rtl"] .syncpay-label .required,
body[dir="rtl"] .syncpay-label .required,
.rtl .syncpay-label .required {
    margin-left: 0 !important;
    margin-right: 2px !important;
}

[dir="rtl"] body .woocommerce .syncpay-field-full .syncpay-input,
[dir="rtl"] .syncpay-field-full .syncpay-input,
[dir="rtl"] input#syncpay-card-number,
html[dir="rtl"] input#syncpay-card-number,
body[dir="rtl"] input#syncpay-card-number,
.rtl input#syncpay-card-number {
    padding-right: 12px !important;
    padding-left: 120px !important;
}

[dir="rtl"] .syncpay-payment-form .FormFieldInput-Icons,
html[dir="rtl"] .syncpay-payment-form .FormFieldInput-Icons,
body[dir="rtl"] .syncpay-payment-form .FormFieldInput-Icons,
.rtl .syncpay-payment-form .FormFieldInput-Icons {
    right: auto !important;
    left: 12px !important;
}

[dir="rtl"] .syncpay-cvc-icon,
html[dir="rtl"] .syncpay-cvc-icon,
body[dir="rtl"] .syncpay-cvc-icon,
.rtl .syncpay-cvc-icon {
    right: auto !important;
    left: var(--syncpay-spacing) !important;
}

[dir="rtl"] body .woocommerce input#syncpay-card-number,
[dir="rtl"] body input#syncpay-card-number,
html[dir="rtl"] body input#syncpay-card-number,
body[dir="rtl"] input#syncpay-card-number,
.rtl input#syncpay-card-number,
[dir="rtl"] body .woocommerce input#syncpay-card-expiry,
[dir="rtl"] body input#syncpay-card-expiry,
[dir="rtl"] body .woocommerce input#syncpay-card-cvc,
[dir="rtl"] body input#syncpay-card-cvc {
    text-align: right !important;
    direction: ltr !important;
}

/* ==================== Stripe Logo Positioning ==================== */
.wc_payment_method.payment_method_sync_payment {
    position: relative !important;
}
.wc_payment_method.payment_method_sync_payment label img,
li.payment_method_sync_payment label img {
    float: right !important;
    max-height: 22px !important;
    width: auto !important;
    vertical-align: middle !important;
}
[dir="rtl"] .wc_payment_method.payment_method_sync_payment label img,
[dir="rtl"] li.payment_method_sync_payment label img {
    float: left !important;
}
.payment_method_sync_payment .payment_method_icons,
.payment_method_sync_payment .payment-title-icon {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    min-width: auto !important;
}

/* ==================== Theme Compatibility - Base Reset ==================== */
.syncpay-payment-form *,
.syncpay-payment-form *:before,
.syncpay-payment-form *:after {
    box-sizing: border-box !important;
}

.FormFieldInput-Icons img,
.CardFormFieldGroupIconOverflow img,
.syncpay-cvc-icon svg {
    vertical-align: middle !important;
    border: none !important;
    box-shadow: none !important;
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.syncpay-form-grid .syncpay-field-full,
.syncpay-form-grid .syncpay-field-half {
    margin: 0 !important;
    margin-bottom: var(--syncpay-spacing-lg) !important;
}

body.woocommerce .woocommerce .syncpay-payment-form,
body.woocommerce-page .woocommerce .syncpay-payment-form,
body .woocommerce-checkout .syncpay-payment-form,
body .checkout .syncpay-payment-form {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 16px !important;
    box-sizing: border-box !important;
}

body .woocommerce input#syncpay-card-number,
body .woocommerce input#syncpay-card-expiry,
body .woocommerce input#syncpay-card-cvc,
body input#syncpay-card-number,
body input#syncpay-card-expiry,
body input#syncpay-card-cvc {
    font-weight: normal !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
    text-align: left !important;
    direction: ltr !important;
}

/* ==================== Super-strong Input Overrides ==================== */
html body .woocommerce .woocommerce-checkout .syncpay-payment-form input,
html body .woocommerce .wc_payment_methods .syncpay-payment-form input,
html body form.checkout input#syncpay-card-number,
html body form.checkout input#syncpay-card-expiry,
html body form.checkout input#syncpay-card-cvc,
html body input[name="syncpay_card_number"],
html body input[name="syncpay_card_expiry"],
html body input[name="syncpay_card_cvc"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: block !important;
    position: static !important;
    float: none !important;
    clear: none !important;
    overflow: visible !important;
    flex: 1 1 auto !important;
    border: 1px solid #bdbdbd !important;
    border-radius: 5px !important;
    font-size: 16px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif !important;
    background: #fff !important;
    color: #30313d !important;
}

html body .woocommerce .syncpay-payment-form .syncpay-field,
html body .wc_payment_methods .syncpay-payment-form .syncpay-field,
html body form.checkout .syncpay-payment-form .syncpay-field,
html body .syncpay-payment-form .syncpay-field {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block !important;
    float: none !important;
    position: static !important;
    margin: 0 0 16px 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    transform: none !important;
}

html body .woocommerce .syncpay-payment-form .syncpay-input-wrapper,
html body .wc_payment_methods .syncpay-payment-form .syncpay-input-wrapper,
html body form.checkout .syncpay-payment-form .syncpay-input-wrapper,
html body .syncpay-payment-form .syncpay-input-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    position: relative !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
}

html body .woocommerce input#syncpay-card-number,
html body form.checkout input#syncpay-card-number,
html body input[name="syncpay_card_number"] {
    padding-right: 120px !important;
}

[dir="rtl"] html body input#syncpay-card-number,
html[dir="rtl"] body input#syncpay-card-number,
body[dir="rtl"] input#syncpay-card-number,
.rtl input#syncpay-card-number,
[dir="rtl"] html body input[name="syncpay_card_number"] {
    padding-right: 12px !important;
    padding-left: 120px !important;
}

/* ==================== Error State Strong Overrides ==================== */
body .woocommerce input#syncpay-card-number.error,
body .woocommerce input#syncpay-card-expiry.error,
body .woocommerce input#syncpay-card-cvc.error,
body input#syncpay-card-number.error,
body input#syncpay-card-expiry.error,
body input#syncpay-card-cvc.error {
    border-color: #dc2727 !important;
    box-shadow: 0 0 0 1px #dc2727 !important;
}

/* ==================== Error Message Strong Overrides ==================== */
.syncpay-error-message,
body .syncpay-error-message,
.syncpay-payment-form .syncpay-error-message,
.wfacp_main_form .syncpay-error-message,
body .wfacp_main_form .syncpay-error-message,
.wfacp-form .syncpay-error-message {
    display: block !important;
    margin-top: 8px !important;
    font-size: 12px !important;
    color: #dc2727 !important;
    line-height: 1.4 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.syncpay-input-error,
input#syncpay-card-number.syncpay-input-error,
input#syncpay-card-expiry.syncpay-input-error,
input#syncpay-card-cvc.syncpay-input-error {
    border-color: var(--syncpay-error-color) !important;
    box-shadow: 0 0 0 1px var(--syncpay-error-color) !important;
}

.syncpay-field-error {
    color: var(--syncpay-error-color);
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.4;
}


.syncpay-field .syncpay-error-message {
    display: block !important;
}

/* ==================== Description Styles ==================== */
.wc_payment_method.payment_method_sync_payment .payment_box p {
    margin: 0 0 20px 0;
    padding: 0;
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
}
.syncpay-description {
    margin: 0 0 16px 0 !important;
    font-size: 14px !important;
    color: #666 !important;
}

/* ==================== CheckoutWC / FunnelKit Compatibility ==================== */
.cfw-accordion .cfw-radio-reveal-content,
body .cfw .cfw-radio-reveal-content,
body.checkoutwc .cfw-radio-reveal-content {
    box-shadow: none !important;
}

body .woocommerce .payment_method_sync_payment .syncpay-payment-form,
body .wc_payment_methods .payment_method_sync_payment .syncpay-payment-form,
body form.checkout .payment_method_sync_payment .syncpay-payment-form,
body .cfw .payment_method_sync_payment .syncpay-payment-form,
body .cfw-payment-method .syncpay-payment-form,
body.checkoutwc .payment_method_sync_payment .syncpay-payment-form,
.wfacp_main_form .payment_method_sync_payment .syncpay-payment-form,
.wfacp-form .payment_method_sync_payment .syncpay-payment-form {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

body .cfw .syncpay-payment-form .syncpay-field:focus-within .syncpay-input,
body .cfw-payment-method .syncpay-field:focus-within .syncpay-input {
    border-color: rgba(5,115,225,0.5) !important;
    box-shadow: 0px 1px 1px rgba(0,0,0,0.03), 0px 3px 6px rgba(0,0,0,0.02), 0 0 0 3px rgba(5,115,225,0.25) !important;
    outline: none !important;
}

/* ==================== Grid Strong Overrides (All Themes) ==================== */
body .woocommerce .syncpay-form-grid,
body .syncpay-form-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    width: 100% !important;
}

@media (min-width: 768px) {
    body .woocommerce .syncpay-form-grid,
    body .syncpay-form-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    body .woocommerce .syncpay-field-full,
    body .syncpay-field-full {
        grid-column: 1 / -1 !important;
    }
}

@media (min-width: 768px) {
    body .woocommerce .payment_method_sync_payment .syncpay-form-grid,
    body .wc_payment_methods .payment_method_sync_payment .syncpay-form-grid,
    body form.checkout .payment_method_sync_payment .syncpay-form-grid,
    body .cfw .payment_method_sync_payment .syncpay-form-grid,
    body .cfw-payment-method .syncpay-form-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: var(--syncpay-spacing-lg) !important;
    }
    body .woocommerce .payment_method_sync_payment .syncpay-field-half,
    body .wc_payment_methods .payment_method_sync_payment .syncpay-field-half,
    body form.checkout .payment_method_sync_payment .syncpay-field-half,
    body .cfw .payment_method_sync_payment .syncpay-field-half,
    body .cfw-payment-method .syncpay-field-half {
        grid-column: span 1 !important;
        width: 100% !important;
    }
}

@media (max-width: 767px) {
    body .woocommerce .payment_method_sync_payment .syncpay-form-grid,
    body .wc_payment_methods .payment_method_sync_payment .syncpay-form-grid,
    body form.checkout .payment_method_sync_payment .syncpay-form-grid,
    body .cfw .payment_method_sync_payment .syncpay-form-grid,
    body .cfw-payment-method .syncpay-form-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    body .woocommerce .payment_method_sync_payment .syncpay-field-full,
    body .wc_payment_methods .payment_method_sync_payment .syncpay-field-full,
    body form.checkout .payment_method_sync_payment .syncpay-field-full,
    body .cfw .payment_method_sync_payment .syncpay-field-full,
    body .cfw-payment-method .syncpay-field-full {
        grid-column: 1 / -1 !important;
    }
    body .woocommerce .payment_method_sync_payment .syncpay-field-half,
    body .wc_payment_methods .payment_method_sync_payment .syncpay-field-half,
    body form.checkout .payment_method_sync_payment .syncpay-field-half,
    body .cfw .payment_method_sync_payment .syncpay-field-half,
    body .cfw-payment-method .syncpay-field-half {
        grid-column: span 1 !important;
    }
}

/* ==================== Focus-within for CFW ==================== */
body .cfw .syncpay-payment-form .syncpay-input-wrapper:focus-within .syncpay-input,
body .cfw-payment-method .syncpay-input-wrapper:focus-within .syncpay-input,
body.checkoutwc .syncpay-payment-form .syncpay-input-wrapper:focus-within .syncpay-input {
    border-color: rgba(5,115,225,0.5) !important;
    box-shadow: 0px 1px 1px rgba(0,0,0,0.03), 0px 3px 6px rgba(0,0,0,0.02), 0 0 0 3px rgba(5,115,225,0.25) !important;
}

/* ==================== Responsive 480px ==================== */
@media (max-width: 480px) {
    .syncpay-payment-form,
    .syncpay-payment-block {
        padding: 12px;
        margin: 0;
    }
    .syncpay-form-grid {
        gap: var(--syncpay-spacing);
    }
    .syncpay-input {
        font-size: 16px;
    }
}

/* ==================== 3DS Modal System ==================== */
.syncpay-3ds-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: syncpay-fade-in 0.2s ease-out;
}

.syncpay-3ds-dialog {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 440px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: syncpay-modal-slide-in 0.3s ease-out;
    position: relative;
}

@keyframes syncpay-modal-slide-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.syncpay-3ds-header{
    display:flex;
    border-bottom: 1px solid #C5C5C5;
    padding-bottom: 10px;
    padding-right: 24px;
    overflow: hidden;
    box-sizing: border-box;
}

.syncpay-3ds-bank-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    margin-left: 24px;
}

.syncpay-3ds-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 1;
    margin-left: auto;
    margin-right: 0;
    overflow: hidden;
    max-width: 150px;
}

.syncpay-3ds-brand-label {
    font-size: 14px;
    font-weight: 600;
}

.syncpay-3ds-form {
    text-align: left;
}

.syncpay-3ds-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px;
}

.syncpay-3ds-description {
    font-size: 13px;
    color: #333;
    line-height: 1.7;
    margin: 0 0 12px;
}

.syncpay-3ds-tx-info {
    font-size: 13px;
    color: #333;
    line-height: 1.7;
    margin: 0 0 20px;
}

.syncpay-3ds-tx-info strong {
    color: #1a1a2e;
    font-weight: 600;
}

.syncpay-3ds-input-group {
    margin-bottom: 16px;
}

.syncpay-3ds-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.syncpay-3ds-verify-btn {
    background: #0570de;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
}

.syncpay-3ds-resend {
    display: block;
    text-align: center;
    color: #0570de;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 16px;
    cursor: pointer;
}

.syncpay-3ds-resend:hover {
    text-decoration: underline;
}

.syncpay-otp-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 328px;
    margin: 0 auto;
}

.syncpay-otp-actions .syncpay-verify-btn {
    width: auto;
    margin-bottom: 12px;
}

.syncpay-otp-actions .syncpay-3ds-resend {
    text-align: center;
    padding: 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    box-sizing: border-box;
    margin-bottom: 16px;
    transition: border-color 0.2s, background 0.2s;
}

.syncpay-otp-actions .syncpay-3ds-resend:hover {
    border-color: #0570de;
    background: #f0f7ff;
    text-decoration: none;
}

.syncpay-3ds-error-text {
    font-size: 13px;
    color: #dc2727;
    line-height: 1.6;
    margin: 0 0 12px;
    font-weight: 500;
}

.syncpay-3ds-bank-notice {
    color: #dc2727;
    font-weight: 500;
}

.syncpay-3ds-progress-oval {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 20px auto 8px;
    padding: 10px 24px;
    border: 1.5px solid #d1d5db;
    border-radius: 50px;
    width: fit-content;
}

.syncpay-3ds-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0 8px;
}

.syncpay-3ds-progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d1d5db;
    transition: background 0.3s;
}

.syncpay-3ds-progress-dot.syncpay-3ds-progress-active {
    animation: syncpay-dot-sequence 2s ease-in-out infinite;
}

.syncpay-3ds-progress-oval .syncpay-3ds-progress-dot.syncpay-3ds-progress-active:nth-child(1) {
    animation-delay: 0s;
}

.syncpay-3ds-progress-oval .syncpay-3ds-progress-dot.syncpay-3ds-progress-active:nth-child(2) {
    animation-delay: 0.5s;
}

.syncpay-3ds-progress-oval .syncpay-3ds-progress-dot.syncpay-3ds-progress-active:nth-child(3) {
    animation-delay: 1.0s;
}

.syncpay-3ds-progress-oval .syncpay-3ds-progress-dot.syncpay-3ds-progress-active:nth-child(4) {
    animation-delay: 1.5s;
}

.syncpay-3ds-progress-dot.syncpay-3ds-progress-fail {
    background: #dc2727;
}

@keyframes syncpay-dot-sequence {
    0%, 25%, 100% {
        background: #d1d5db;
    }
    8%, 17% {
        background: #22c55e;
    }
}

.syncpay-3ds-bank-details {
    width: 328px;
    margin: 16px auto 20px;
    padding: 0;
}

.syncpay-3ds-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    color: #555;
}

.syncpay-3ds-detail-label {
    font-weight: 500;
    color: #333;
}

.syncpay-3ds-detail-value {
    font-weight: 600;
    color: #1a1a2e;
}

.syncpay-3ds-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0 8px;
}

.syncpay-3ds-progress-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #d1d5db;
    transition: background 0.3s;
}

.syncpay-3ds-progress-dot.syncpay-3ds-progress-active {
    background: #22c55e;
    animation: syncpay-dot-bounce 1.4s ease-in-out infinite;
}

.syncpay-3ds-progress-dot.syncpay-3ds-progress-active:nth-child(2) {
    animation-delay: 0.2s;
}

.syncpay-3ds-progress-dot.syncpay-3ds-progress-active:nth-child(3) {
    animation-delay: 0.4s;
}

.syncpay-3ds-progress-dot.syncpay-3ds-progress-fail {
    background: #dc2727;
}

@keyframes syncpay-dot-bounce {
    0%, 80%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}

.syncpay-3ds-pin-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 16px;
    color: #1a1a2e;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.syncpay-3ds-single-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 16px;
    color: #1a1a2e;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.syncpay-3ds-single-input:focus {
    border-color: #0570de;
    box-shadow: 0 0 0 3px rgba(5, 112, 222, 0.15);
}

.syncpay-3ds-single-input::placeholder {
    color: #9ca3af;
}

.syncpay-3ds-help-section {
    border-top: 1px solid #e8e8e8;

    border-top: 0;
    padding-top: 14px;
}


.syncpay-3ds-help-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;

    border-bottom: 0;
    padding: 0;
    margin-bottom: 10px;
}

.syncpay-3ds-help-item:last-child {
    border-bottom: none;
}

.syncpay-3ds-help-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.syncpay-3ds-help-toggle {
    font-size: 20px;
    color: #999;
    font-weight: 300;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9d9d9;
    border-radius: 50%;

    border:0;
    color: #333;
}

.syncpay-3ds-logo {
    flex-shrink: 0;
}

.syncpay-3ds-merchant-name {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.syncpay-3ds-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.syncpay-3ds-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.syncpay-3ds-body {
    padding: 24px;
    min-height: 380px;
}

.syncpay-3ds-footer {
    padding: 0 24px 20px;
    border-top: 1px solid #C5C5C5;
    margin-top: 65px;
}

/* ==================== Verification Form ==================== */
.syncpay-verify-form {
    text-align: center;
}

.syncpay-verify-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
}

.syncpay-verify-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ==================== OTP / PIN Digit Inputs ==================== */
.syncpay-otp-group {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.syncpay-pin-group {
    gap: 12px;
}

.syncpay-otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #1a1a2e;
    background: #fff;
    padding: 0;
}

.syncpay-otp-digit:focus {
    border-color: #0570de;
    box-shadow: 0 0 0 3px rgba(5, 112, 222, 0.15);
}

.syncpay-otp-digit.filled {
    border-color: #0570de;
    background: #f0f7ff;
}

.syncpay-otp-digit.error,
.syncpay-pin-digit.error {
    border-color: #dc2727;
    background: #fef2f2;
}

.syncpay-pin-digit {
    width: 56px;
    height: 64px;
    font-size: 28px;
}

/* ==================== Verify Buttons ==================== */
.syncpay-verify-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 12px;
}

.syncpay-verify-btn-primary {
    background: #0570de;
    color: #fff;
}
.syncpay-verify-btn-primary:hover {
    background: #0b81fa;
}
.syncpay-verify-btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

/* ==================== Verify Error/Status ==================== */
.syncpay-verify-error {
    color: #dc2727;
    font-size: 13px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 6px;
}

.syncpay-verify-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
}

.syncpay-status-checking {
    background: #eff6ff;
    color: #1e40af;
}

.syncpay-status-success {
    background: #f0fdf4;
    color: #166534;
}

.syncpay-status-error {
    background: #fef2f2;
    color: #991b1b;
}

.syncpay-status-success .syncpay-spinner,
.syncpay-status-error .syncpay-spinner {
    display: none;
}

.syncpay-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #93c5fd;
    border-top-color: #0570de;
    border-radius: 50%;
    animation: syncpay-spin 0.8s linear infinite;
}

.syncpay-loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.syncpay-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #0570de;
    border-radius: 50%;
    animation: syncpay-spin 0.8s linear infinite;
}

/* ==================== Bank App Animation ==================== */
.syncpay-bank-app-form {
    padding: 20px 0;
}

.syncpay-bank-app-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.syncpay-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #0570de;
    animation: syncpay-pulse 2s ease-out infinite;
}

.syncpay-pulse-delay {
    animation-delay: 1s;
}

@keyframes syncpay-pulse {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.syncpay-bank-icon {
    position: relative;
    z-index: 1;
}

.syncpay-bank-timer {
    font-size: 32px;
    font-weight: 700;
    color: #0570de;
    text-align: center;
    margin-bottom: 16px;
}

/* ==================== Reject Form ==================== */
.syncpay-reject-form {
    padding: 20px 0;
}

.syncpay-reject-icon {
    margin-bottom: 16px;
}

.syncpay-reject-title {
    color: #dc2727;
}

/* ==================== Secure Badge in Modal ==================== */
.syncpay-3ds-secure-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    padding-top: 8px;
}

/* ==================== Modal Responsive ==================== */
@media (max-width: 480px) {
    .syncpay-3ds-overlay {
        padding: 10px;
    }
    .syncpay-3ds-dialog {
        max-width: 100%;
        border-radius: 12px;
    }
    .syncpay-otp-digit {
        width: 42px;
        height: 48px;
        font-size: 20px;
    }
    .syncpay-pin-digit {
        width: 48px;
        height: 56px;
        font-size: 24px;
    }
    .syncpay-otp-actions {
        width: 292px;
    }
    .syncpay-3ds-bank-details {
        width: 292px;
    }
}

/* ==================== Processing Modal (Place Order Overlay) ==================== */
#syncpay-processing-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
}

.syncpay-processing-dialog {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    position: relative;
    width: 100%;
    max-width: 420px;
    min-height: 340px;
}

@media (max-width: 767px) {
    .syncpay-processing-dialog {
        max-width: 100%;
        width: 100%;
        min-height: 550px;
        border-radius: 12px;
    }
}

.syncpay-processing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 340px;
    padding: 48px 32px 40px;

    justify-content: space-between;
    min-height: 550px;
    padding: 0px 80px 30px;
}

.syncpay-processing-logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 36px;
    margin-bottom: 0;
}

.syncpay-processing-shimmer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.syncpay-processing-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 30%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.3) 70%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: syncpay-shimmer-sweep 2.5s ease-in-out infinite;
    z-index: 2;
    pointer-events: none;
}

@keyframes syncpay-shimmer-sweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.syncpay-processing-card-logo {
    height: 140px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 1;
    filter: none;
}

.syncpay-processing-brand-name {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    margin: 16px 0 0;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.syncpay-processing-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.syncpay-processing-spinner {
    width: 36px;
    height: 36px;
    border: 2.5px solid #e5e7eb;
    border-top-color: #0570de;
    border-radius: 50%;
    animation: syncpay-processing-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes syncpay-processing-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.syncpay-processing-text {
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    text-align: center;
    margin: 0 0 6px;
    line-height: 1.5;
}

.syncpay-processing-subtext {
    font-size: 13px;
    font-weight: 400;
    color: #9ca3af;
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

.syncpay-processing-cancel {
    position: absolute;
    top: -25px;
    right: 0px;
    border: none;
    background: transparent;
    font-size: 12px;
    padding: 6px 12px;
    cursor: pointer;
    color: #CCC;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    transition: color 0.2s;
}

.syncpay-processing-cancel:hover {
    color: #374151;
}

