/* ================================================================
   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);
}

/* ==============================================================
   BB Forms v0.4.0: refine B, not a redesign.
   Opt-in scope; no numeric form IDs; responsive to its own width.
   ============================================================== */
.bb-form-shell .bb-form-header { margin-bottom: 20px; }
.bb-form-shell .gform_wrapper, .bb-form-shell .gform-theme--framework { --gf-form-gap-y: 25px; }
.bb-form-shell .bb-category-choice .gfield_label,
.bb-form-shell .bb-detail-all .gfield_label,
.bb-form-shell .bb-product-cards .gfield_label { font-size: 17px; font-weight: 680; margin-bottom: 11px; }
.bb-form-shell .bb-category-choice .gchoice > label {
  min-height: 86px !important; padding: 17px 17px !important;
  align-items: center; gap: 12px; border-radius: 13px;
}
.bb-form-shell .bb-detail-all .gchoice > label {
  min-height: 70px !important; padding: 12px 15px !important;
  border-radius: 10px; background: #fcfdfc;
}
.bb-form-shell .bb-tile-copy { display:flex; flex-direction:column; flex:1 1 auto; min-width:0; gap:5px; }
.bb-form-shell .bb-tile-title { display:block; font-size:14px; font-weight:650; line-height:1.35; }
.bb-form-shell .bb-tile-desc { display:block; font-size:12px; font-weight:450; line-height:1.45; color:#53695d; }
.bb-form-shell .gchoice:has(input:checked) .bb-tile-desc { color:#355b49; }
.bb-form-shell .bb-category-choice .gchoice > label::after { display:none !important; }
.bb-form-shell .bb-detail-all .gchoice > label::after { flex:0 0 17px; width:17px; height:17px; }
.bb-form-shell .bb-product-cards .gchoice > label { font-size:13px !important; font-weight:570 !important; min-height:54px; }
.bb-form-shell .bb-product-cards .gfield_description,
.bb-form-shell .bb-detail-all .gfield_description { font-size:12px; margin-bottom:5px; }
/* Tiny completed-selection summary replaces two large choice grids when the user has chosen a detail. */
.bb-form-shell .bb-category-summary { display:none; align-items:center; gap:13px; padding:14px 17px; border:1px solid #dce6dd;
  border-radius:11px; background:#f7faf8; width:100%; }
.bb-form-shell .bb-category-summary-copy { flex:1 1 auto; min-width:0; display:grid; gap:3px; }
.bb-form-shell .bb-category-summary-primary { font-size:14px; font-weight:675; line-height:1.35; }
.bb-form-shell .bb-category-summary-secondary { font-size:12px; color:var(--bb-muted); line-height:1.45; }
.bb-form-shell .bb-category-summary-edit { border:0; background:transparent; padding:8px; color:var(--bb-accent); font:600 12px var(--bb-font); text-decoration:underline; cursor:pointer; text-underline-offset:3px; }
.bb-form-shell .bb-category-choice[data-bb-condensed="true"] > .gfield_label,
.bb-form-shell .bb-category-choice[data-bb-condensed="true"] > .gfield_description,
.bb-form-shell .bb-category-choice[data-bb-condensed="true"] > .ginput_container { display:none !important; }
.bb-form-shell .bb-category-choice[data-bb-condensed="true"] .bb-category-summary { display:flex; }
.bb-form-shell .bb-detail-all[data-bb-condensed="true"] { display:none !important; }
/* Contextual identity, not a progress bar or full recap. */
.bb-form-shell .bb-form-context { display:none; flex-wrap:wrap; gap:6px 9px; align-items:center;
  margin-top:12px; padding:10px 12px; border-radius:9px; background:#f4f8f5; color:#42594c;
  font-size:12px; line-height:1.5; }
.bb-form-shell .bb-form-context[data-bb-visible="true"] { display:flex; }
.bb-form-shell .bb-form-context b { color:#1e3628; font-weight:700; }
.bb-form-shell .bb-form-context .bb-context-divider { color:#91a698; }
.bb-form-shell .bb-form-context .bb-context-products { margin-left:auto; color:#53695d; }
/* Segment groups for only short options; single native radio group remains accessible. */
.bb-form-shell :is(.bb-salutation, .bb-urgency).bb-segment .gfield_radio { display:flex !important; flex-wrap:nowrap !important; gap:0 !important; width:100%; align-items:stretch !important; border:1px solid #d0dfd4; border-radius:10px; overflow:hidden; }
.bb-form-shell :is(.bb-salutation, .bb-urgency).bb-segment .gchoice { display:flex !important; flex:1 1 0 !important; min-width:0; margin:0 !important; position:relative; }
.bb-form-shell :is(.bb-salutation, .bb-urgency).bb-segment .gchoice + .gchoice { border-left:1px solid #d0dfd4; }
.bb-form-shell :is(.bb-salutation, .bb-urgency).bb-segment .gchoice input[type="radio"] { position:absolute !important; width:1px !important; height:1px !important; opacity:0 !important; }
.bb-form-shell :is(.bb-salutation, .bb-urgency).bb-segment .gchoice > label {
  display:flex !important; align-items:center !important; justify-content:center !important; flex:1 1 auto !important;
  text-align:center !important; border:0 !important; border-radius:0 !important; background:#fff !important;
  padding:11px 9px !important; min-height:50px !important; margin:0 !important; width:100% !important;
  font:600 12px/1.35 var(--bb-font) !important; color:#324a3d !important; white-space:normal;
}
.bb-form-shell :is(.bb-salutation, .bb-urgency).bb-segment .gchoice:has(input:checked) > label,
.bb-form-shell :is(.bb-salutation, .bb-urgency).bb-segment .gchoice.bb-is-checked > label { background:#e8f4ed !important; color:#14543d !important; box-shadow:inset 0 0 0 1px var(--bb-accent) !important; }
.bb-form-shell :is(.bb-salutation, .bb-urgency).bb-segment .gchoice > input:focus-visible + label { outline:3px solid #71a58d !important; outline-offset:-3px; }
/* Real GF column spans, not layout tricks on input width. */
.bb-form-shell .gform_fields > :is(.bb-salutation, .bb-title, .bb-birth, .bb-email, .bb-mobile) { min-width:0; }
@container (min-width: 620px) {
  .bb-form-shell .gform_fields > .gfield.bb-salutation { grid-column:span 8 !important; }
  .bb-form-shell .gform_fields > .gfield.bb-title { grid-column:span 4 !important; }
  .bb-form-shell .gform_fields > .gfield.bb-birth { grid-column:span 3 !important; }
  .bb-form-shell .gform_fields > .gfield.bb-email { grid-column:span 5 !important; }
  .bb-form-shell .gform_fields > .gfield.bb-mobile { grid-column:span 4 !important; }
}
@container (min-width: 470px) and (max-width: 619px) {
  .bb-form-shell .gform_fields > .gfield.bb-salutation,
  .bb-form-shell .gform_fields > .gfield.bb-title,
  .bb-form-shell .gform_fields > .gfield.bb-mobile { grid-column:1 / -1 !important; }
  .bb-form-shell .gform_fields > .gfield.bb-birth { grid-column:span 5 !important; }
  .bb-form-shell .gform_fields > .gfield.bb-email { grid-column:span 7 !important; }
}
@container (max-width: 469px) {
  .bb-form-shell .gform_fields > :is(.bb-salutation, .bb-title, .bb-birth, .bb-email, .bb-mobile) { grid-column:1 / -1 !important; }
  .bb-form-shell :is(.bb-salutation,.bb-urgency).bb-segment .gchoice > label { padding:11px 6px !important; font-size:11px !important; }
}
/* Signature: don't CSS-transform or rescale the actual drawing canvas; the import's native field width is now 490. */
.bb-form-shell .bb-signature .ginput_container,
.bb-form-shell .bb-signature .gfield_signature_container { max-width:100%; }
.bb-form-shell .bb-signature :is(canvas, .jSignature, .gfield_signature_container) { border-radius:10px; }
.bb-form-shell .bb-signature .gfield_description { font-size:12px; }
.bb-form-shell .bb-upload-required .gfield_label { font-weight:670; }
.bb-form-shell .bb-upload-required .gfield_label::after { content:' · Nachweis erforderlich'; font-size:12px; color:#a03a32; font-weight:600; }
.bb-form-shell .bb-upload :is(.gfield_description,.gform-field-label--type-sub) { font-size:12px; }
@media (prefers-reduced-motion:reduce) { .bb-form-shell .gchoice > label { transition:none !important; } }
/* Fieldsets must not inherit UA outlines when Gravity Forms/Avada do not reset them. */
.bb-form-shell fieldset.gfield { border:0 !important; margin-inline:0 !important; padding:0 !important; min-width:0; }
.bb-form-shell .bb-category-choice[data-bb-condensed="true"] > :is(.gfield_radio,.ginput_container_radio,.ginput_container) { display:none !important; }
