/* ============================================================
   JWCFE - Redesigned Admin CSS (Reference Design Match)
   All original functionality preserved, layout overhauled
   ============================================================ */

/* ── Reset & Base ── */
.jwcfe-wrap *,
.jwcfeModal * {
  box-sizing: border-box;
}

/* ============================================================
   TOP NAVIGATION TABS — Checkout Fields | Advanced | Premium
   ============================================================ */
.jwcfe-wrap h2.nav-tab-wrapper.woo-nav-tab-wrapper {
  border-bottom: 2px solid #dcdcde;
  margin: 0 0 20px 0;
  padding: 0;
  background: transparent;
}

body.woocommerce_page_jwcfe_checkout_register_editor .nav-tab:first-child {
  margin-left: 0;
}

body.woocommerce_page_jwcfe_checkout_register_editor .nav-tab {
  padding: 10px 20px;
  color: #50575e;
  font-weight: 600;
  font-size: 13px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  margin-bottom: -2px;
  transition:
    color 0.15s,
    border-color 0.15s;
}

body.woocommerce_page_jwcfe_checkout_register_editor .nav-tab:hover {
  color: #2271b1;
  background: transparent;
  border-bottom-color: #2271b1;
}

body.woocommerce_page_jwcfe_checkout_register_editor .nav-tab.nav-tab-active {
  color: #2271b1;
  background: transparent;
  border-bottom: 3px solid #2271b1;
  font-weight: 700;
}

/* ============================================================
   CLASSIC / BLOCK CHECKOUT TYPE SWITCHER TABS
   ============================================================ */
.c-type-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  min-height: auto;
}

.c-type-tabs {
  display: flex;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  overflow: hidden;
  width: max-content;
  background: #f6f7f7;
}

.c-type-tab {
  padding: 7px 18px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #50575e;
  font-weight: 600;
  font-size: 13px;
  margin-left: 0 !important;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
}

.c-type-tab:hover {
  background: #e8e9ea;
  color: #1e1e1e;
}

.c-type-tab.active {
  background: #2271b1;
  color: #fff;
  border-radius: 4px;
}

/* Info tooltip */
.ct-info {
  position: relative;
  cursor: pointer;
  display: none;
}

.ct-info:hover .ct-info-box {
  display: block !important;
}

.ct-info-box {
  position: absolute;
  top: -45px;
  left: 35px;
  width: 570px;
  z-index: 9999;
}

.ct-info-box p {
  background: #222;
  color: #fff;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  position: relative;
}

.ct-info-box p::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -20px;
  border-width: 10px;
  border-style: solid;
  border-color: transparent #222 transparent transparent;
  transform: translateY(-50%);
}

.ct-info-box a:hover {
  color: #7dc4f8;
}

/* ============================================================
   SECTION SUB-LINKS (Billing Fields / Shipping / Additional)
   ============================================================ */
.jwcfe-sections {
  list-style: none;
  margin: 0 0 18px 0;
  padding: 0;
  display: flex;
  gap: 0;
  border-bottom: 1px solid #dcdcde;
}

.jwcfe-sections li {
  display: inline-block;
  white-space: nowrap;
}

.jwcfe-sections .circle {
  display: none;
}

.jwcfe-sections a {
  display: inline-block;
  padding: 8px 16px;
  color: #50575e;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.jwcfe-sections a:hover {
  color: #2271b1;
  border-bottom-color: #2271b1;
}

.jwcfe-sections a.current {
  font-weight: 700;
  color: #2271b1;
  border-bottom: 3px solid #2271b1;
  text-decoration: none;
}

/* ============================================================
   COMPATIBILITY WARNING NOTICE
   ============================================================ */
.jc-block-warning-msg {
  border: 1px solid #e0e0e0;
  padding: 12px 16px;
  background-color: #fff;
  color: #333;
  border-radius: 6px;
  margin-bottom: 16px;
  display: none;
}

.jc-warning-message-panel__text {
  display: flex;
  align-items: center;
}

.jc-warning-img {
  padding-right: 12px;
  display: flex;
  align-items: center;
}

.jc-warning-img img {
  width: 32px;
}

.jc-warning {
  padding-left: 6px;
  line-height: 1.5em;
  font-size: 12.5px;
  color: #555;
}

.jc-warning a {
  color: #2271b1;
  font-style: normal;
  font-weight: 500;
}

/* ============================================================
   PREMIUM MESSAGE BANNER
   ============================================================ */
.premium-container {
  display: grid;
  grid-template-columns: 65% 35%;
  gap: 15px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  margin-top: 30px;
}

.premium-message {
  position: relative;
  overflow: hidden;
}

.premium-message img {
  width: 100%;
  height: 100%;
  border-radius: 16px;
}

@media (max-width: 768px) {
  .premium-container {
    grid-template-columns: 1fr;
  }

  .premium-message img {
    width: 100% !important;
  }
}

/* ============================================================
   MAIN TABLE WRAPPER
   ============================================================ */
.jwcfe-wrap {
  background: transparent;
  max-width: 1040px;
  margin: 10px auto 20px auto;
}

#jwcfe_checkout_fields_form {
  margin-top: 0px;
}

/* ============================================================
   THE TABLE — clean card style
   ============================================================ */
table#jwcfe_checkout_fields {
  border: none !important;
  box-shadow: none !important;
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #dcdcde !important;
}

.jwcfe-wrap table.widefat {
  border: 1px solid #dcdcde !important;
  box-shadow: none !important;
  border-radius: 8px;
}

/* THEAD */
.jwcfe-wrap thead tr {
  background-color: #f6f7f7;
}

.jwcfe-wrap thead td,
.jwcfe-wrap thead th {
  border-bottom: 1px solid #dcdcde !important;
  border-top: none !important;
  padding: 10px 14px;
  line-height: normal;
  color: #3c434a;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0;
}

table#jwcfe_checkout_fields thead th {
  font-weight: 700;
}

.jwcfe-wrap thead th.sort,
.jwcfe-wrap thead td.sort {
  width: 30px;
}

/* TBODY rows */
#jwcfe_checkout_fields tbody tr {
  background: #fff;
  transition: background 0.1s;
}

#jwcfe_checkout_fields tbody tr:hover {
  background: #f8f9ff;
}

#jwcfe_checkout_fields tbody td {
  overflow: visible !important;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f1;
  vertical-align: middle;
  font-size: 13px;
  color: #3c434a;
}

#jwcfe_checkout_fields tbody td:last-child,
#jwcfe_checkout_fields tbody th:last-child {
  padding-right: 14px;
}

/* TFOOT */
.jwcfe-wrap tfoot tr {
  background-color: #f6f7f7;
}

.jwcfe-wrap .widefat tfoot tr td,
.jwcfe-wrap .widefat tfoot tr th,
.jwcfe-wrap .widefat thead tr td,
.jwcfe-wrap .widefat thead tr th {
  color: #3c434a;
  border-top: 1px solid #dcdcde !important;
}

/* Drag handle */
.jwcfe-wrap tbody.ui-sortable td.sort.ui-sortable-handle::before {
  content: "\f333";
  font-family: Dashicons;
  text-align: center;
  color: #bbb;
  display: block;
  width: 17px;
  float: left;
  line-height: 24px;
  cursor: move;
  font-size: 18px;
}

