/* Shared storefront form contrast. All changes are limited to the dark theme. */
html[data-sg-theme="dark"] body :is(.modal-content, .modal-body, .modal-footer) {
  background-color: #10171c !important;
  border-color: #36434d !important;
  color: #f5f7f8 !important;
}
html[data-sg-theme="dark"] body .modal-header {
  background-color: #182229 !important;
  border-color: #36434d !important;
  color: #f5f7f8 !important;
}
html[data-sg-theme="dark"] body :is(.modal-title, .modal-header h3, .modal-header h4, .modal-body label, .modal-body legend, .modal-body .control-label) {
  color: #f5f7f8 !important;
}
html[data-sg-theme="dark"] body :is(.modal-header .close, .modal-header .us-close, .alert .close) {
  color: #f5f7f8 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Chrome autofill can override color even when the field background is dark. */
html[data-sg-theme="dark"] body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="color"]),
html[data-sg-theme="dark"] body textarea,
html[data-sg-theme="dark"] body select {
  color: #f5f7f8 !important;
  -webkit-text-fill-color: #f5f7f8 !important;
  caret-color: #f5f7f8 !important;
}
html[data-sg-theme="dark"] body input:-webkit-autofill,
html[data-sg-theme="dark"] body textarea:-webkit-autofill,
html[data-sg-theme="dark"] body select:-webkit-autofill {
  -webkit-text-fill-color: #f5f7f8 !important;
  -webkit-box-shadow: 0 0 0 1000px #151c21 inset !important;
  caret-color: #f5f7f8 !important;
}
html[data-sg-theme="dark"] body :is(input, textarea)::placeholder,
html[data-sg-theme="dark"] body :is(#simpleregister, #simplecheckout_form_0, #loginModal) :is(input, textarea)::placeholder {
  color: #b8c3cc !important;
  -webkit-text-fill-color: #b8c3cc !important;
  opacity: 1 !important;
}
html[data-sg-theme="dark"] body :is(.input-group-addon, .input-group-text) {
  background-color: #182229 !important;
  border-color: #36434d !important;
  color: #f5f7f8 !important;
}
html[data-sg-theme="dark"] body select option,
html[data-sg-theme="dark"] body select optgroup {
  background-color: #151c21 !important;
  color: #f5f7f8 !important;
}

/* Preserve the meaning of each notice, with matching readable text and icons. */
html[data-sg-theme="dark"] body :is(.alert-success, .ex-alert.alert-success),
html[data-sg-theme="dark"] body :is(#content, .modal, .alert-block, #simpleregister, #simplecheckout_form_0, #window-cheaper) :is(.alert-success, .ex-alert.alert-success) {
  background-color: #143f2e !important;
  border-color: #34785a !important;
  color: #ecfff3 !important;
}
html[data-sg-theme="dark"] body :is(.alert-danger, .ex-alert.alert-danger),
html[data-sg-theme="dark"] body :is(#content, .modal, .alert-block, #simpleregister, #simplecheckout_form_0, #window-cheaper) :is(.alert-danger, .ex-alert.alert-danger) {
  background-color: #4a2026 !important;
  border-color: #a54354 !important;
  color: #ffe9ee !important;
}
html[data-sg-theme="dark"] body :is(.alert-info, .ex-alert.alert-info),
html[data-sg-theme="dark"] body :is(#content, .modal, .alert-block, #simpleregister, #simplecheckout_form_0, #window-cheaper) :is(.alert-info, .ex-alert.alert-info) {
  background-color: #173748 !important;
  border-color: #356b87 !important;
  color: #e9f5ff !important;
}
html[data-sg-theme="dark"] body :is(.alert-warning, .ex-alert.alert-warning),
html[data-sg-theme="dark"] body :is(#content, .modal, .alert-block, #simpleregister, #simplecheckout_form_0, #window-cheaper) :is(.alert-warning, .ex-alert.alert-warning) {
  background-color: #4b3718 !important;
  border-color: #92703a !important;
  color: #fff3d5 !important;
}
html[data-sg-theme="dark"] body :is(.alert-success, .alert-danger, .alert-info, .alert-warning) :is(a, p, span, strong, b, small, i, .close) {
  color: inherit !important;
}
html[data-sg-theme="dark"] body :is(.alert-success, .alert-danger, .alert-info, .alert-warning) a {
  text-decoration: underline;
}
html[data-sg-theme="dark"] body :is(.text-danger, .has-error .help-block, .simplecheckout-error-text, .simplecheckout-warning-text, .ex-error) {
  color: #ffadb3 !important;
}
html[data-sg-theme="dark"] body .text-success { color: #a0efb7 !important; }
html[data-sg-theme="dark"] body .text-info { color: #a5d8ff !important; }
html[data-sg-theme="dark"] body .text-warning { color: #ffe29a !important; }

/* Slightly deepen solid red form actions for white-text contrast above 4.5:1. */
html[data-sg-theme="dark"] body :is(.us-module-btn, .sg-gift-submit, .sg-cart-share-primary, .sg-cookie-button--primary, #footer-make-subscribe, #simpleregister_button_confirm, #simplecheckout_button_confirm) {
  background-color: #df151b !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
html[data-sg-theme="dark"] body :is(.btn-primary, .button-cart, .us-product-btn-active) {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
html[data-sg-theme="dark"] body #simplecheckout_form_0 #simplecheckout_cart .text-danger {
  color: #ffadb3 !important;
}
html[data-sg-theme="dark"] body #simplecheckout_form_0 #simplecheckout_button_cart {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
html[data-sg-theme="dark"] body #simplecheckout_form_0 #simplecheckout_button_confirm,
html[data-sg-theme="dark"] body #simplecheckout_form_0 #simplecheckout_cart .sg-cart-share-primary,
html[data-sg-theme="dark"] body #simpleregister #simpleregister_button_confirm {
  background-color: #df151b !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

html[data-sg-theme="dark"] body :is(.popover, .popover-body, .popover-header) {
  background-color: #182229 !important;
  border-color: #36434d !important;
  color: #f5f7f8 !important;
}
html[data-sg-theme="dark"] body #window-cheaper .forming_quick label.error-module {
  color: #ffadb3 !important;
}
html[data-sg-theme="dark"] body #window-cheaper .forming_quick label.success-module {
  color: #a0efb7 !important;
}

/* Legacy Bundle Expert/Bootstrap dialogs use light semantic button colors. */
html[data-sg-theme="dark"] body .modal .btn-success {
  background-color: #246c40 !important;
  border-color: #378255 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
html[data-sg-theme="dark"] body .modal .btn-info {
  background-color: #185b78 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
html[data-sg-theme="dark"] body .modal .btn-warning {
  background-color: #6b4a14 !important;
  color: #fff4df !important;
  -webkit-text-fill-color: #fff4df !important;
}
html[data-sg-theme="dark"] body .modal .btn-danger {
  background-color: #9f2638 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
html[data-sg-theme="dark"] body .modal .btn-primary,
html[data-sg-theme="dark"] body #product-product .us-product-btn-active,
html[data-sg-theme="dark"] body #simplecheckout_form_0 #simplecheckout_button_login,
html[data-sg-theme="dark"] body #show-more {
  background-color: #df151b !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
