*:focus, input:focus {
    outline: none;
}

body {
    font-family: 'Open Sans', Arial, Helvetica, Sans-serif;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

form#dynamic-form {
    display: flex;
    flex-flow: wrap;
    width: 100%;
}

/* Desktop */
@media screen and (min-width: 1001px) {
    body.content > section {
        margin: 5em;
    }
}

/* Tablet / Kiosk */
@media screen and (min-width: 701px) and (max-width: 1000px) {
    body.content > section {
        margin: 3em;
    }
}

/* Mobile */
@media screen and (max-width: 700px) {
    body.content > section {
        margin: 1em;
    }
}

/*div.element:not(:has(input[type="radio"])), textarea {*/
div.element, textarea {
    position: relative;
    width: calc(100% - 1rem);
    display: flex;
    border: rgba(0,0,0,0.5) 0.1em solid;
    border-radius: 0.8rem;
    box-shadow: rgba(0,0,0,0.2) 0 0.25em 1em;
    background-color: #f3f3f3;
    transition: all .4s cubic-bezier(.25, .8, .25, 1);
    font-size: 1.2rem;
    min-height: 1.8rem;
}
    /* === Radio Button Shared Styles === */
    div.element:has(input[type="radio"]) {
        padding: 0.35rem 0;
        display: flex;
        justify-content: space-between;
    }
    div.element > div > span:has(input[type="radio"]) {
        display: flex;
        align-items: center;
        flex-direction: row-reverse;
        margin: 0 0.5rem;
    }
        div.element > div > span > input[type="radio"] {
            margin: 0 0.5rem;
            width: 1.5rem;
            height: 1.5rem;
        }
    div.element:has(input[type="radio"]) > span.label {
        margin: 0 1.0rem;
        display: flex;
        align-items: center;
    }

    /* === Radio Horizontal: label left, options inline right === */
    div.element.radio-horizontal > .radio-options {
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    /* === Radio Vertical: label left, options stacked right === */
    div.element.radio-vertical > .radio-options {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        padding: 0.25rem 0;
    }
    div.element.radio-vertical > .radio-options > span {
        margin: 0.15rem 0.5rem;
    }
    div.element {
        margin: 1.0rem 1.5rem;
    }
textarea {
    min-width: calc(100% - 1rem);
    max-width: calc(100% - 1rem);
    min-height: 8rem;
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
    font-size: 1.2rem;
    margin: 0.5rem 0rem;
}
.element-large {
    width: 100%;
    padding: 0 0.5rem;
    margin: 1.0rem 0;
}
    .element-large > label {
        padding: 0 0.5rem;
        font-weight: bold;
        display: block;
    }


div.element > .field {
    display: block;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    /*transition: all .4s cubic-bezier(.25, .8, .25, 1);*/
    order: 2;
}


div.element:not(.large) > label {
    position: relative;
    top: 10px;
    left: 0px;
    display: block;
    white-space: nowrap;
    overflow: visible;
    font-size: 1.1rem;
    padding: 0;
    width: fit-content;
    box-sizing: border-box;
    padding: 0 0.5rem 0 1.0rem;
    /*overflow: hidden;*/
    transition: all .4s cubic-bezier(.25, .8, .25, 1);
    order: 1;
}

/* Select fields: label sits outside (above) the bordered dropdown */
div.element:has(select.field) {
    flex-wrap: wrap;
    border: none;
    box-shadow: none;
    background: transparent;
}
div.element:has(select.field) > label {
    white-space: normal;
    width: 100%;
    top: 0;
    padding: 0 0.5rem 0.25rem 0.5rem;
    font-weight: bold;
}
div.element:has(select.field) > select.field {
    order: 2;
    border: rgba(0,0,0,0.5) 0.1em solid;
    border-radius: 0.8rem;
    box-shadow: rgba(0,0,0,0.2) 0 0.25em 1em;
    background-color: #f3f3f3;
    transition: all .4s cubic-bezier(.25, .8, .25, 1);
    margin: 0;
}
div.element:has(select.field):not(:has([readonly])) > select.field:hover {
    border-color: deepskyblue;
    box-shadow: rgba(0,0,0,0.4) 0 0.25em 1em;
}
div.element:has(select.field):not(:has([readonly])) > select.field:focus {
    border-color: mediumseagreen;
    box-shadow: rgba(0,0,0,0.8) 0.5em 0.75em 1em -0.5em;
}

div.element.large > label {
    display: block;
    font-weight: bold;
}

div.element:has(.field):not(:has(select.field)):not(:has([readonly])):hover, textarea:not([readonly]):hover {
    border-color: deepskyblue;
    box-shadow: rgba(0,0,0,0.4) 0 0.25em 1em;
}
    /*:not(:has(input[type="radio"]))*/
div.element:has(.field:focus):not(:has(select.field)):not(:has([readonly])), textarea:not([readonly]):focus {
    box-shadow: rgba(0,0,0,0.8) 0.5em 0.75em 1em -0.5em;
    border-color: mediumseagreen;
}

/* Readonly fields: muted appearance, no interactive effects */
div.element:has([readonly]) {
    background-color: #f0f0f0;
    cursor: default;
}
div.element:has([readonly]) .field {
    color: #666;
    cursor: default;
}

div.element:not(:has(input[type="radio"])):not(:has(input[type="checkbox"])):not(.large) > .field:focus + label {
    position: absolute;
    top: -10px;
    left: 24px;
    padding: 0 0.5rem 0 0.5rem;
    /*background-color: #f3f3f3;*/
    /*background-image: linear-gradient(rgba(243,243,243,0), rgba(243,243,243,1), rgba(243,243,243,0));*/
    background-image: linear-gradient(rgba(245,245,245,0), #f5f5f5, #f3f3f3);
    font-size: 0.8rem;
}

label:has(input[type="checkbox"])
	, label:has(+ label > input[type="radio"])
	, label:has(input[type="radio"]) {
		white-space: normal !important;
		font-size: 0.9rem !important;
		display: inline-flex;
		flex-flow: wrap;
	}
	label:has(input[type="checkbox"]) {
		flex-wrap: wrap;
		/*justify-content: flex-end;*/
	}

div.element:has(input[type="checkbox"]) {
    flex: 1 0 21%;
    padding: 0.3rem 0;
    justify-content: space-between;
}
    div.element > input[type="checkbox"] {
        width: 2rem;
    }
    div.element:has(input[type="checkbox"]) > label {
        top: 5px;
        width: 100%;
        white-space: normal;
    }
div.instructions {
    display: block;
    width: 100%;
    font-weight: bold;
    font-size: 1.3em;
    margin-top: 1em;
    text-align: center;
}

/* Section headers within repeater blocks */
.repeater-set .instructions {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    padding-top: 0.5em;
    border-top: 2px solid rgba(21, 140, 186, 0.3);
}

.repeater-set .instructions:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

div:has(button), div:has(input[type="submit"]) {
    text-align: center;
    width: 100%;
}
button, input[type="submit"] {
    border: solid 1px;

    color: #fff;
    background-color: #158cba;
    border-color: #127ba3;
    outline: inherit;
    display: inline-block;
    width: 15rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    text-transform: uppercase;

    font-size: 1.2rem;
    transition: all .4s cubic-bezier(.25, .8, .25, 1);
}
    button:hover, input[type="submit"]:hover {
        background-color: #106a8c;
        border-color: #0c516c;
    }



input[required] + label::before, select[required] + label::before {
	content: "* ";
	color: red;
}
div:has(input[required]:invalid) > label, div:has(select[required]:invalid) > label, div:has(textarea[required]:invalid) > label {
    color: red;
}
div:has(input[required]:valid) > label, div:has(select[required]:valid) > label, div:has(textarea[required]:valid) > label {
    color: green;
}

/* No asterisk on individual options within radio/checkbox groups */
.radio-options input[required] + label::before,
.checkbox-group-item input[required] + label::before {
    content: none;
}

/* Radio/checkbox group required label */
.label-required::before {
    content: "* ";
    color: red;
}
div:has(input[required]:invalid) > .label-required {
    color: red;
}
div:has(input[required]:valid) > .label-required {
    color: green;
}

/* Repeater / Dynamic Block Styles */
.repeater-trigger-buttons {
    width: 100%;
    text-align: center;
    margin: 1rem 0;
}

.repeater-container {
    width: 100%;
    border-left: 4px solid #158cba;
    padding-left: 1rem;
    margin: 1rem 0;
}

.repeater-set {
    display: flex;
    flex-flow: wrap;
    width: 100%;
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(0,0,0,0.2);
}

.repeater-set:last-child {
    border-bottom: none;
}

.repeater-set-header {
    width: 100%;
    padding: 0.25rem 1rem;
    margin-bottom: 0.25rem;
}

.repeater-set-header h3 {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
    color: #158cba;
}

.repeater-buttons {
    width: 100%;
    text-align: center;
    margin: 1rem 0;
}

.add-set-btn, .remove-set-btn {
    border: solid 1px;
    color: #fff;
    outline: inherit;
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all .4s cubic-bezier(.25, .8, .25, 1);
    cursor: pointer;
    margin: 0 0.5rem;
}

.add-set-btn {
    background-color: #28a745;
    border-color: #1e7e34;
}

.add-set-btn:hover {
    background-color: #218838;
    border-color: #1c6e2d;
}

.remove-set-btn {
    background-color: #dc3545;
    border-color: #bd2130;
}

.remove-set-btn:hover {
    background-color: #c82333;
    border-color: #a71d2a;
}

/* Theme Header Styles */
/* Break theme header out of the section margin to go full-width */
#theme-header-container {
    margin: -5em -5em 0 -5em;
}

@media screen and (min-width: 701px) and (max-width: 1000px) {
    #theme-header-container {
        margin: -3em -3em 0 -3em;
    }
}

