/* BB Forms / Balance — v0.1.0
   Design tokens are shared across ALL forms opt-in via .bb-form-shell.
   No #gform_wrapper_265 or #field_265_N selectors. No Avada/global selectors.
   Optimized for Gravity Forms Orbital; native legacy fallback for essentials. */

.bb-form-shell {
  --bb-ink: #1e2923;
  --bb-muted: #58695f;
  --bb-line: #dce6dd;
  --bb-accent: #176149;
  --bb-hover: #f3f8f4;
  --bb-selected: #eaf5ed;
  --bb-error: #9b3129;
  --bb-shadow: 0 14px 34px rgba(33, 53, 42, .045);
  --bb-radius: 16px;
  --bb-field-radius: 10px;
  --bb-tile-radius: 12px;
  --bb-space-sm: 10px;
  --bb-space-md: 18px;
  --bb-space-lg: 30px;
  --bb-font: 'Montserrat', Arial, sans-serif;
  container-type: inline-size;
  box-sizing: border-box;
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  padding: clamp(20px, 4vw, 44px);
  border: 1px solid #e0e8e1;
  border-radius: var(--bb-radius);
  box-shadow: var(--bb-shadow);
  background: #fff;
  color: var(--bb-ink);
  font-family: var(--bb-font);
  font-size: 15px;
  line-height: 1.5;
}
.bb-form-shell *, .bb-form-shell *::before, .bb-form-shell *::after { box-sizing: border-box; }
.bb-form-shell .bb-form-header { margin-bottom: 27px; }
.bb-form-shell .bb-form-header h2 { margin: 0; padding: 0; font-family: var(--bb-font); font-weight: 700; letter-spacing: -.028em; font-size: clamp(22px, 3vw, 28px); line-height: 1.23; color: var(--bb-ink); }
.bb-form-shell .gform_wrapper, .bb-form-shell .gform-theme--framework {
  --gf-color-primary: var(--bb-accent);
  --gf-ctrl-accent-color: var(--bb-accent);
  --gf-ctrl-radius: var(--bb-field-radius);
  --gf-form-gap-y: 23px;
  --gf-field-gap-y: 12px;
  --gf-ctrl-font-family: var(--bb-font);
  --gf-ctrl-label-color-primary: var(--bb-ink);
  --gf-ctrl-label-color-secondary: var(--bb-ink);
  --gf-ctrl-font-size: 15px;
  --gf-ctrl-label-font-size-primary: 15px;
  --gf-ctrl-desc-color: var(--bb-muted);
  --gf-ctrl-desc-font-size: 13px;
  color: var(--bb-ink);
  font-family: var(--bb-font);
}
.bb-form-shell .gform_wrapper .gform_heading { display: none; }
.bb-form-shell .gfield { min-width: 0; }
.bb-form-shell .gfield_label, .bb-form-shell .gform-field-label--type-sub, .bb-form-shell .gfield .gform-field-label {
  font-family: var(--bb-font);
  color: var(--bb-ink);
}
.bb-form-shell .gfield .gfield_label { font-size: 15px; line-height: 1.38; font-weight: 650; margin-block: 0 10px; letter-spacing: -.01em; }
.bb-form-shell .gfield_description, .bb-form-shell .gform-field-label--type-sub { color: var(--bb-muted); font-size: 13px; }
.bb-form-shell .gfield input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]),
.bb-form-shell .gfield select, .bb-form-shell .gfield textarea {
  min-width: 0; max-width: 100%; min-height: 50px; border: 1px solid #cddbd0; border-radius: var(--bb-field-radius);
  background: #fff; color: var(--bb-ink); box-shadow: none; font-family: var(--bb-font); font-size: 15px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.bb-form-shell .gfield textarea { min-height: 122px; resize: vertical; }
.bb-form-shell .gfield input:not([type=checkbox]):not([type=radio]):focus,
.bb-form-shell .gfield textarea:focus, .bb-form-shell .gfield select:focus {
  border-color: var(--bb-accent); outline: 2px solid rgba(23, 97, 73, .22); outline-offset: 1px;
}
.bb-form-shell .gfield input::placeholder, .bb-form-shell .gfield textarea::placeholder { color: #617369; opacity: 1; }
/* Choices: attach bb-choice-cards / bb-product-cards / bb-choice-compact in GF Advanced > CSS Class */
.bb-form-shell .bb-choice-cards .gfield_radio, .bb-form-shell .bb-choice-cards .gfield_checkbox,
.bb-form-shell :is(.bb-product-cards, .bb-fzv-test-products) .gfield_checkbox,
.bb-form-shell .bb-choice-compact .gfield_radio, .bb-form-shell .bb-choice-compact .gfield_checkbox {
  display: grid !important; gap: 10px !important; padding: 0 !important; margin: 0 !important;
  list-style: none; grid-template-columns: repeat(2, minmax(0,1fr));
}
.bb-form-shell :is(.bb-product-cards, .bb-fzv-test-products) .gfield_checkbox { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px !important; }
.bb-form-shell .bb-choice-compact .gfield_radio,
.bb-form-shell .bb-choice-compact .gfield_checkbox { grid-template-columns: repeat(2,minmax(0,1fr)); }
.bb-form-shell .bb-choice-cards .gchoice, .bb-form-shell :is(.bb-product-cards, .bb-fzv-test-products) .gchoice, .bb-form-shell .bb-choice-compact .gchoice {
  position: relative; min-width: 0; margin: 0 !important; padding: 0 !important; isolation: isolate; 
}
.bb-form-shell .bb-choice-cards .gchoice > input[type=radio], .bb-form-shell .bb-choice-cards .gchoice > input[type=checkbox],
.bb-form-shell :is(.bb-product-cards, .bb-fzv-test-products) .gchoice > input[type=checkbox], .bb-form-shell .bb-choice-compact .gchoice > input[type=radio],
.bb-form-shell .bb-choice-compact .gchoice > input[type=checkbox] {
  position: absolute !important; width: 1px !important; height: 1px !important;
  opacity: 0 !important; overflow: hidden; margin: 0 !important;
}
.bb-form-shell .bb-choice-cards .gchoice > label, .bb-form-shell :is(.bb-product-cards, .bb-fzv-test-products) .gchoice > label,
.bb-form-shell .bb-choice-compact .gchoice > label {
  display: flex !important; align-items: center; justify-content: space-between; gap: 12px;
  width: 100% !important; max-width: none !important; min-height: 60px; margin: 0 !important;
  padding: 13px 15px !important; border: 1px solid var(--bb-line); border-radius: var(--bb-tile-radius);
  background: #fff; color: var(--bb-ink); font-family: var(--bb-font); font-size: 14px !important;
  font-weight: 600 !important; line-height: 1.4; text-align: left; cursor: pointer;
  white-space: normal; overflow-wrap: normal; word-break: normal; hyphens: none;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.bb-form-shell :is(.bb-product-cards, .bb-fzv-test-products) .gchoice > label { min-height: 56px; padding: 12px 14px !important; font-size: 13px !important; }
.bb-form-shell .bb-choice-compact .gchoice > label { min-height: 52px; }
/* Draw selection affordance using CSS geometry: unselected ring, selected filled dot. */
.bb-form-shell .bb-choice-cards .gchoice > label::after, .bb-form-shell :is(.bb-product-cards, .bb-fzv-test-products) .gchoice > label::after,
.bb-form-shell .bb-choice-compact .gchoice > label::after {
  content: ''; width: 19px; height: 19px; border: 1.6px solid #8ca299; border-radius: 50%;
  background: transparent; flex: 0 0 19px; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.bb-form-shell .bb-choice-cards .gchoice:hover > label, .bb-form-shell :is(.bb-product-cards, .bb-fzv-test-products) .gchoice:hover > label,
.bb-form-shell .bb-choice-compact .gchoice:hover > label { background: var(--bb-hover); border-color: #acc8b7; }
.bb-form-shell .bb-choice-cards .gchoice:has(input:checked) > label,
.bb-form-shell :is(.bb-product-cards, .bb-fzv-test-products) .gchoice:has(input:checked) > label,
.bb-form-shell .bb-choice-compact .gchoice:has(input:checked) > label,
.bb-form-shell .gchoice.bb-is-checked > label {
  background: var(--bb-selected); border-color: var(--bb-accent); box-shadow: 0 2px 10px rgba(21, 85, 59, .035);
}
.bb-form-shell .bb-choice-cards .gchoice:has(input:checked) > label::after,
.bb-form-shell :is(.bb-product-cards, .bb-fzv-test-products) .gchoice:has(input:checked) > label::after,
.bb-form-shell .bb-choice-compact .gchoice:has(input:checked) > label::after,
.bb-form-shell .gchoice.bb-is-checked > label::after {
  background: var(--bb-accent); border-color: var(--bb-accent); box-shadow: inset 0 0 0 4px var(--bb-selected);
}
.bb-form-shell .gchoice > input:focus-visible + label { outline: 3px solid #7eb6a0 !important; outline-offset: 2px; }
/* Plain legal checkboxes retain visible native inputs; never style as selection tiles. */
.bb-form-shell .bb-legal .gfield_checkbox, .bb-form-shell .bb-legal .gfield_radio { display: grid; gap: 12px; }
.bb-form-shell .bb-legal .gchoice { display: flex; gap: 10px; align-items: start; }
.bb-form-shell .bb-legal .gchoice > input { accent-color: var(--bb-accent); width: 19px; height: 19px; margin-top: 3px; }
.bb-form-shell .bb-legal .gchoice > label { max-width: none; font-size: 13px; font-weight: 450; line-height: 1.65; }
.bb-form-shell .bb-legal a { color: var(--bb-accent); text-decoration: underline; text-underline-offset: 3px; }
.bb-form-shell .gform_page_footer, .bb-form-shell .gform_footer {
  display: flex !important; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px;
  margin-top: 28px !important; padding-top: 23px !important; border-top: 1px solid #e4ebe5;
}
.bb-form-shell .gform_page_footer .gform_previous_button { margin-right: auto !important; }
.bb-form-shell .gform_page_footer button, .bb-form-shell .gform_footer button,
.bb-form-shell .gform_page_footer input[type=button], .bb-form-shell .gform_footer input[type=submit] {
  min-height: 50px; min-width: 114px; margin: 0 !important; padding: 12px 23px !important;
  border-radius: 10px !important; font-family: var(--bb-font); font-size: 14px !important; font-weight: 650 !important;
  background: var(--bb-accent); border: 1px solid var(--bb-accent); color: #fff !important; cursor: pointer;
}
.bb-form-shell .gform_page_footer input.gform_previous_button { background: #fff !important; color: var(--bb-accent) !important; border-color: #b5cabc; }
.bb-form-shell .gform_page_footer input:hover, .bb-form-shell .gform_footer input[type=submit]:hover { filter: brightness(.96); }
.bb-form-shell .gform_page_footer input:focus-visible, .bb-form-shell .gform_footer input:focus-visible { outline: 3px solid #80b5a0; outline-offset: 3px; }
.bb-form-shell .gfield_error input, .bb-form-shell .gfield_error textarea,
.bb-form-shell .gfield_error select { border-color: var(--bb-error) !important; }
.bb-form-shell .validation_message, .bb-form-shell .gform_validation_errors {
  color: var(--bb-error); font-size: 13px; line-height: 1.5;
}
.bb-form-shell .gform_validation_errors { border: 1px solid #ead0cd; border-radius: 12px; background: #fff9f8; padding: 16px; }
.bb-form-shell .gfield .ginput_container_fileupload input[type=file] { width:100%; border:1px dashed #9ebbac; border-radius:12px; padding:22px 16px; background:#f9fbf9; max-width:100%; }
.bb-form-shell .gfield--type-signature .ginput_container, .bb-form-shell .bb-signature .ginput_container { max-width:100%; }
.bb-form-shell .gfield--type-signature canvas, .bb-form-shell .bb-signature canvas { max-width:100%; border-radius:9px; }
.bb-form-shell .gform_page { min-width: 0; }
.bb-form-shell .gform_wrapper .gform_title { display:none; }
.bb-form-shell ::selection { background: #d2eddd; color: #173727; }
@container (max-width: 720px) {
  .bb-form-shell :is(.bb-product-cards, .bb-fzv-test-products) .gfield_checkbox { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@container (max-width: 620px) {
  .bb-form-shell .bb-choice-cards .gfield_radio, .bb-form-shell .bb-choice-cards .gfield_checkbox,
  .bb-form-shell :is(.bb-product-cards, .bb-fzv-test-products) .gfield_checkbox,
  .bb-form-shell .bb-choice-compact .gfield_radio, .bb-form-shell .bb-choice-compact .gfield_checkbox {
    grid-template-columns: minmax(0,1fr);
  }
  .bb-form-shell .bb-choice-cards .gchoice > label, .bb-form-shell :is(.bb-product-cards, .bb-fzv-test-products) .gchoice > label { min-height: 54px; font-size: 14px !important; }
}
@media (max-width: 600px) {
  .bb-form-shell { padding: 17px 12px 22px; border-radius: 12px; }
  .bb-form-shell .bb-form-header { margin-bottom: 22px; }
  .bb-form-shell .bb-form-header h2 { font-size: 22px; letter-spacing: -.025em; }
  .bb-form-shell .gform_page_footer, .bb-form-shell .gform_footer { padding-top: 20px !important; }
  .bb-form-shell .gform_page_footer input[type=button], .bb-form-shell .gform_footer input[type=submit] { min-height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  .bb-form-shell *, .bb-form-shell *::before, .bb-form-shell *::after { transition: none !important; animation: none !important; }
}

/* ================================================================
   Designmaster B v0.2: width-aware GF choice grids.
   The Avada column is not a reliable proxy for actual form width.
   Measure the .bb-form-shell itself. Scales from 1 -> 2 -> 3 columns.
   All rules scoped and independent of Gravity Forms numeric IDs.
   ================================================================ */
.bb-form-shell .gform_wrapper :is(.bb-choice-cards, .bb-product-cards, .bb-fzv-test-products, .bb-choice-compact) :is(.gfield_radio, .gfield_checkbox) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  flex-direction: unset !important;
  align-items: stretch !important;
}
.bb-form-shell .gform_wrapper :is(.bb-choice-cards, .bb-product-cards, .bb-fzv-test-products, .bb-choice-compact) :is(.gfield_radio, .gfield_checkbox) > .gchoice {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
}
.bb-form-shell .gform_wrapper :is(.bb-choice-cards, .bb-product-cards, .bb-fzv-test-products, .bb-choice-compact) .gchoice > label {
  width: 100% !important;
  max-width: none !important;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}
/* Category/details can sit side-by-side from 460px available form width. */
@container (min-width: 460px) {
  .bb-form-shell .gform_wrapper :is(.bb-choice-cards, .bb-choice-compact) :is(.gfield_radio, .gfield_checkbox) {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  }
}
/* Product names need more width than short category names. */
@container (min-width: 510px) {
  .bb-form-shell .gform_wrapper :is(.bb-product-cards, .bb-fzv-test-products) .gfield_checkbox {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  }
}
@container (min-width: 800px) {
  .bb-form-shell .gform_wrapper :is(.bb-product-cards, .bb-fzv-test-products) .gfield_checkbox {
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
  }
}
/* Related inline errors; GF's server validation messages are left untouched. */
.bb-form-shell .bb-live-error {
  display: block;
  color: #9b3129;
  font-family: var(--bb-font);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 5px;
}
.bb-form-shell input.bb-input-invalid,
.bb-form-shell select.bb-input-invalid {
  border-color: #a0322b !important;
  background-color: #fffafa !important;
}
.bb-form-shell .bb-input-invalid:focus-visible {
  outline: 2px solid #c65e55 !important;
  outline-offset: 2px;
}
.bb-form-shell .bb-detail-all .gchoice[hidden] {display:none !important;}
/* No unnecessary decoration or shadow around contextless validation alerts. */

/* BB Forms Designmaster B v0.3.0 — semantic components, independent of GF IDs. */
.bb-form-shell .gfield[data-bb-concealed="true"] { display: none !important; }
.bb-form-shell .bb-detail-all .gchoice[hidden] { display: none !important; }

/* Native radio controls for small choices, never 60px selection tiles. */
.bb-form-shell :is(.bb-salutation, .bb-urgency) .gfield_radio {
  display: flex !important; flex-wrap: wrap; gap: 10px 22px !important;
  align-items: center !important; grid-template-columns: none !important;
}
.bb-form-shell :is(.bb-salutation, .bb-urgency) .gchoice {
  display: flex !important; align-items: center; gap: 7px; flex: 0 0 auto;
  width: auto !important; min-width: 0;
}
.bb-form-shell :is(.bb-salutation, .bb-urgency) .gchoice input[type="radio"] {
  position: static !important; width: 19px !important; height: 19px !important;
  opacity: 1 !important; overflow: visible !important; margin: 0 !important;
  appearance: auto !important; accent-color: var(--bb-accent);
}
.bb-form-shell :is(.bb-salutation, .bb-urgency) .gchoice label {
  display: inline-flex !important; padding: 6px 2px !important; min-height: 38px !important;
  width: auto !important; height: auto !important; border: 0 !important;
  border-radius: 0 !important; background: transparent !important;
  box-shadow: none !important; font-size: 14px !important; font-weight: 500 !important;
}
.bb-form-shell :is(.bb-salutation, .bb-urgency) .gchoice label::after { display: none !important; }

/* Optional exception checkboxes. Keep actual native checkbox and inline label. */
.bb-form-shell .bb-plain-choice .gfield_checkbox {
  display: flex !important; flex-direction: column !important; gap: 8px !important;
  grid-template-columns: none !important; align-items: flex-start !important;
}
.bb-form-shell .bb-plain-choice .gchoice { display: flex !important; align-items: center; gap: 10px; }
.bb-form-shell .bb-plain-choice .gchoice input[type="checkbox"] {
  appearance: auto !important; position: static !important; opacity: 1 !important;
  width: 19px !important; height: 19px !important; margin: 0 !important;
  overflow: visible !important; accent-color: var(--bb-accent);
}
.bb-form-shell .bb-plain-choice .gchoice > label {
  display: inline !important; width: auto !important; max-width: 100% !important;
  min-height: 0 !important; padding: 0 !important; background: none !important;
  border: 0 !important; box-shadow: none !important;
  font-size: 14px !important; font-weight: 500 !important;
}
.bb-form-shell .bb-plain-choice .gchoice > label::after { display: none !important; }

/* Native Gravity Forms 12-column field grid: trio on one line when form itself is wide. */
.bb-form-shell .gform_fields { align-items: start; }
.bb-form-shell .bb-coinsured-data { min-width: 0; }
@container (min-width: 590px) {
  .bb-form-shell .gform_fields > .gfield.bb-coinsured-data {
    grid-column: span 4 !important;
  }
}
@container (max-width: 589px) {
  .bb-form-shell .gform_fields > .gfield.bb-coinsured-data {
    grid-column: 1 / -1 !important;
  }
}
.bb-form-shell .bb-coinsured-data .gfield_label { min-height: 21px; }

/* Two equal-height broker choices regardless of the different copy lengths. */
.bb-form-shell .bb-broker .gfield_radio { align-items: stretch !important; }
.bb-form-shell .bb-broker .gchoice { align-self: stretch !important; }
.bb-form-shell .bb-broker .gchoice > label {
  min-height: 96px !important; height: 100% !important;
  align-items: center !important;
}
.bb-form-shell .bb-broker-note {
  padding: 16px 18px; border-radius: 10px;
  background: #f3f6f4; color: var(--bb-ink); border: 1px solid var(--bb-line);
}
.bb-form-shell .bb-broker-note p { margin: 0; }
.bb-form-shell[data-bb-broker-external="true"] .gform_page_footer :is(.gform_button, input[type="submit"],button[type="submit"]) { display: none !important; }

/* Accessible, unmistakable native page navigation. Icons are inline SVG data URLs. */
.bb-form-shell .gform_page_footer :is(input.gform_next_button,button.gform_next_button),
.bb-form-shell .gform_page_footer :is(input.gform_button,button.gform_button),
.bb-form-shell .gform_footer :is(input.gform_button,button.gform_button) {
  display: inline-block !important;
  min-height: 52px !important; min-width: 148px !important;
  padding: 12px 49px 12px 24px !important;
  border: 1px solid #176149 !important; border-radius: 10px !important;
  color: #fff !important; background-color: #176149 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16m-7-7 7 7-7 7'/%3E%3C/svg%3E") !important;
  background-position: right 18px center !important; background-repeat: no-repeat !important;
  box-shadow: 0 4px 11px rgba(23,97,73,.12) !important;
  font-size: 14px !important; font-weight: 650 !important; letter-spacing: .005em;
}
.bb-form-shell .gform_page_footer :is(input.gform_previous_button,button.gform_previous_button) {
  display: inline-block !important; margin-right: auto !important;
  min-height: 52px !important; min-width: 118px !important;
  padding: 12px 17px 12px 40px !important;
  color: #176149 !important; background-color: #fff !important;
  border: 1px solid #b9cfc1 !important; border-radius: 10px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23176149' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12H4m7-7-7 7 7 7'/%3E%3C/svg%3E") !important;
  background-position: left 14px center !important; background-repeat: no-repeat !important;
  box-shadow: none !important; font-weight: 600 !important;
}
.bb-form-shell .gform_page_footer :is(input.gform_next_button,button.gform_next_button):hover,
.bb-form-shell .gform_page_footer :is(input.gform_button,button.gform_button):hover { background-color: #10523d !important; }
.bb-form-shell .gform_page_footer :is(input.gform_previous_button,button.gform_previous_button):hover { background-color: #f4faf6 !important; }
@container (max-width: 420px) {
  .bb-form-shell .gform_page_footer { gap: 8px !important; flex-wrap: nowrap !important; }
  .bb-form-shell .gform_page_footer :is(input.gform_previous_button,button.gform_previous_button) {
    min-width: 108px !important; padding-left: 37px !important; padding-right: 10px !important;
  }
  .bb-form-shell .gform_page_footer :is(input.gform_next_button,button.gform_next_button),
  .bb-form-shell .gform_page_footer :is(input.gform_button,button.gform_button) {
    min-width: 130px !important; padding-left: 14px !important; padding-right: 41px !important;
  }
}

/* Main category icons are part of the affordance, not a separate action. */
.bb-form-shell .bb-category-choice .gchoice > label::after { display: none !important; }
.bb-form-shell .bb-category-choice .bb-choice-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; min-width: 36px;
  color: #496b59; background: #f3f7f4; border-radius: 10px;
  transition: background .16s ease, color .16s ease;
}
.bb-form-shell .bb-category-choice .bb-choice-icon svg {
  width: 21px; height: 21px; stroke: currentColor;
}
.bb-form-shell .bb-category-choice .gchoice.bb-is-checked .bb-choice-icon,
.bb-form-shell .bb-category-choice .gchoice:has(input:checked) .bb-choice-icon {
  color: white; background: var(--bb-accent);
}