/* ============================================================
   FIELD TYPE BADGES
   ============================================================ */
.jwcfe-type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}

.jwcfe-type-text {
  background: #e8f0fe;
  color: #1a56db;
}

.jwcfe-type-email {
  background: #f0e8fe;
  color: #7e3af2;
}

.jwcfe-type-phone {
  background: #e8fef0;
  color: #057a55;
}

.jwcfe-type-select,
.jwcfe-type-multiselect {
  background: #fef3e8;
  color: #c27803;
}

.jwcfe-type-textarea {
  background: #fef3e8;
  color: #c27803;
}

.jwcfe-type-checkbox,
.jwcfe-type-radio {
  background: #fde8e8;
  color: #c81e1e;
}

.jwcfe-type-date {
  background: #e8fef5;
  color: #046c4e;
}

.jwcfe-type-week,
.jwcfe-type-month,
.jwcfe-type-timepicker,
.jwcfe-type-datetime-local {
  background: #e8fef5;
  color: #046c4e;
}

.jwcfe-type-number {
  background: #e8f4fe;
  color: #1a7abf;
}

.jwcfe-type-password {
  background: #f3e8fe;
  color: #5521b5;
}

.jwcfe-type-hidden,
.jwcfe-type-heading,
.jwcfe-type-paragraph {
  background: #f0f0f0;
  color: #555;
}

.jwcfe-type-default {
  background: #e8f0fe;
  color: #2271b1;
}

/* ============================================================
   STATUS BADGES — Required / Optional
   ============================================================ */
.jwcfe-status-required {
  display: inline-block;
  background: #fde8e8;
  color: #c81e1e;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 4px;
}

.jwcfe-status-optional {
  display: inline-block;
  background: #f0f0f1;
  color: #666;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
}

/* ============================================================
   ACTION ICONS — Eye / Pencil / Trash
   ============================================================ */
.jwcfe-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.jwcfe-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  border: 1px solid #dcdcde;
  background: #fff;
  cursor: pointer;
  color: #50575e;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
  text-decoration: none;
  padding: 0;
}

.jwcfe-icon-btn:hover {
  background: #f0f0f1;
  border-color: #bbb;
  color: #1e1e1e;
}

.jwcfe-icon-btn.edit:hover {
  background: #e8f0fe;
  border-color: #2271b1;
  color: #2271b1;
}

.jwcfe-icon-btn.delete {
  color: #c81e1e;
  border-color: #f5c2c2;
  background: #fff8f8;
}

.jwcfe-icon-btn.delete:hover {
  background: #c81e1e;
  border-color: #c81e1e;
  color: #fff;
}

.jwcfe-icon-btn:disabled,
.jwcfe-icon-btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

.jwcfe-icon-btn svg {
  width: 13px;
  height: 13px;
  pointer-events: none;
}

/* Legacy edit button */
.jwcfe-wrap .f_edit_btn {
  background-color: #fff;
  border: 1px solid #dcdcde;
  height: 28px;
  width: 28px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.jwcfe-wrap .f_edit_btn:hover {
  background: #e8f0fe;
  border-color: #2271b1;
}

.jwcfe-wrap .f_edit_btn img.edit-icon {
  width: 12px;
  height: 12px;
}

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.jwcfe-wrap .pure-material-switch {
  z-index: 0;
  position: relative;
  display: inline-block;
  color: rgba(0, 0, 0, 0.87);
  font-size: 16px;
  line-height: 1.5;
}

.jwcfe-wrap .pure-material-switch>input {
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  z-index: -1;
  position: absolute;
  right: 6px;
  top: -8px;
  display: block;
  margin: 0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.38);
  outline: none;
  opacity: 0;
  transform: scale(1);
  pointer-events: none;
  transition:
    opacity 0.3s 0.1s,
    transform 0.2s 0.1s;
}

.jwcfe-wrap .pure-material-switch>span {
  display: inline-block;
  width: 100%;
  cursor: pointer;
}

.jwcfe-wrap .pure-material-switch>span::before {
  content: "";
  float: right;
  display: inline-block;
  margin: 5px 0 5px 10px;
  border-radius: 7px;
  width: 36px;
  height: 14px;
  background-color: #b1b1b1;
  vertical-align: top;
  transition:
    background-color 0.2s,
    opacity 0.2s;
}

.jwcfe-wrap .pure-material-switch>span::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 16px;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  background-color: #646464;
  box-shadow:
    0 3px 1px -2px rgba(0, 0, 0, 0.2),
    0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
  transition:
    background-color 0.2s,
    transform 0.2s;
}

.jwcfe-wrap .pure-material-switch>input:checked {
  right: -10px;
  background-color: #b3d9f7;
}

.jwcfe-wrap .pure-material-switch>input:checked+span::before {
  background-color: #b3d9f7;
}

.jwcfe-wrap .pure-material-switch>input:checked+span::after {
  transform: translateX(16px);
  background-color: #2271b1;
}

.jwcfe-wrap .pure-material-switch:hover>input {
  opacity: 0;
}

.jwcfe-wrap .pure-material-switch>input:focus {
  opacity: 0;
}

.jwcfe-wrap .pure-material-switch:hover>input:focus {
  opacity: 0;
}

.jwcfe-wrap .pure-material-switch>input:active {
  opacity: 1;
  transform: scale(0);
  transition:
    transform 0s,
    opacity 0s;
}

.jwcfe-wrap .pure-material-switch>input:checked:active+span::before {
  background-color: rgba(0, 0, 0, 0.38);
}

.jwcfe-wrap .pure-material-switch>input:disabled {
  opacity: 0;
}

.jwcfe-wrap .pure-material-switch>input:disabled+span {
  color: gray;
  opacity: 0;
  cursor: default;
}

.jwcfe-wrap .pure-material-switch>input:disabled+span::before {
  background-color: rgba(169, 169, 169, 0.38);
}

.jwcfe-wrap .pure-material-switch>input:checked:disabled+span::before {
  background-color: #90ee90;
}

.jwcfe-wrap .toggle-label {
  font-size: 13px;
  padding-left: 5px;
  color: #555;
}

.jwcfe-wrap .label {
  font-size: 13px;
}

.jwcfe-wrap .toggle-checkbox {
  position: absolute;
  opacity: 0;
}

/* ============================================================
   DISABLED ROWS
   ============================================================ */
.jwcfe-wrap tr.jwcfe-disabled td {
  opacity: 0.4;
}

.jwcfe-wrap tr.jwcfe-disabled td.td_select {
  opacity: 1;
}

.jwcfe-wrap tr.strikeout td {
  background: rgba(255, 0, 0, 0.04) !important;
  opacity: 0.6;
  text-decoration: line-through;
}

.jwcfe-wrap tr.strikeout1 td:before {
  content: " ";
  position: absolute;
  top: 50%;
  left: 0;
  border-bottom: 1px solid #ff0000;
  width: 100%;
  display: none;
}

.jwcfe-wrap tr.disabled td {
  opacity: 0.3;
  text-decoration: line-through;
}

