/* KENTICO FORM Styling
   Add styling to forms generated through the Kentico form interface
*/
form[onsubmit*="window.kentico"] {
    --input-height: 40px;
    --radius-size: 20px;
    --input-width: 200px;
    --gap-size: 15px;
}

form .ktc-default-section {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-size);
    margin-bottom: var(--gap-size);
}

.form-field {
    width: var(--input-width);
}
.form-field:has(textarea) {
    width: calc(2*var(--input-width) + var(--gap-size));
}

.form-field .control-label {
    display: inline-block;
    font-size: 15px;
    padding-left: 5px;
    margin-bottom: 5px;
}

.form-field .form-control {
    border-radius: var(--radius-size);
    border: 1px solid #AAA;
    line-height: 20px;
    font-size: 15px;
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
}

.form-field .form-control.input-validation-error {
    border-color: rgb(255, 108, 108);
}
.form-field .form-control.input-validation-error:focus {
    border-color: rgb(180, 58, 58);
}

.form-field :is(input:not([type="checkbox"], [type="radio"]), select).form-control {
    height: var(--input-height);
}

.ktc-radio-list,
.ktc-checkbox-list {
    display: flex;
    flex-direction: column;
}
:is(.ktc-radio, .ktc-checkbox) input.form-control {
    width: unset;
}

.form-field select.form-control {
    appearance: none;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M7 10L12 15L17 10" stroke="%23000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat;
    background-position: right 5px top 50%;
    padding-right: 35px;
}
.form-field select.form-control:focus {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M17 15L12 10L7 15" stroke="%23000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat;
    background-position: right 5px top 50%;
}

.form-field textarea.form-control {
    resize: none;
    padding: 10px 15px;
    min-height: 10em;
    background-clip: padding-box;
    overflow-y: scroll;
    outline: 1px solid #AAA;
    border: none;
}
.form-field textarea.form-control:focus {
    outline: 1px solid #333;
    border: none;
}
.form-field textarea.form-control.input-validation-error {
    outline-color: rgb(255, 108, 108);
}
.form-field textarea.form-control.input-validation-error:focus {
    outline-color: rgb(180, 58, 58);
}

.form-field .form-control:is(*:focus, *:focus-visible) {
    border: 1px solid #333;
    outline: none;
}

.form-field .field-validation-error {
    color: red;
    display: flex;
    align-items: stretch;
    padding: 5px;
}

.form-field .field-validation-error::before {
    color: red;
    background-color: red;
    content: '';
    height: 16px;
    width: 16px;
    background: url('data:image/svg+xml,<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" style="display: block;"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 1c.523 0 .798.595.894.789l6.5 12.764A1 1 0 0 1 14.5 16h-13a1 1 0 0 1-.894-1.447l6.5-12.764C7.351 1.295 7.475 1 8 1Zm0 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3ZM9.5 6h-3l.5 4h2l.5-4Z" fill="red"></path></svg>') no-repeat;
    display: inline-block;
    margin-right: 5px;
}

form[onsubmit*="window.kentico"] input[type="submit"] {
    height: var(--input-height);
    border-radius: var(--radius-size);
    border: none;
    width: var(--input-width);
    cursor: pointer;
    background-color: rgb(49, 103, 156);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 15px;
}
form[onsubmit*="window.kentico"] input[type="submit"]:hover {
    filter: brightness(90%);
    color: white;
}

.form-field:has(div[id*="google-recaptcha"]) {
    max-width: calc(100vw - 50px);
}

@media screen and (max-width: 500px) {
    .form-field,
    .form-field:has(textarea),
    form[onsubmit*="window.kentico"] input[type="submit"] {
        width: 100%;
    }

    .editing-form-control-nested-control:has(iframe[src*="google.com/recaptcha/"]) {
        transform: scale(0.85);
        transform-origin: 0 0;
    }
}

@media screen and (max-width: 320px) {
    .editing-form-control-nested-control:has(iframe[src*="google.com/recaptcha/"]) {
        transform: scale(0.75);
        transform-origin: 0 0;
    }
}
@media screen and (max-width: 280px) {
    .editing-form-control-nested-control:has(iframe[src*="google.com/recaptcha/"]) {
        transform: scale(0.65);
        transform-origin: 0 0;
    }
}