@media screen and (max-width: 700px) {
    #theme-header-container {
        margin: -1em -1em 0 -1em;
    }
}

.theme-header {
    position: relative;
    width: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.theme-logo {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
}

.theme-logo img {
    max-height: 80px;
    width: auto;
}

.theme-title {
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    z-index: 5;
    padding: 1rem;
}

.theme-menu {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.menu-toggle {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 0.25rem;
}

.menu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.menu-items {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-radius: 0.25rem;
    margin-top: 0.5rem;
    min-width: 200px;
}

.menu-items.show {
    display: block;
}

.theme-subparagraph {
    width: 100%;
    box-sizing: border-box;
    padding: 1.25rem 2rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.theme-subparagraph h1,
.theme-subparagraph h2,
.theme-subparagraph h3,
.theme-subparagraph h4,
.theme-subparagraph h5,
.theme-subparagraph h6,
.theme-subparagraph p {
    margin: 0;
    text-align: center;
}

/* Mobile responsive adjustments */
@media screen and (max-width: 700px) {
    .theme-title {
        font-size: 1.5rem;
    }

    .theme-logo img {
        max-height: 50px;
    }

    .theme-header {
        min-height: 150px;
    }
}

/* Tablet responsive adjustments */
@media screen and (min-width: 701px) and (max-width: 1000px) {
    .theme-title {
        font-size: 2rem;
    }

    .theme-logo img {
        max-height: 65px;
    }
}

/* ===== Contact & Address Section Styles ===== */

.form-section {
    width: 100%;
    display: flex;
    flex-flow: wrap;
}

.form-section-header {
    width: 100%;
    text-align: center;
    font-size: 1.3rem;
    font-weight: bold;
    margin: 1.5rem 0 0.5rem 0;
}

/* ===== Validation Styles ===== */

.field-invalid,
.field-invalid input,
.field-invalid textarea,
.field-invalid select {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15);
}

input.field-invalid,
textarea.field-invalid,
select.field-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15);
}