.jwcfe-wrap tr.disabled td:first-child {
  opacity: 1;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.jwcfe-wrap .button-primary,
input[name="save_fields"],
input.button-primary {
  background: #2271b1 !important;
  border-color: #2271b1 !important;
  color: #fff !important;
  text-decoration: none;
  text-shadow: none;
  border-radius: 5px !important;
  font-weight: 600;
  padding: 6px 16px !important;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: none !important;
}

.jwcfe-wrap .button-primary:hover,
input[name="save_fields"]:hover {
  background-color: #135e96 !important;
  border-color: #135e96 !important;
  color: #fff !important;
}

.jwcfe-wrap .button-primary:focus,
input[name="save_fields"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px #a8d1f5 !important;
}

.jwcfe-wrap .button-primary::after {
  background: #2271b1;
  border-color: #2271b1;
}

.jwcfe-wrap .button-primary:after {
  background-color: #2271b1;
}

.jwcfe-wrap .button,
.jwcfe-wrap .button-secondary {
  color: #3c434a;
  border: 1px solid #dcdcde;
  background: #fff;
  vertical-align: top;
  border-radius: 5px !important;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px !important;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  text-shadow: none;
  box-shadow: none !important;
}

.jwcfe-wrap .button:hover,
.jwcfe-wrap .button-secondary:hover {
  background: #f0f0f1;
  border-color: #bbb;
  color: #1e1e1e;
}

/* Actions row thead/tfoot padding */
.jwcfe-wrap thead tr:first-child th,
.jwcfe-wrap tfoot tr:last-child th {
  padding: 12px 14px;
}

/* ============================================================
   SUCCESS / ERROR NOTICES
   ============================================================ */
.jwcfe-wrap .updated,
.woocommerce-message {
  margin-top: 10px;
  border-left-color: #2271b1;
  border-radius: 4px;
}

.jwcfe-wrap .error_message {
  border-left-color: #d63638;
  background: #fff;
  border: 1px solid #d63638;
  border-left-width: 4px;
  border-right-color: #c3c4c7;
  border-top-color: #c3c4c7;
  border-bottom-color: #c3c4c7;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  padding: 12px;
  border-radius: 4px;
}

.jwcfe-wrap .success {
  border-left-color: #00a32a;
  background: #fff;
  border: 1px solid #00a32a;
  border-left-width: 4px;
  border-right-color: #c3c4c7;
  border-top-color: #c3c4c7;
  border-bottom-color: #c3c4c7;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  padding: 0 9px;
  margin-top: 6px;
  border-radius: 4px;
}

/* ============================================================
   TOOLTIP
   ============================================================ */
.jwcfe-tooltip {
  position: relative;
  cursor: pointer;
}

.jwcfe-tooltip img {
  width: 16px;
}

.jwcfe-tooltip p {
  left: -100px;
  display: none;
  position: absolute;
  width: 350px;
  background: #1e1e1e;
  color: #fff;
  padding: 10px 15px;
  border-radius: 6px;
  bottom: 26px;
  font-weight: 400;
  font-size: 12px;
  z-index: 9999;
}

.jwcfe-tooltip:hover p {
  display: block;
}

.jwcfe-tooltip p:before {
  border: solid;
  border-color: #1e1e1e transparent;
  border-width: 6px 6px 0 6px;
  bottom: -5px;
  content: "";
  left: 27%;
  position: absolute;
  z-index: 9999;
}

/* ============================================================
   MODAL / POPUP  — main styles are in the NEW POPUP section below
   ============================================================ */
/* Old .jwcfemodal-content is no longer used — neutralize it */
.jwcfemodal-content {
  display: contents;
  /* invisible passthrough wrapper */
}

.jwcfecloseBtn {
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  float: none;
  margin: 0;
  transition: color 0.15s, background 0.15s;
}

.jwcfecloseBtn:hover {
  color: #333;
  background: #f0f0f0;
}


.wc-block-components-address-form__country.wc-block-components-country-input {
  margin-top: 12px !important;
}

.woocommerce_page_jwcfe_checkout_register_editor .ui-dialog-title {
  margin: unset;
  margin-left: 7px;
  font-size: 15px;
  font-weight: 600;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Form fields in modal */
.jwcfe-wrap input[type="text"],
.jwcfe-wrap input[type="number"],
.jwcfe-wrap select,
.jwcfe-wrap textarea {
  color: #3c434a;
  line-height: 1;
  background-color: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  overflow: hidden;
  font-size: 13px;
  padding: 0 12px;
  box-shadow: none;
  height: 34px;
}

.jwcfe-wrap input[type="text"]:focus,
.jwcfe-wrap input[type="number"]:focus,
.jwcfe-wrap select:focus,
.jwcfe-wrap textarea:focus {
  border-color: #2271b1;
  outline: none;
  box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.ui-widget select,
.ui-widget textarea,
.ui-widget button {
  font-size: 13px !important;
}

.jwcfe-wrap .select2-selection {
  font-size: 13px !important;
  height: 34px !important;
}

.jwcfe-wrap .select2-selection--multiple {
  height: 34px !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  padding: 5px !important;
  font-size: 14px !important;
}

.jwcfe-wrap .select2-search__field {
  height: 34px !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  padding: 5px !important;
  font-size: 14px !important;
  margin-bottom: 8px !important;
}

.jwcfe-wrap .select2-selection__rendered {
  display: flex !important;
  align-items: center !important;
  min-height: 36px;
}

.jwcfe-wrap input[name="license_key"] {
  width: 100%;
  padding: 10px;
}

/* Form labels */
.jwcfe-wrap .rowfield,
#fieldlabel,
.jwcfe-wrap .rowName,
.jwcfe-wrap .fieldlabel,
.jwcfe-wrap .rowLabel,
.jwcfe-wrap .rowDescription,
.jwcfe-wrap .rowPlaceholder,
.jwcfe-wrap .rowMaxlength,
.jwcfe-wrap .rowDescription2,
.jwcfe-wrap .rowValidate,
.jwcfe-wrap .taxtext,
.jwcfe-wrap .rowPricing {
  color: #1e1e1e;
  font-size: 13px;
  font-weight: 600;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ============================================================
   JQUERY UI TABS (inside popup)
   ============================================================ */
.jwcfe-wrap .ui-tabs .ui-tabs-nav {
  margin: 0;
  border: none;
  height: 43px;
  background: #f6f7f7;
  padding: 0.2em 0.5em 0 !important;
  border-radius: 7px;
}

.jwcfe-wrap .ui-tabs .ui-tabs-nav li.ui-tabs-active {
  padding-top: 3px !important;
}

.jwcfe-wrap .ui-tabs .ui-tabs-nav li {
  list-style: none;
  float: left !important;
  position: relative;
  top: 0;
  margin: 1px 0 -3px !important;
  border-bottom-width: 0;
  background: none;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.jwcfe-wrap .ui-state-default,
.jwcfe-wrap .ui-widget-content .ui-state-default,
.jwcfe-wrap .ui-widget-header .ui-state-default {
  font-weight: normal;
  color: #555;
}

.jwcfe-wrap .ui-state-hover,
.jwcfe-wrap .ui-widget-content .ui-state-hover,
.jwcfe-wrap .ui-widget-header .ui-state-hover,
.jwcfe-wrap .ui-state-focus,
.jwcfe-wrap .ui-widget-content .ui-state-focus,
.jwcfe-wrap .ui-widget-header .ui-state-focus {
  border: 0 !important;
  background: none;
}

.jwcfe-wrap .ui-corner-all,
.jwcfe-wrap .ui-corner-bottom,
.jwcfe-wrap .ui-corner-right,
.jwcfe-wrap .ui-corner-br {
  border: none;
}

.jwcfe-wrap .ui-dialog .ui-dialog-titlebar {
  background: none;
}

.jwcfe-wrap .ui-dialog .ui-dialog-title {
  float: left;
  margin: 0.1em 0;
  white-space: nowrap;
  width: 90%;
  margin-left: 8px;
}

.jwcfe-wrap .ui-dialog .ui-dialog-titlebar-close {
  text-indent: 99em;
  position: absolute;
  right: 1em;
  top: 50%;
  width: 20px;
  margin: -10px 0 0 0;
  padding: 1px;
  height: 20px;
}

.jwcfe-wrap .ui-widget .ui-widget {
  background: none;
}

.jwcfe-wrap .ui-tabs .ui-tabs-nav li .ui-tabs-anchor {
  border-right: 1px solid white !important;
  border-top: 0 !important;
  border-left: 0 !important;
  border-bottom: 0 !important;
  cursor: pointer;
  background: #2271b1;
  color: white;
  float: left;
  padding: 0.5em 1em;
  text-decoration: none;
  border: unset;
  font-size: 13px;
}

.jwcfe-wrap .ui-tabs .ui-tabs-nav li:last-child .ui-tabs-anchor {
  border-right: none !important;
}

.jwcfe-wrap .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
  background-color: #135e96;
  color: white;
  border-radius: 7px;
}

.ui-tabs .ui-tabs-nav li .ui-tabs-anchor:focus {
  box-shadow: none;
}

.jwcfe-wrap .ui-dialog .ui-dialog-buttonpane,
.jwcfe-wrap .ui-widget-content {
  border: none !important;
}

.woocommerce_page_jwcfe_checkout_register_editor .ui-tabs .ui-tabs-panel {
  padding: 1em 0 0 0 !important;
}

/* ============================================================
   DIALOG BUTTONS
   ============================================================ */
.woocommerce_page_jwcfe_checkout_register_editor .ui-dialog-buttonset .ui-button {
  color: #fff !important;
  background-color: #2271b1 !important;
  border-color: #2271b1 !important;
  display: inline-block;
  background-image: none;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1px;
  border-width: 1px;
  border-style: solid;
  border-radius: 5px;
  outline: 0;
  margin-top: unset;
  margin-bottom: -2px;
  border-bottom: none;
  padding: 15px 12px 18px;
  transition: background 0.15s;
}

.woocommerce_page_jwcfe_checkout_register_editor .ui-dialog-buttonset .ui-button:hover {
  background-color: #135e96 !important;
  border-color: #135e96 !important;
}

.woocommerce_page_jwcfe_checkout_register_editor .ui-dialog-buttonset .ui-button:first-child {
  color: #3c434a !important;
  background-color: #f0f0f1 !important;
  border-color: #dcdcde !important;
  border-radius: 5px;
  margin-bottom: -2px;
  margin-top: unset;
}

.woocommerce_page_jwcfe_checkout_register_editor .ui-dialog-buttonset .ui-button:first-child:hover {
  background-color: #e0e0e0 !important;
}

.woocommerce_page_jwcfe_checkout_register_editor .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
  float: right;
}

/* Popup buttons */
.popup_button_dailogbox {
  text-align: left;
  bottom: 0;
  right: 12px;
  border-width: 1px 0 0 0;
  background-image: none;
  margin-top: 0.5em;
  padding: 0.5em 1em 0.5em 0.4em;
  margin-top: 25px;
}

.popup_button_dailogbox .dialog-button-set {
  float: right;
}

.popup_button_dailogbox .dialog-button-set #btncancel,
#btnaddfield {
  color: #3c434a;
  background-color: #f0f0f1;
  white-space: nowrap;
  border-radius: 5px;
  border: none;
  margin-top: unset;
  font-size: 13px;
  margin: 0 0.4em 0.5em 0;
  cursor: pointer;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 12px;
  padding-right: 12px;
}

.popup_button_dailogbox .dialog-button-set #btnaddfield {
  color: #fff !important;
  background-color: #2271b1 !important;
  border-color: #2271b1 !important;
  display: inline-block;
  background-image: none;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1px;
  border-width: 1px;
  border-style: solid;
  border-radius: 5px;
  outline: 0;
  margin-top: unset;
  margin-bottom: -2px;
  border-bottom: none;
  padding: 15px 12px 18px;
  transition: background 0.15s;
}

.popup_button_dailogbox .dialog-button-set #btnaddfield:hover {
  background-color: #135e96 !important;
}

