/* KORA / Medspa Theme integration for Glow Theory Form Builder.
 * Radio + checkbox group labels are rendered as questions/headings when text exists.
 * Individual option labels remain normal controls. Empty group headings remain hidden. */

/* Generic heading class applied by the small frontend helper below. */
.gtfb-form .gtfb-choice-group-heading {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    inset: auto !important;
    float: none !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    white-space: normal !important;
    color: var(--medspa-heading-color, var(--medspa-navy, #1b1b1b)) !important;
    font-family: var(--medspa-body-font, var(--medspa-font, inherit)) !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* Progressive CSS-only support for common Glow Form markup, before JS runs. */
.gtfb-form fieldset:has(input[type="radio"], input[type="checkbox"]) > legend:not(:empty),
.gtfb-form .gtfb-field:has(input[type="radio"], input[type="checkbox"]) > .gtfb-field-label:not(:empty),
.gtfb-form .gtfb-field:has(input[type="radio"], input[type="checkbox"]) > .gtfb-label:not(:empty),
.gtfb-form .gtfb-field:has(input[type="radio"], input[type="checkbox"]) > .gtfb-question:not(:empty),
.gtfb-form .gtfb-field--radio > .gtfb-field-label:not(:empty),
.gtfb-form .gtfb-field--radio > .gtfb-label:not(:empty),
.gtfb-form .gtfb-field-radio > .gtfb-field-label:not(:empty),
.gtfb-form .gtfb-field-radio > .gtfb-label:not(:empty),
.gtfb-form .gtfb-field--checkbox > .gtfb-field-label:not(:empty),
.gtfb-form .gtfb-field--checkbox > .gtfb-label:not(:empty),
.gtfb-form .gtfb-field-checkbox > .gtfb-field-label:not(:empty),
.gtfb-form .gtfb-field-checkbox > .gtfb-label:not(:empty) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    white-space: normal !important;
    color: var(--medspa-heading-color, var(--medspa-navy, #1b1b1b)) !important;
    font-family: var(--medspa-body-font, var(--medspa-font, inherit)) !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* Empty headings should never create blank vertical space. */
.gtfb-form .gtfb-choice-group-heading:empty,
.gtfb-form fieldset:has(input[type="radio"], input[type="checkbox"]) > legend:empty,
.gtfb-form .gtfb-field:has(input[type="radio"], input[type="checkbox"]) > .gtfb-field-label:empty,
.gtfb-form .gtfb-field:has(input[type="radio"], input[type="checkbox"]) > .gtfb-label:empty,
.gtfb-form .gtfb-field:has(input[type="radio"], input[type="checkbox"]) > .gtfb-question:empty {
    display: none !important;
    margin: 0 !important;
}

/* Required marker stays visually attached to the question. */
.gtfb-form .gtfb-choice-group-heading .required,
.gtfb-form .gtfb-choice-group-heading .gtfb-required,
.gtfb-form fieldset:has(input[type="radio"], input[type="checkbox"]) > legend .required,
.gtfb-form .gtfb-field:has(input[type="radio"], input[type="checkbox"]) > .gtfb-field-label .required,
.gtfb-form .gtfb-field:has(input[type="radio"], input[type="checkbox"]) > .gtfb-label .required {
    color: var(--medspa-accent-text, var(--medspa-secondary, #7a5a30)) !important;
}

/* Choice groups get structure and breathing room. */
.gtfb-form .gtfb-field.gtfb-choice-group,
.gtfb-form fieldset.gtfb-choice-group {
    margin-block: 6px 24px !important;
}

/* Individual radio/checkbox options remain visually subordinate. */
.gtfb-form .gtfb-choice-group label:has(input[type="radio"]),
.gtfb-form .gtfb-choice-group label:has(input[type="checkbox"]),
.gtfb-form .gtfb-radio-option,
.gtfb-form .gtfb-checkbox-option,
.gtfb-form .gtfb-radio-options label,
.gtfb-form .gtfb-checkbox-options label {
    font-family: var(--medspa-body-font, var(--medspa-font, inherit)) !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

@media (max-width: 767px) {
    .gtfb-form .gtfb-choice-group-heading,
    .gtfb-form fieldset:has(input[type="radio"], input[type="checkbox"]) > legend:not(:empty),
    .gtfb-form .gtfb-field:has(input[type="radio"], input[type="checkbox"]) > .gtfb-field-label:not(:empty),
    .gtfb-form .gtfb-field:has(input[type="radio"], input[type="checkbox"]) > .gtfb-label:not(:empty),
    .gtfb-form .gtfb-field:has(input[type="radio"], input[type="checkbox"]) > .gtfb-question:not(:empty) {
        font-size: 0.95rem !important;
        margin-bottom: 11px !important;
    }
}

/* v2.53.38 — control sizing and choice spacing are now emitted from
 * Med Spa Theme > Forms > Form Settings > KORA Form Appearance. */
