/* Shared funnel palette. Keep promotional greens, reds and payment brands intact. */
:root {
  --funnel-action: #ffd431;
  --funnel-action-hover: #f2c522;
  --funnel-action-border: #947400;
  /* Neutral selection and focus, distinct from validation and promotion colors. */
  --funnel-selected: #374151;
  --funnel-selected-bg: #f1f3f5;
  --funnel-brand: #162d49;
  --funnel-bg: #f7f8fa;
  --funnel-surface: #fff;
  --funnel-text: #24282d;
  --funnel-muted: #606873;
  --funnel-border: #d5dae0;
  --bs-body-color: var(--funnel-text);
  --bs-body-color-rgb: 36, 40, 45;
  --bs-body-bg: var(--funnel-bg);
  --bs-link-color: var(--funnel-brand);
}
body { background: var(--funnel-bg); color: var(--funnel-text); }
a { color: var(--funnel-brand); }
a:hover { color: var(--funnel-selected); }
.text-muted { color: var(--funnel-muted) !important; }

/* Only brand surfaces: red alert strips and green promotional strips stay as-is. */
body header.bg-white, .topbar, .ty-header, body footer, .ty-footer {
  background: var(--funnel-brand) !important;
  color: var(--funnel-surface);
}
.topbar { border-top-color: var(--funnel-brand); }
body header .text-black, body header a.text-black,
body footer a, body footer p, .footer-copyright {
  color: var(--funnel-surface) !important;
}
.footer-copyright { border-color: rgba(255,255,255,.3); }
.topbar .breadcrumb .breadcrumb-item,
.topbar .breadcrumb .breadcrumb-item.is-complete,
.topbar .breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: #d5dae0; }
.topbar .breadcrumb .breadcrumb-item.is-current { color: var(--funnel-action); }
.checkout-progress span { color: var(--funnel-muted); }
.checkout-progress span.active { color: var(--funnel-selected); }
.main > .bg-info { background: var(--funnel-brand) !important; }
.main > .bg-info .text-tertiary { color: var(--funnel-action) !important; }

/* Primary actions include dynamically generated quote and offer confirmations. */
body .checkoutForm form .checkout-form-submit,
body .btn-upsell, body .btn-take-offer,
body .leavepop_all .container .textContainer button:not(.closeInnerButton),
body .ty-address-save, #quote-review button, #payment-resume button,
.offer-confirmation [data-confirm] {
  background: var(--funnel-action) !important;
  color: var(--funnel-text) !important;
  border-color: var(--funnel-action-border) !important;
  box-shadow: 0 2px 4px rgba(22,45,73,.15);
}
body .checkoutForm form .checkout-form-submit:hover:not(:disabled),
body .btn-upsell:hover:not(:disabled), body .btn-take-offer:hover:not(:disabled),
body .leavepop_all .container .textContainer button:not(.closeInnerButton):hover,
body .ty-address-save:hover:not(:disabled), #quote-review button:hover:not(:disabled),
#payment-resume button:hover:not(:disabled), .offer-confirmation [data-confirm]:hover:not(:disabled) {
  background: var(--funnel-action-hover) !important;
}
.edit-address-button, #cancel-address, #order-retry,
.offer-confirmation button:not([data-confirm]) {
  background: var(--funnel-surface) !important;
  color: var(--funnel-brand) !important;
  border-color: var(--funnel-brand) !important;
}
.edit-address-button:hover, #cancel-address:hover, #order-retry:hover,
.offer-confirmation button:not([data-confirm]):hover { background: var(--funnel-selected-bg) !important; }
button:disabled, input[type=button]:disabled, input[type=submit]:disabled {
  opacity: .55;
  cursor: wait;
}

.checkoutForm .productCard.active, .checkoutForm .productPriceCard.active {
  background: var(--funnel-selected-bg);
  border-color: var(--funnel-selected);
}
.payment-method__header { background: var(--funnel-selected-bg); border-color: var(--funnel-selected); }
.payment-method__header .os-card__radio.selected .radio-style-1 {
  background: var(--funnel-selected); border-color: var(--funnel-selected);
}
.payment-method__content, .payment-method__content p,
.order-recovery, .integration-message { background: var(--funnel-bg); }
.ty-summary-box, .up-box, .protection-card, #quote-review, .offer-confirmation {
  background: var(--funnel-surface);
  border-color: var(--funnel-border);
}
.protection-row, .icon-imagggee { border-color: var(--funnel-border); }
body[data-page="upsell"] .up-box .bg-light { background: var(--funnel-bg) !important; }
body[data-page="upsell"] .currentPrice { color: var(--funnel-text) !important; }
.social-proof-popup span { color: var(--funnel-brand) !important; }
.protection-card-header, .save-strip {
  background: var(--funnel-selected-bg);
  color: var(--funnel-text);
  border-color: var(--funnel-border);
}
.protection-row h3, .protection-row p, .protection-note,
.dear-text, .dear-desc, .shipping-address-label, #address-display,
.order-title, .ty-line-item-title, .ty-line-item-value, .ty-total-title,
.ty-grandtotal-value, .ty-item-price, .ty-item-reg-price,
.ty-line-item-shipping-sub-title, .help-text,
.checkoutForm .productCard .product-name, .checkoutForm .productCard .offer-price {
  color: var(--funnel-text);
}
.protection-price .was, .protection-price .forboth { color: var(--funnel-muted); }
.ty-email, .help-text a { color: var(--funnel-brand); }
#order-status:not(:empty) { background: var(--funnel-brand); }

/* Preserve red validation borders, including when the invalid field has focus. */
body .checkoutForm form .form-control:focus:not(.is-invalid):not([aria-invalid=true]),
.form-control:focus:not(.is-invalid):not([aria-invalid=true]),
.form-select:focus:not(.is-invalid):not([aria-invalid=true]) {
  border-color: var(--funnel-selected) !important;
  box-shadow: 0 0 0 2px var(--funnel-selected-bg);
}
body button:focus-visible, body a:focus-visible, body input:focus-visible,
body select:focus-visible, body textarea:focus-visible {
  outline: 3px solid var(--funnel-selected) !important;
  outline-offset: 3px;
}