/* ============================================================
   ADD/EDIT FIELD MODAL — SAVING STATE
   Gives immediate feedback on click instead of a silent pause while
   the full-page form submit reloads the settings screen.
   ============================================================ */
.popup_button_dailogbox .dialog-button-set #btnaddfield.jwcfe-btn-saving {
  cursor: not-allowed;
  opacity: 0.85;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.jwcfe-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: jwcfe-spin 0.7s linear infinite;
  flex: none;
}

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

.jwcfe-disabled-link {
  pointer-events: none;
  opacity: 0.5;
}

#jwcfeModal.jwcfe-modal-saving .jwcfe-modal-header,
#jwcfeModal.jwcfe-modal-saving #jwcfe_new_field_form {
  opacity: 0.6;
  pointer-events: none;
}

/* ============================================================
   FORM LAYOUT INSIDE POPUP
   ============================================================ */
/* OLD layout neutralized — new modal uses .jwcfe-modal-box/.jwcfe-modal-body instead */
.jwcfe-wrap #jwcfe_edit_field_form_pp {
  display: block;
}

.jwcfe-wrap .jwcfe_form_container {
  display: flex;
  flex-wrap: wrap;
  max-height: 100%;
  justify-content: center;
  margin-bottom: 0.5em;
  margin-top: 15px;
}

.jwcfe-wrap .vl {
  border-left: 1px solid #dcdcde;
}

.jwcfe-wrap .ui-widget input,
.jwcfe-wrap .ui-widget select,
.jwcfe-wrap .ui-widget textarea,
.jwcfe-wrap .ui-widget button {
  font-size: 1em;
}

.jwcfe_right_col {
  flex: 0 0 45% !important;
  padding-bottom: 10px;
}

.jwcfe_right_col_child_div {
  display: flex;
  flex-wrap: wrap;
  gap: 1.7em;
}

.jwcfe_left_col {
  flex: 0 0 35% !important;
  padding-bottom: 10px;
}

.jwcfe_left_col_child_div {
  display: flex;
  flex-wrap: wrap;
  gap: 1.7em;
}

.jwcfe_left_col,
.jwcfe_right_col {
  flex: 1;
  margin-right: 10px;
}

.jwcfe_right_col {
  margin-right: 0;
}

.jwcfe_form_container {
  display: flex;
  justify-content: center;
}

