article[data-block-type="newsletter"] > .wrapper,
article[data-block-type="form"] > .wrapper {
    overflow: visible;
}


/********* Grid Layout *********/

.form .formElements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    grid-column-gap: var(--horizontalMargin);
    grid-row-gap: 0.9em;
}

.form .formElements .formElement {
    position: relative;
    grid-column: span 2;
    text-align: left;
}

.form .formElements .formElement.half {
    grid-column: span 1;
}

@media only screen and (max-width: 600px) {
    .form .formElements {
        grid-row-gap: calc((var(--horizontalMargin) / 3) + 0.5em);
        grid-template-columns: 1fr;
    }

    .form .formElements .formElement {
        grid-column: span 1
    }
}


/********* Form Elements *********/

.form .formElements .formElement {
    font-family: var(--fontFamilyBody);
    font-size: var(--fontSizeBody);
    line-height: var(--lineHeightBody);
    font-weight: var(--fontWeightBody);
    letter-spacing: var(--letterSpacingBody);
    font-style: var(--fontStyleBody);
    text-transform: var(--textTransformBody);

    color: var(--colorDark);
}

.form .formElements .formElement > label {
    font-family: var(--fontFamilyBody);
    font-size: 0.65em;
    line-height: 1;
    font-weight: bold;
    letter-spacing: 0.1em;
    font-style: var(--fontStyleBody);
    text-transform: uppercase;
}

.form .formElements .formElement label.required::after {
    content: ' *';
    color: var(--formErrorColor);
}

.form .formHeading {
    text-align: left;
    margin-top: 0.75em;
    margin-bottom: -0.25em;
}

.form input,
.form textarea,
.form select {
    display: block;
    border: none;
    outline: 0px solid var(--colorHighlight);
    width: 100%;
    height: 2.75em;
    margin: 0;
    padding: 0.5em 1.25em;
    font: inherit;
    text-align: left;
    color: var(--colorDark);
    background: var(--colorReset);
    border-radius: 5px;
    transition: background var(--transition-duration) var(--transition-timing-function) var(--transition-delay);
}

.form input:not([type="checkbox"]):not([type="radio"]):focus,
.form textarea:focus,
.form select:focus {
  outline: 1px solid var(--colorHighlight);
}

.form .file-input input[type="file"] {
    cursor: pointer;
    padding-left: 3rem;
}

.form .file-input:has(input[type="file"])::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    content: '';
    background: var(--colorReset);
    pointer-events: none;
    transition: background var(--transition-duration) var(--transition-timing-function) var(--transition-delay);
}

.form .file-input input[type="file"]::file-selector-button {
    display: none;
}