.form-field-error {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 4px;
    padding-left: 4px;
}

/* Submit button disabled state */
.form-submit-btn:disabled,
button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Checkbox Group Styles ===== */

.checkbox-group-container {
    width: 100%;
    padding: 0 0.5rem;
    margin: 1.0rem 0;
}

.checkbox-group-container > label {
    padding: 0 0.5rem;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.checkbox-group-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 0.5rem;
}

/* Override .element defaults inside checkbox groups — let flex sizing control layout */
.checkbox-group-options > .element {
    width: auto;
    margin: 0;
}

.checkbox-group-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 150px;
    flex: 0 1 auto;
}

.checkbox-group-item input[type="checkbox"],
.checkbox-group-item input[type="radio"] {
    width: 1.3rem;
    height: 1.3rem;
    margin: 0;
    cursor: pointer;
}

.checkbox-group-item label {
    font-size: 1rem;
    cursor: pointer;
    white-space: nowrap;
}

/* Validation error styling for checkbox group */
.checkbox-group-container.field-invalid {
    border-left: 3px solid #dc3545;
    padding-left: calc(0.5rem - 3px);
}

/* ===== Section Break / Header Styles ===== */

.section-break {
    width: 100%;
    margin: 2rem 0 1rem 0;
    padding: 0 1rem;
}

.section-break h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 0 0.5rem 0;
    color: #333;
}

.section-break hr {
    border: none;
    border-top: 2px solid #158cba;
    margin: 0;
}

/* ===== Yes/No Toggle Switch Styles ===== */

.toggle-container {
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.toggle-container > .label {
    margin: 0 1.0rem;
    display: flex;
    align-items: center;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.toggle-label-no,
.toggle-label-yes {
    font-size: 0.95rem;
    font-weight: bold;
    user-select: none;
}

.toggle-label-no {
    color: #999;
}

.toggle-label-yes {
    color: #999;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    cursor: pointer;
}

.toggle .toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle .toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 26px;
    transition: all 0.3s ease;
}

.toggle .toggle-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle .toggle-input:checked + .toggle-slider {
    background-color: #28a745;
}

.toggle .toggle-input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* Highlight active label based on toggle state */
.toggle-switch:has(.toggle-input:checked) .toggle-label-yes {
    color: #28a745;
}

.toggle-switch:has(.toggle-input:not(:checked)) .toggle-label-no {
    color: #dc3545;
}

/* ===== Paragraph / HTML Block Styles ===== */

.paragraph-block {
    width: 100%;
    padding: 1rem 1.5rem;
    margin: 0.5rem 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #444;
}

/* ===== Static Block (Collapsible) ===== */

.block-static {
    width: 100%;
    margin: 1rem 0;
    padding: 0 1rem;
}
.block-header-static {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 2px solid #158cba;
    margin-bottom: 0.5rem;
}
.block-header-static h2 {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0;
    color: #333;
}
.block-content-static {
    display: flex;
    flex-flow: wrap;
    width: 100%;
    padding: 0 0 0.5rem;
}