.woocommerce_page_jwcfe_checkout_register_editor .rowfield,
.rowName,
.woocommerce_page_jwcfe_checkout_register_editor .rowLabel,
.rowDescription,
.woocommerce_page_jwcfe_checkout_register_editor .rowPlaceholder,
.woocommerce_page_jwcfe_checkout_register_editor .rowMaxlength,
.woocommerce_page_jwcfe_checkout_register_editor .rowValidate,
.woocommerce_page_jwcfe_checkout_register_editor .rowClass,
.woocommerce_page_jwcfe_checkout_register_editor .rowTimepicker,
.rowExtoptions {
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .jwcfe_form_container {
    flex-direction: column;
  }

  .jwcfe_left_col,
  .jwcfe_right_col {
    margin-right: 0;
  }
}

/* ============================================================
   POPUP FOOTER (checkboxes)
   ============================================================ */
.jwcfe-wrap .popup_footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1em;
  background-color: #f6f7f7;
  height: auto;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
  text-align: center;
  align-items: center;
  justify-content: center;
}

.jwcfe-wrap .checkbox-table {
  width: 100%;
  border-collapse: collapse;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.jwcfe-wrap .checkbox-cell {
  text-align: left;
  padding: 3px;
}

.jwcfe-wrap .checkbox-row {
  display: flex;
  align-items: center;
}

.jwcfe-wrap .checkbox-cell input {
  margin-right: 10px;
}

.jwcfe-wrap .popup_footer [type="checkbox"]:not(:checked),
.jwcfe-wrap .popup_footer [type="checkbox"]:checked {
  position: absolute;
  left: -9999px;
}

.jwcfe-wrap .popup_footer [type="checkbox"]:not(:checked)+label,
.jwcfe-wrap .popup_footer [type="checkbox"]:checked+label {
  position: relative;
  padding-left: 25px;
  cursor: pointer;
}

.jwcfe-wrap .popup_footer [type="checkbox"]:not(:checked)+label:before,
.jwcfe-wrap .popup_footer [type="checkbox"]:checked+label:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0px;
  width: 17px;
  height: 17px;
  background: #fff;
  border: 1px solid #dcdcde;
  box-shadow: none;
  border-radius: 3px;
}

.jwcfe-wrap .popup_footer [type="checkbox"]:not(:checked)+label:after,
.jwcfe-wrap .popup_footer [type="checkbox"]:checked+label:after {
  content: "";
  position: absolute;
  top: 0px;
  left: 1px;
  width: 17px;
  height: 17px;
  background-image: url("check.png");
  background-size: cover;
  transition: all 0.2s;
}

.jwcfe-wrap .popup_footer [type="checkbox"]:not(:checked)+label:after {
  opacity: 0;
  transform: scale(0);
}

.jwcfe-wrap .popup_footer [type="checkbox"]:checked+label:after {
  opacity: 1;
  transform: scale(1);
}

.jwcfe-wrap .popup_footer label {
  font-size: 12px !important;
  text-align: center;
  color: #555;
}

.jwcfe-wrap .reqjwcfe {
  display: flex;
  align-items: center;
  gap: 10px;
}

.jwcfe-wrap .rowRequired,
.jwcfe-wrap .rowShowInEmail,
.jwcfe-wrap .rowShowInOrder {
  display: flex;
  align-items: center;
}

/* ============================================================
   CONDITIONAL RULES
   ============================================================ */
#jwcfe-tab-rules_new a {
  color: #222;
  background-color: #2271b1;
  border: 1px solid #2271b1;
  color: #ffffff;
  padding: 2px 5px;
  border-radius: 3px;
  margin-left: 5px;
  font-size: 12px;
  text-decoration: none;
}

#jwcfe-tab-rules_new a:nth-child(2) {
  background-color: #d63638;
  border: 1px solid #d63638;
}

form#jwcfe_new_field_form tr.jwcfe_condition.condition-rule-div {
  display: flex;
  align-items: center;
}

div[class="jwcfe_tabs ui-tabs ui-corner-all ui-widget ui-widget-content"] {
  padding-top: 0px;
}

form#jwcfe_new_field_form .conditional-rule-new-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 2.3em;
}

.jwcfe_condition select {
  width: 300px;
  height: 30px;
  padding-right: 1.5em;
  background-color: #f6f7f7;
  font-weight: 400;
  color: #1e1e1e;
  border-color: #dcdcde;
}

.jwcfe_condition input,
.jwcfe-wrap .rowfield select,
.jwcfe-wrap .rowName input,
.jwcfe-wrap .rowLabel input,
.jwcfe-wrap .rowDescription textarea,
.jwcfe-wrap .rowPlaceholder input,
.jwcfe-wrap .rowMaxlength input {
  width: 300px;
  height: 30px;
  background-color: #f6f7f7;
  font-weight: 400;
  color: #1e1e1e;
  border-color: #dcdcde;
}

.jwcfe-wrap .thpladmin_rule_operand {
  display: grid;
  gap: 5px;
}

.jwcfe-wrap .wc-wp-version-gte-53 .select2-container .select2-selection--multiple {
  min-height: 30px;
  background-color: #f6f7f7;
  border-color: #dcdcde !important;
  border-radius: 4px;
}

.jwcfe-wrap .wc-wp-version-gte-53 .select2-container .select2-search--inline .select2-search__field {
  padding: 0 0 0 15px;
  min-height: 28px;
  font-weight: 400;
}

.jwcfe-wrap .pricetxt select,
.jwcfe-wrap .taxtxt select,
.jwcfe-wrap .fieldtxt select,
.jwcfe-wrap .rowTimepicker input,
.jwcfe-wrap .rowLabel1 input,
.jwcfe-wrap .rowDescription2 textarea,
.jwcfe-wrap .rowPricing div input {
  width: 300px !important;
  height: 40px !important;
  background-color: #f6f7f7 !important;
  font-weight: 400;
  color: #1e1e1e;
  border-color: #dcdcde;
}

.jwcfe-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered,
.jwcfe-wrap .wc-wp-version-gte-53 .select2-container .select2-search--inline .select2-search__field {
  width: unset !important;
}

/* Neutralized — new modal does not use ui-dialog */
.jwcfe-wrap .woocommerce_page_jwcfe_checkout_register_editor .ui-dialog {
  /* reset */
}

/* Neutralized — .jwcfe-modal-body controls the body now */
form#jwcfe_new_field_form #jwcfe_field_editor_form_new {
  display: block;
  min-height: unset;
}

/* ============================================================
   OPTIONS LIST — clean modal layout
   ============================================================ */

/* Container for all option rows */
.jwcfe-opt-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.jwcfe-opt-container::-webkit-scrollbar {
  width: 4px;
}

.jwcfe-opt-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

/* Single option row */
.jwcfe-opt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* Input wrappers grow equally */
.jwcfe-opt-input-wrap {
  flex: 1;
  min-width: 0;
}

.jwcfe-opt-input-wrap input[type="text"] {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  background: #f7f8fa;
  border: 1.5px solid #dde1e7;
  border-radius: 6px;
  color: #333;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.jwcfe-opt-input-wrap input[type="text"]:focus {
  outline: none;
  border-color: #2271b1;
  background: #fff;
}

/* Action buttons group - stays on right, never wraps */
.jwcfe-opt-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Individual action button */
.jwcfe-opt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.jwcfe-opt-btn-add {
  background: #2271b1;
  color: #fff;
  border-color: #2271b1;
}

.jwcfe-opt-btn-add:hover {
  background: #135e96;
  border-color: #135e96;
  color: #fff;
}