.form .file-input input[type="file"]::-webkit-file-upload-button {
    visibility: hidden;
    width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.form .file-input input[type="file"] ~ [data-file-placeholder] {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 3.25rem;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 1;
}

.form .file-input input[type="file"] ~ svg.file {
    position: absolute;
    top: 0;
    left: 0;
    height: 1.25em;
    padding: 0.75rem;
    box-sizing: content-box;
    pointer-events: none;
    z-index: 1;
}

.form .file-input input[type="file"] ~ svg.xmark {
    position: absolute;
    top: 0;
    right: 0;
    height: 1.25rem;
    padding: 0.75rem;
    box-sizing: content-box;
    cursor: pointer;
    z-index: 1;
}

.form[data-error="true"] input[type="file"] ~ svg.xmark {
    pointer-events: none;
}

.form select {
    appearance: none;
    cursor: pointer;
}

.form select ~ svg.trigger {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    height: 1.25rem;
}

.form textarea {
    padding: 1em 1.25em;
    height: 100px;
    line-height: 1.25;
    transition: resize 0s;
    resize: vertical;
}

.form select:hover {
    color: var(--colorDark);
    background: var(--colorReset);
}


/********* Success/Error messages *********/

.form .thxMsg,
.form .errorMsg {
    display: block;
    padding: 1rem;
    color: var(--colorDark);
    margin-bottom: var(--horizontalMargin);
    text-align: center;
}

.form .thxMsg > svg,
.form .errorMsg > svg {
    height: 1.25em;
}

.form .thxMsg > svg + p,
.form .errorMsg > svg + p {
    margin-top: 0.25em;
}

.form .thxMsg {
    background: #c3e6cb;
}

.form .errorMsg {
    background: #ffeeba;
}

.form .thxMsg a,
.form .errorMsg a {
    text-decoration: underline;
}

.form .thxMsg a:hover,
.form .errorMsg a:hover {
    color: var(--colorDark);
}


/********* Radio / Checkbox Buttons *********/

.form .radio .radioButtons,
.form .checkbox .checkboxButtons {
    display: flex;
    flex-wrap: wrap;
}

.form .radio label,
.form .checkbox label {
    margin-top: 15px;
    margin-right: 30px;
}

.form .radio.half label,
.form .checkbox.half label {
    margin-left: 0;
}

.form .radio.half .radioButtonsBreak label,
.form .checkbox.half .checkboxButtonsBreak label {
    width: calc(100% - 30px);
}

@media only screen and (max-width: 600px) {
    .form .radio .radioButtons.radioButtonsBreak,
    .form .checkbox .checkboxButtons.checkboxButtonsBreak {
        display: block;
    }
}

@media only screen and (max-width: 600px) {
    .form .radio .radioButtonsBreak label,
    .form .radio .radioButtonsBreak label:nth-child(even),
    .form .checkbox .checkboxButtonsBreak label,
    .form .checkbox .checkboxButtonsBreak label:nth-child(even) {
        margin-right: 0;
        margin-left: 0;
        width: 100%;
    }
}

@media only screen and (max-width: 600px) {
    .form .radio label,
    .form .checkbox label {
        margin-top: 15px;
    }
}

@media only screen and (max-width: 1024px) {
    .form .radio label,
    .form .checkbox label {
        margin-right: 30px;
    }

    .form .radio.half .radioButtonsBreak label,
    .form .checkbox.half .checkboxButtonsBreak label {
        width: calc(50% - 10px);
    }
}

/********* Radio Button / Checkbox Button effect *********/

.form .radio label,
.form .checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.form .radio label > div,
.form .checkbox label > div {
    display: inline-block;
    position: relative;
    width: 24px;
    height: 24px;
    border: 1px solid var(--colorHighlight);
    border-radius: 5px;
    transform: translate3d(0, 0, 0);
}

.form .radio label > div:has(input[type="radio"]:focus),
.form .checkbox label > div:has(input[type="checkbox"]:focus) {
    outline: 1px solid var(--colorHighlight);
}

.highlight .form .radio label > div,
.highlight .form .checkbox label > div {
    border-color: var(--colorReset);
}

.highlight .form input[type="radio"]:focus ~ .radio label > div,
.highlight .form input[type="checkbox"]:focus ~ .checkbox label > div {
    outline: 2px solid var(--colorReset);
}

.form .radio label > div {
    border-radius: 50%;
}

.form .radio label > div svg,
.form .checkbox label > div svg {
    position: absolute;
    z-index: 1;
    top: 7px;
    left: 5px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 16px;
    stroke-dashoffset: 16px;
    transition: var(--transition);
    transition-delay: 0.1s;
    transform: translate3d(0, 0, 0);
}

.form .radio label > div::before,
.form .checkbox label > div::before {
    content: "";
    width: 100%;
    height: 100%;
    background: var(--colorHighlight);
    display: block;
    transform: scale(0);
    opacity: 1;
    border-radius: 5px;
    transition-delay: 0.2s;
}

.form .radio label > div::before {
    border-radius: 50%;
}

.form .radio label > div,
.form .checkbox label > div {
    margin-right: 8px;
}

.form .radio:hover label > div,
.form .checkbox:hover label > div {
    border-color: var(--colorHighlight);
}

.highlight .form .radio:hover label > div,
.highlight .form .checkbox:hover label > div {
    border-color: var(--colorDark);
}

.form .checkbox input[type="checkbox"],
.form .radio input[type="radio"] {
    display: inline;
    appearance: none;
    width: 0;
    height: 0;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0;
}

.form .checkbox label > div:has(input[type="checkbox"]:checked),
.form .radio label > div:has(input[type="radio"]:checked) {
    border-color: var(--colorHighlight);
    background: var(--colorHighlight);
    animation: check 0.6s ease;
}

@keyframes check {
    50% {
        transform: scale(1.2);
    }
}

.highlight .form .checkbox label > div:has(input[type="checkbox"]:checked),
.highlight .form .radio label > div:has(input[type="radio"]:checked) {
    border-color: var(--colorDark);
    background: var(--colorDark);
}

.form .checkbox label > div:has(input[type="checkbox"]:checked) svg,
.form .radio label > div:has(input[type="radio"]:checked) svg {
    stroke-dashoffset: 0;
}

.form .checkbox label > div:has(input[type="checkbox"]:checked)::before,
.form .radio label > div:has(input[type="radio"]:checked)::before {
    transform: scale(2.2);
    opacity: 0;
    transition: var(--transition);
    transition-duration: 600ms;
}


/********* Button *********/

.form:not([data-loading="true"]) button svg.loading {
    display: none;
}

.form[data-loading="true"] .formElements .formElement:has(button),
.form[data-error="true"] .formElements .formElement:has(button) {
    cursor: not-allowed;
}

.form[data-loading="true"] button,
.form[data-error="true"] button {
    pointer-events: none;
}

.form button svg.loading {
    height: 1em;
    vertical-align: middle;
    margin-left: 0.5em;
    fill: currentColor;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/********* Input validations *********/

.form input:required:user-invalid,
.form .file-input:has(input[type="file"]:required:user-invalid)::after,
.form textarea:required:user-invalid,
.form select:required:user-invalid {
    background: var(--formErrorColor);
}

.form .formElements label > div:has(input[type="checkbox"][data-required]:user-invalid),
.form .formElements label > div:has(input[type="radio"]:required:user-invalid){
    border: 2px solid var(--formErrorColor);
}

.form input:disabled,
.form textarea:disabled,
.form select:disabled {
    pointer-events: none;
}

.form .formElements .formElement:has(input:disabled),
.form .formElements .formElement:has(input[type="checkbox"]:disabled) label,
.form .formElements .formElement:has(input[type="radio"]:disabled) label,
.form .formElements .formElement:has(textarea:disabled),
.form .formElements .formElement:has(select:disabled) {
    cursor: not-allowed;
}


/********   Color Variants   *********/

.dark .formHeading > h5,
.highlight .formHeading > h5 {
    color: var(--colorReset);
}

.highlight .thxMsg,
.highlight .errorMsg {
    background: var(--colorDark)
}

.reset input,
.reset .form .file-input:has(input[type="file"])::after,
.reset textarea,
.reset select {
    background: var(--colorMuted);
}

.reset .form .file-input:has(input[type="file"]):hover::after,
.reset select:hover {
    background: var(--colorMutedLight);
}

.muted input,
.muted .form .file-input:has(input[type="file"])::after,
.muted textarea,
.muted select {
    background: var(--colorReset);
}

.muted .form .file-input:has(input[type="file"]):hover::after,
.muted select:hover {
    background: var(--colorMutedLight);
}

.highlight input,
.highlight .form .file-input:has(input[type="file"])::after,
.highlight textarea,
.highlight select {
    background: var(--colorReset);
}

.muted .form .file-input:has(input[type="file"]):hover::after,
.highlight select:hover {
    background: var(--colorMutedLight);
}

article.dark .formElement label,
article.highlight .formElement label {
    color: var(--colorReset);
}


/********   reCAPTCHA badge   *********/

.grecaptcha-badge {
    z-index: 9999;
}