.jwcfe-opt-btn-remove {
  background: #fde8e8;
  color: #c81e1e;
  border-color: #f5c2c2;
}

.jwcfe-opt-btn-remove:hover {
  background: #c81e1e;
  color: #fff;
  border-color: #c81e1e;
}

.jwcfe-opt-btn-sort {
  background: #f6f7f7;
  color: #666;
  border-color: #dcdcde;
  cursor: move;
  font-size: 12px;
}

.jwcfe-opt-btn-sort:hover {
  background: #e8e9ea;
  color: #333;
}

/* Legacy: keep .jwcfe-option-list working */
.jwcfe-option-list.thpladmin-dynamic-row-table {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* old action-cell btn rules removed — replaced by .jwcfe-opt-btn */

/* ============================================================
   SELECT2
   ============================================================ */
.wc-wp-version-gte-53 .select2-container .select2-selection--single {
  background-color: #f6f7f7 !important;
  font-weight: 400 !important;
  color: #1e1e1e !important;
  border-color: #dcdcde !important;
}

.select2-selection__clear {
  display: none;
}

.woocommerce_page_jwcfe_checkout_register_editor .thpladmin_rule_operand .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
  text-wrap: balance !important;
}

.jwcfe-wrap .select2-container--default .select2-selection--single .select2-selection__clear {
  cursor: pointer;
  float: right;
  display: none !important;
  font-weight: 700;
}

/* ============================================================
   LICENSE FORM
   ============================================================ */
.jwcfe-wrap .jwcfe-license-form {
  margin-top: 20px;
  padding: 20px 30px 10px 30px;
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border: 1px solid #dcdcde;
  min-height: 240px;
  width: 35%;
  float: left;
  margin-right: 20px;
  border-radius: 6px;
}

.jwcfe-wrap .jwcfe-license-form p button {
  background-color: #2271b1 !important;
  border-color: #2271b1 !important;
}

.jwcfe_license_details {
  margin-top: 20px;
  padding: 20px 30px 10px 30px;
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border: 1px solid #dcdcde;
  min-height: 240px;
  width: 35%;
  float: left;
  border-radius: 6px;
}

/* ============================================================
   MISC
   ============================================================ */
.jwcfe-wrap .hidden-field {
  display: none !important;
}

.jwcfe-wrap .err_msgs {
  color: #d63638;
  width: 100%;
}

.jwcfe-wrap .dashicons-saved {
  font-weight: 600;
  color: #2271b1;
  font-size: 20px;
}

.jwcfe-wrap input[type="checkbox"],
.jwcfe-wrap input[type="radio"] {
  border: 1px solid #ccc;
  border-radius: 2px;
  background: #fff;
  color: #50575e;
  clear: none;
  cursor: pointer;
  display: inline-block;
  line-height: 1rem;
  margin: -0.25rem 0.25rem 0 0;
  outline: 0;
  padding: 0 !important;
  text-align: center;
  vertical-align: middle;
  width: 1rem;
  min-width: 1rem;
  transition: 0.05s border-color ease-in-out;
}

/* Field list row checkboxes: show WP-style tick when checked (base rule kept background #fff). */
.jwcfe-wrap td.td_select input[type="checkbox"],
.jwcfe-wrap #jwcfe_checkout_fields .check-column input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  min-width: 1.125rem;
  min-height: 1.125rem;
}

.jwcfe-wrap td.td_select input[type="checkbox"]:checked,
.jwcfe-wrap #jwcfe_checkout_fields .check-column input[type="checkbox"]:checked {
  background: #2271b1;
  border-color: #2271b1;
}

/* .jwcfe-wrap td.td_select input[type="checkbox"]:checked::before,
.jwcfe-wrap #jwcfe_checkout_fields .check-column input[type="checkbox"]:checked::before {
  content: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20fill%3D%27%23fff%27%20d%3D%27M9%2016.2L4.8%2012l-1.4%201.4L9%2019%2021%207l-1.4-1.4L9%2016.2z%27%2F%3E%3C%2Fsvg%3E");
  margin: -0.1875rem -0.25rem;
  height: 1.3125rem;
  width: 1.3125rem;
  display: inline-block;
  vertical-align: middle;
} */
.jwcfe-wrap td.td_select input[type="checkbox"]:checked::before, .jwcfe-wrap #jwcfe_checkout_fields .check-column input[type="checkbox"]:checked::before {
  content: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20fill%3D%27%23fff%27%20d%3D%27M9%2016.2L4.8%2012l-1.4%201.4L9%2019%2021%207l-1.4-1.4L9%2016.2z%27%2F%3E%3C%2Fsvg%3E");
  /* margin: -0.1875rem -0.25rem; */
  height: 21px;
  width: 17px;
  display: inline-block;
  vertical-align: middle;
  margin-left: 0px;
  margin-top: -1px;
  padding: 0px;
}

.custom-textarea-css {
  padding: 10px !important;
  margin-top: 5px !important;
  box-sizing: border-box !important;
  line-height: 1.5 !important;
  resize: vertical !important;
  width: 100%;
  height: 30px;
  padding: 5px 10px;
  border: 1px solid #dcdcde;
  font-size: 13px;
  border-radius: 4px;
  box-sizing: border-box;
}

.custom-scroll-option {
  padding-right: 15px;
}

.custom-jwcfe-options {
  height: 110px !important;
}

.custom-textarea {
  padding-top: 10px;
}

.jwcfe-wrap .circle {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #ddd;
  display: inline-block;
  margin-left: 5px;
}

.custom-header {
  display: flex;
  flex-flow: nowrap;
  flex: 100%;
  align-items: center;
  margin-bottom: 16px;
}

.custom-header h2 {
  font-size: 20px;
  color: #1e1e1e;
  font-weight: 700;
  margin: 0;
}

.custom-header .circle {
  width: 5px;
  height: 5px;
  background-color: #bbb;
  margin-top: 6px;
  text-align: center;
  margin-left: 15px;
}

.custom-header .other-tabs {
  margin-left: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #a5a5a5;
}

.jwcfe_condition_set_row .jwcfe_condition_set thead td {
  padding: 8px;
  background: white;
}

.jwcfe_condition_set_row .jwcfe_condition_set tbody .jwcfe_condition .thpladmin_rule_operand .select2.select2-container {
  width: 100% !important;
  max-width: 100% !important;
}

#jwcfe_checkout_fields {
  margin-top: 10px;
}

#jwcfe_checkout_fields tbody .description {
  display: none;
  color: #999;
}

.jwcfe-wrap .field-type,
.jwcfe-wrap .field-options,
.jwcfe-wrap span.na,
.jwcfe-wrap .field-validation {
  text-align: center;
  color: #aaa;
}

.jwcfe-wrap .field-type select,
.jwcfe-wrap .field-options select,
.jwcfe-wrap span.na select,
.jwcfe-wrap .field-validation select,
.jwcfe-wrap .field-type div,
.jwcfe-wrap .field-options div,
.jwcfe-wrap span.na div,
.jwcfe-wrap .field-validation div,
.jwcfe-wrap .field-type input,
.jwcfe-wrap .field-options input,
.jwcfe-wrap span.na input,
.jwcfe-wrap .field-validation input {
  text-align: left;
}

.jwcfe-wrap span.na {
  display: block;
}

.jwcfe-wrap .clear {
  text-align: center;
}

.jwcfe-wrap table.wc_emails tr:nth-child(odd) td,
.jwcfe-wrap table.wc_gateways tr:nth-child(odd) td,
.jwcfe-wrap table.wc_shipping tr:nth-child(odd) td {
  background: white;
}

.jwcfe-wrap .squeezer table tbody ul li {
  text-align: left;
}

#jwcfe_checkout_fields strong.core-field {
  color: #a4688d;
}

#jwcfe_checkout_fields tbody input.input-text,
#jwcfe_checkout_fields tbody td select {
  width: 100%;
}

#jwcfe_checkout_fields .check-column {
  padding: 7px 0 7px 14px;
}

/* ============================================================
   SECTION CARD HEADER — Reference Design (all sections on one page)
   ============================================================ */
.jwcfe-section-card {
  background: #fff;
  border: 1px solid #dcdcde;
  /* border-radius: 8px 8px 0 0; */
  border-bottom: none;
  margin-top: 24px;
}

.jwcfe-section-card:first-of-type {
  margin-top: 0;
}

.jwcfe-section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
}

.jwcfe-section-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #1e1e1e;
}

.jwcfe-section-icon {
  display: flex;
  align-items: center;
}

.jwcfe-active-badge {
  display: inline-block;
  background: #f0f6ff;
  color: #2271b1;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  border: 1px solid #c8dff7;
  margin-left: 2px;
}

.jwcfe-section-card-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.jwcfe-drag-hint {
  font-size: 12px;
  color: #aaa;
  letter-spacing: 0.2px;
}

.jwcfe-add-field-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  background: #fff !important;
  border: 1px solid #2271b1 !important;
  color: #2271b1 !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 5px 13px !important;
  border-radius: 5px !important;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  text-decoration: none;
}

.jwcfe-add-field-btn:hover {
  background: #2271b1 !important;
  color: #fff !important;
}

.jwcfe-add-field-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Table connected flush to section card */
table.jwcfe-fields-table {
  border-radius: 0 0 8px 8px !important;
  border-top: 1px solid #dcdcde !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* ============================================================
   BOTTOM SAVE BAR
   ============================================================ */
.jwcfe-bottom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 8px;
}

/* Top bar — same layout, no top margin, bottom margin instead */
.jwcfe-top-bar {
  margin-top: 16px !important;
  margin-bottom: 16px;
  /* border-left: 4px solid #2271b1; */
  background: #ffffff;
  border: 1px solid #dcdcde;
  border-radius: 8px;

}

.jwcfe-save-group {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.jwcfe-save-btn {
  background: #2271b1 !important;
  color: #fff !important;
  border-color: #2271b1 !important;
  font-weight: 700 !important;
  padding: 6px 22px !important;
  border-radius: 5px !important;
  font-size: 13px !important;
  cursor: pointer;
}

.jwcfe-save-btn:hover {
  background: #135e96 !important;
  border-color: #135e96 !important;
}

/* Hide old section sub-nav tabs (billing/shipping/additional links) */
ul.jwcfe-sections {
  display: none !important;
}

/* ============================================================
   JWCFE — NEW MODERN POPUP DESIGN (matching reference images)
   ============================================================ */

/* Overlay */
.jwcfemodal {
  position: fixed;
  inset: 0;
  background: rgba(17, 30, 60, 0.50);
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

/* Modal box */
.jwcfe-modal-box {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  animation: jwcfeSlideIn 200ms ease;
  margin: auto;
}

@keyframes jwcfeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.jwcfe-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.jwcfe-modal-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jwcfe-modal-plus {
  font-size: 18px;
  font-weight: 700;
  color: #2271b1;
  line-height: 1;
}

.jwcfe-modal-header .ui-dialog-title {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #1a1a2e !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}

.jwcfe-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.jwcfe-modal-close:hover {
  color: #333;
  background: #f0f0f0;
}

/* Body — scrollable */
.jwcfe-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.jwcfe-modal-body::-webkit-scrollbar {
  width: 4px;
}

.jwcfe-modal-body::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.jwcfe-modal-body::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

/* Fix select2 inside modal */
.jwcfe-modal-body .select2-container {
  width: 100% !important;
}

.jwcfe-modal-body .select2-selection--multiple,
.jwcfe-modal-body .select2-selection--single {
  min-height: 40px !important;
  border: 1.5px solid #dde1e7 !important;
  border-radius: 7px !important;
  background: #f7f8fa !important;
  font-size: 13px !important;
  display: flex !important;
  align-items: center !important;
}

.jwcfe-modal-body .select2-selection--single .select2-selection__rendered {
  line-height: 38px !important;
  padding-left: 12px !important;
  color: #333 !important;
}

.jwcfe-modal-body .select2-selection__placeholder {
  color: #aaa !important;
}

.jwcfe-modal-body .select2-selection--single .select2-selection__arrow {
  height: 38px !important;
}

/* 2-column row */
.jwcfe-modal-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

/* 1-column row */
.jwcfe-modal-row-1col {
  margin-bottom: 14px;
}

/* Individual field wrapper */
.jwcfe-modal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Labels */
.jwcfe-modal-label {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  display: flex;
  align-items: center;
  gap: 4px;
}

.jwcfe-required {
  color: #e02424;
  font-weight: 700;
}

.jwcfe-modal-hint {
  font-weight: 400;
  color: #888;
  font-size: 11px;
}

.jwcfe-modal-tooltip-icon {
  color: #888;
  font-size: 13px;
  cursor: help;
}

/* Inputs */
.jwcfe-modal-input,
.jwcfe-modal-select,
.jwcfe-modal-textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  color: #333;
  background: #f7f8fa;
  border: 1.5px solid #dde1e7;
  border-radius: 7px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  line-height: 1.4;
}

.jwcfe-modal-input:focus,
.jwcfe-modal-select:focus,
.jwcfe-modal-textarea:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 3px rgba(30, 77, 232, 0.10);
  background: #fff;
}

.jwcfe-modal-select[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.jwcfe-modal-textarea {
  min-height: 80px;
  resize: vertical;
}

/* Divider before toggles */
.jwcfe-modal-divider {
  height: 1px;
  background: #eee;
  margin: 16px 0 14px;
}

/* Toggle rows */
.jwcfe-modal-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f7f8fa;
  border-radius: 8px;
  margin-bottom: 8px;
}

.jwcfe-modal-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jwcfe-modal-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
}

.jwcfe-modal-toggle-desc {
  font-size: 11px;
  color: #888;
}

/* iOS-style toggle switch */
.jwcfe-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.jwcfe-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.jwcfe-toggle-slider {
  position: absolute;
  inset: 0;
  background: #d0d5dd;
  border-radius: 24px;
  transition: background 0.2s;
}

.jwcfe-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.jwcfe-toggle-switch input:checked+.jwcfe-toggle-slider {
  background: #2271b1;
}

.jwcfe-toggle-switch input:checked+.jwcfe-toggle-slider::before {
  transform: translateX(20px);
}

/* Options block */
.jwcfe-modal-options-block {
  margin-bottom: 14px;
}

/* Footer */
.jwcfe-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #e8e8e8;
  background: #fff;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 1;
}

.jwcfe-modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  line-height: 1;
}

.jwcfe-modal-btn-cancel {
  background: #f0f0f0;
  color: #555;
}

.jwcfe-modal-btn-cancel:hover {
  background: #e0e0e0;
  color: #222;
}

.jwcfe-modal-btn-primary {
  background: #2271b1;
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 77, 232, 0.18);
}

.jwcfe-modal-btn-primary:hover {
  background: #135e96;
  box-shadow: 0 4px 14px rgba(30, 77, 232, 0.25);
}

/* Edit mode — title prefix */
.jwcfe-modal-header .ui-dialog-title.is-edit::before {
  content: '✏ ';
  font-size: 14px;
}

/* Responsive */
@media (max-width: 540px) {
  .jwcfe-modal-row-2col {
    grid-template-columns: 1fr;
  }

  .jwcfe-modal-box {
    height: 95vh;
    max-height: 95vh;
    border-radius: 8px;
  }
}

/* jwcfe_popup_wrapper + form must be flex column to allow body scroll & footer pin */
.jwcfe_popup_wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.jwcfe_popup_wrapper form#jwcfe_new_field_form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ============================================================
   JWCFE — ACCORDION SECTIONS
   ============================================================ */

/* Accordion wrapper — groups header + table */
.jwcfe-accordion-wrapper {
  margin-bottom: 20px;
  border: 1px solid #e2e4e7;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

/* Section card becomes the clickable trigger */
.jwcfe-accordion-trigger {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  border: none !important;
  border-radius: 0 !important;
  margin-bottom: 0 !important;
  transition: background 0.15s;
}

.jwcfe-accordion-trigger:hover {
  background: #f0f4ff !important;
}

/* Chevron icon */
.jwcfe-accordion-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #555;
  transition: transform 0.25s ease;
  margin-right: 2px;
}

.jwcfe-accordion-chevron svg {
  display: block;
  transition: transform 0.25s ease;
}

/* Rotate chevron when collapsed */
.jwcfe-accordion-wrapper:not(.jwcfe-accordion-open) .jwcfe-accordion-chevron svg {
  transform: rotate(-90deg);
}

/* Accordion body — the collapsible part */
.jwcfe-accordion-body {
  overflow: hidden;
  max-height: 9999px;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  opacity: 1;
}

/* Collapsed state */
.jwcfe-accordion-wrapper:not(.jwcfe-accordion-open) .jwcfe-accordion-body {
  max-height: 0 !important;
  opacity: 0;
}

/* Remove table top border since accordion wrapper provides it */
.jwcfe-accordion-wrapper .jwcfe-fields-table {
  border: none !important;
  border-top: 1px solid #e2e4e7 !important;
  border-radius: 0 !important;
  margin-bottom: 0 !important;
}

/* Header stays full-width inside wrapper */
.jwcfe-accordion-wrapper .jwcfe-section-card {
  margin-bottom: 0 !important;
  border: none !important;
  background: #fff;
  border-radius: 0 !important;
}

.jwcfe-accordion-wrapper .jwcfe-section-card-header {
  padding: 14px 18px !important;
}

/* Active-badge spacing adjustment */
.jwcfe-accordion-wrapper .jwcfe-section-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Highlight open state header slightly */
.jwcfe-accordion-wrapper.jwcfe-accordion-open>.jwcfe-section-card {
  border-bottom: 1px solid #e2e4e7 !important;
  background: #f8faff !important;
}

/* Remove bottom margin from table inside wrapper */
.jwcfe-accordion-body table {
  margin-bottom: 0 !important;
}


/* ============================================================
   JWCFE — ADVANCED SETTINGS PAGE — Modern Design
   ============================================================ */

.jwcfe-adv-page {
  max-width: 760px;
  padding: 24px 0 32px;
}

/* ── Card ── */
.jwcfe-adv-card {
  background: #fff;
  border: 1px solid #e2e4e7;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* ── Card Header ── */
.jwcfe-adv-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px 18px;
  border-bottom: 1px solid #f0f0f0;
  background: #f8faff;
}

.jwcfe-adv-card-header-icon {
  width: 42px;
  height: 42px;
  background: #e8eefb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e4de8;
  flex-shrink: 0;
}

.jwcfe-adv-card-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #1a1a2e !important;
  margin: 0 0 3px !important;
  padding: 0 !important;
  border: none !important;
}

.jwcfe-adv-card-subtitle {
  font-size: 12px;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

/* ── Section label ── */
.jwcfe-adv-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  padding: 14px 22px 8px;
}

/* ── Toggle list ── */
.jwcfe-adv-toggle-list {
  padding: 0 22px 8px;
}

.jwcfe-adv-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid #f4f4f4;
}

.jwcfe-adv-toggle-row:last-child {
  border-bottom: none;
}

.jwcfe-adv-toggle-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.jwcfe-adv-toggle-icon {
  width: 34px;
  height: 34px;
  background: #f0f4ff;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e4de8;
  flex-shrink: 0;
}

.jwcfe-adv-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jwcfe-adv-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.4;
}

.jwcfe-adv-toggle-desc {
  font-size: 11px;
  color: #888;
  line-height: 1.4;
}

/* ── iOS Toggle Switch ── */
.jwcfe-adv-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}

.jwcfe-adv-switch input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
  -webkit-appearance: none !important;
}

.jwcfe-adv-slider {
  position: absolute;
  inset: 0;
  background: #d0d5dd;
  border-radius: 24px;
  transition: background 0.2s;
  cursor: pointer;
}

.jwcfe-adv-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.jwcfe-adv-switch input[type="checkbox"]:checked+.jwcfe-adv-slider {
  background: #1e4de8;
}

.jwcfe-adv-switch input[type="checkbox"]:checked+.jwcfe-adv-slider::before {
  transform: translateX(20px);
}

/* ── Card Footer (buttons) ── */
.jwcfe-adv-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}

.jwcfe-adv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  line-height: 1.4;
  text-decoration: none !important;
}

.jwcfe-adv-btn-primary {
  background: #1e4de8;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(30, 77, 232, 0.18);
}

.jwcfe-adv-btn-primary:hover {
  background: #1640c7;
  box-shadow: 0 4px 14px rgba(30, 77, 232, 0.25);
  color: #fff !important;
}

.jwcfe-adv-btn-secondary {
  background: #f0f0f0;
  color: #555 !important;
}

.jwcfe-adv-btn-secondary:hover {
  background: #e0e0e0;
  color: #222 !important;
}

/* ── Import/Export body ── */
.jwcfe-adv-import-body {
  padding: 16px 22px;
}

.jwcfe-adv-import-info {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  color: #555;
  background: #f0f4ff;
  border: 1px solid #d8e2fb;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0 0 14px;
  line-height: 1.5;
}

.jwcfe-adv-import-info svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #1e4de8;
}

.jwcfe-adv-textarea {
  width: 100%;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 11px;
  line-height: 1.6;
  color: #333;
  background: #f7f8fa;
  border: 1.5px solid #dde1e7;
  border-radius: 7px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 110px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.jwcfe-adv-textarea:focus {
  outline: none;
  border-color: #1e4de8;
  box-shadow: 0 0 0 3px rgba(30, 77, 232, 0.10);
  background: #fff;
}