/* CSS file */
/* lt2_forms.css */


optgroup {
	height:0;
}
optgroup + optgroup { height:unset; border-top: 1px solid black; }

option.divider {
	border-top:1px solid var(--lt-border-color);
	padding: var(--lt-padding-quarter) var(--lt-padding-half);
}



/* bootstrap overrides */
/* because the labels on radio groups were to far away from first items */
.form-control {
	font-size: 1rem;
	line-height: calc(1ex / 0.42);
	background-color: var(--lt-form-control-background-color);
	padding: var(--lt-padding-quarter) var(--lt-padding-half);
}


.form-control.small,
.form-control.short {
	width: auto;
	max-width: 15ch;
}
.form-control.shorter {
	width: auto;
	max-width: 6ch;
}
.form-control.wide {
	width:100%;
}

@media (min-width: 767px) {
	select.form-control,
	input[type="text"].form-control:not(.fwikiFormInputItem),
	input[type="search"].form-control,
	input[type="url"].form-control,
	input[type="email"].form-control,
	input[type="password"].form-control {
		max-width: 80ch;
	}
	input[type="text"].form-control.small:not(.fwikiFormInputItem),
	input[type="text"].form-control.short,
	input[type="search"].form-control.short,
	input[type="search"].form-control.small,
	input[type="url"].form-control.small,
	input[type="url"].form-control.short {
		width: auto;
		max-width: 15ch;
	}


	.search_inline_with_button input[type="text"].form-control,
	.flex_form_inline_with_button input[type="text"].form-control,
	.search_inline_with_button input[type="search"].form-control,
	.flex_form_inline_with_button input[type="search"].form-control {
		max-width:unset;
	}


	input.form-control.shorter {
		width: auto;
		max-width: 6ch;
	}
	textarea.form-control:not(.trumbowyg-textarea):not(.wide) {
		max-width: 80ch;
	}
	.form-control.autowidth {
		width: auto;
		width: fit-content;
		min-width: 14em;
		flex-grow: 0;
	}
	select.form-control.autowidth {
		min-width:5ch;
	}
	input[type="text"].form-control.smaller {
		max-width: 15ch;
	}



}

@media (max-width: 567px) {
	.form-control {
		/* this prevents the annoying autozooming into controls on iOS */
		font-size: 16px;
	}
}

.form_hint:has(.more_space_anchor) {
	display: flex;
	width: 100%;
	max-width: calc(80ch * 1.11); /* 80ch is max width of textareas, but different font size there */
	gap: var(--lt-padding-half);
	text-align: right;
	justify-content: space-between;
}
.form-control.wide + .form_hint:has(.more_space_anchor) {
	max-width: unset;
}
.form_hint .more_space_anchor {
	text-align: right;
	flex-grow:1;
	white-space: nowrap;
}

textarea.form-control:not(.trumbowyg-textarea):not(.wide) + .form_hint > a.more_space_anchor {
	text-align: right;
	display: block;
}

input[type="text"].form-control.smallest {
	min-width: 3ch;
	max-width: calc(4ch + var(--lt-padding));
}





select.form-control.input-sm {
	font-size: 90%;
	line-height: unset;
}
.form-group > .checkbox:not(:last-of-type),
.radio_group > .radio:not(:last-of-type) {
	margin-bottom: var(--lt-padding-quarter);
}

.form-inline label {
	margin-right: var(--lt-padding-quarter);
}

.form-group > .checkbox:first-of-type,
.radio_group > .radio:first-of-type {
	margin-top: 0;
}

.form-group > .checkbox:last-of-type,
.radio_group > .radio:last-of-type,
.form-group > .checkbox:last-child,
.radio_group > .radio:last-child {
	margin-bottom: 0;
}

.form-group,
.radio_group {
	margin-bottom: var(--lt-padding-quarter);
}
section > .form-group:last-child,
section > .radio_group:last-child {
	margin-bottom: 0;
}

.form-group.form_group_tight {
	margin-bottom: 0;
}

.checkbox label,
.radio label {
	padding-left: calc(var(--lt-padding) + var(--lt-padding-quarter));
}
.radio .subform label {
	padding-left:0;
}
.checkbox input[type=checkbox],
.checkbox-inline input[type=checkbox],
.radio input[type=radio],
.radio-inline input[type=radio] {
	margin-left: calc(calc(var(--lt-padding) + var(--lt-padding-quarter)) * -1);
}
.lt2_columnar .checkbox,
.checkbox+.checkbox,
.radio+.radio {
	margin-top:0;
}
input[type="radio"] {
	flex:0 1 auto;
	position: relative;
	width: var(--lt-form-control-size);
	height: var(--lt-form-control-size);
	color: var(--lt-border-color);
	border: 2px solid var(--lt-form-control-color);
	background: var(--lt-tint-dark-07);

	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	outline: 0;
	cursor: pointer;
	-webkit-transition: background 175ms cubic-bezier(0.1, 0.1, 0.25, 1);
	transition: background 175ms cubic-bezier(0.1, 0.1, 0.25, 1);
	margin-top: 0em;
	flex-grow: 0 !important;

	border-radius:50%;

	display: inline-flex;
	justify-content: center;
	align-items: center;

	ertical-align: top;
	margin-top: 2px;
}
input[type="radio"]::before {
	position: relative;
	content: '';
	display: block;
	width: calc(var(--lt-form-control-size) - 4px);;
	height: calc(var(--lt-form-control-size) - 4px);;
	transform: scale(0.25);
	opacity: 0;
	transition: 500ms;
	border-radius: 50%;
	background: var(--lt-form-control-accent-color);
	text-align: center;
	border: 2px solid var(--lt-background-color);
}
input[type="radio"]:checked {
	color: var(--lt-background-color);
	border-color: var(--lt-border-color);
	background: var(--lt-form-control-accent-color);
}
input[type="radio"]:checked::before {
	opacity: 1;
	transition: 500ms;
	transform: scale(1.0);
}
input[type="radio"]:checked ~ label::before {
	-webkit-clip-path: circle(50% at 50% 50%);
	clip-path: circle(50% at 50% 50%);
}
/* for checkbox labels */
label input[type="checkbox"] + span {
	margin-top: 3px;
	display: inline-block;
	vertical-align: top;
}
.lt2_sidebar form label input[type="checkbox"] + span {

}

.chkbox label {
	xmargin-top: var(--lt-padding-quarter);
	display:flex;
	gap: var(--lt-padding-quarter);

	/* because bootstrap expects these to be '.checkbox label' but we have lots of legacy code that uses .chkbox we need to include the bootstrap rules */
	min-height: var(--lt-form-control-size);
	min-width: var(--lt-form-control-size);
	margin-bottom:0;
	cursor:pointer;
	width: 100%;
	width: max-content;
	font-weight: 400;
}
/* and the reverse of the above, we need to include our rules for bootstrap-style div classes */
.checkbox label {
	width: 100%;
	margin-top: var(--lt-padding-quarter);
	display:flex;
	gap: var(--lt-padding-quarter);
	font-weight: 400;
}
.chkbox label > input[type="checkbox"],
.chkbox label > input[type="radio"]
{
	flex-shrink: 0;
}

input[type="checkbox"] {
	flex:0 1 auto;
	position: relative;
	width: var(--lt-form-control-size);
	height: var(--lt-form-control-size);
	color: var(--lt-border-color);
	border: 2px solid var(--lt-form-control-color);
	background: var(--lt-tint-dark-07);

	border-radius: var(--lt-border-radius);
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	outline: 0;
	cursor: pointer;
	-webkit-transition: background 175ms cubic-bezier(0.1, 0.1, 0.25, 1);
	transition: background 175ms cubic-bezier(0.1, 0.1, 0.25, 1);
	margin-top: 0.13em;
	xtop: 0.23em;
	align-self: flex-start;
	flex-grow: 0 !important;
	margin-right: var(--lt-padding-half);
}
input[type="checkbox"]::before {
	position: absolute;
	content: '';
	display: block;
	bottom: 2px;
	left: 4px;
	width: 7px;
	height: 14px;
	border-style: solid;
	border-color: var(--lt-background-color);
	border-width: 0 3px 3px 0;
	-webkit-transform: rotate(45deg);

	transform: rotate(45deg) scale(0.25);
	opacity: 0;
	transition: 500ms;
	xbox-shadow: 2px 1px 0 var(--lt-form-control-accent-color);
}
input[type="checkbox"]:checked {
	color: #fff;
	border-color: var(--lt-form-control-accent-color);
	background: var(--lt-form-control-accent-color);
	outline:0;
}
input[type="checkbox"]:checked::before {
	opacity: 1;
	transition: 500ms;
	transform: rotate(45deg) scale(1.0);
}
input[type="checkbox"]:checked ~ label::before {
	-webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
	clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
input[type=radio]:focus,
input[type=checkbox]:focus {
	xoutline: 5px auto var(--lt-red-color-control-foreground);
	xoutline-offset: 4px;
	outline:none;
}
input[type=radio]:focus {
	outline-offset: 0;
}

input[type=number]::-webkit-inner-spin-button {
	-webkit-appearance: none;
}




/* switches via checkboxes */
label:has(> input[type="checkbox"].onoff:not(.nolabel)) {
	margin-top:var(--lt-padding-quarter);
}
input[type="checkbox"].onoff {
	flex:0 1 auto;
	position: relative;
	width: 3em;
	height: 1.5em;
	color: #363839;
	border: 1px solid #bdc1c6;
	border-radius: 0.75em;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	outline: 0;
	cursor: pointer;
	-webkit-transition: background 175ms cubic-bezier(0.1, 0.1, 0.25, 1);
	transition: background 175ms cubic-bezier(0.1, 0.1, 0.25, 1);
	flex-grow: 0 !important;
	margin-top: 0;
	vertical-align: top;
	margin-right: var(--lt-padding-quarter);
}
label > input[type="checkbox"].onoff {
	margin-right: var(--lt-padding-quarter);
}
.tabled label > input[type="checkbox"].onoff {
	margin-right: 0;
	margin-left: var(--lt-padding-quarter);
}
input[type="checkbox"][data-offtitle],
input[type="checkbox"][data-ontitle] {
	margin-bottom: var(--lt-padding-half);
}
input[type="checkbox"][data-offtitle].onoff::after {
	content: attr(data-offtitle);
	display: block;
	position: absolute;
	font-size: 0.6em;
	transition: all 0.5s;
	color: var(--lt-text-grey-color);
	text-align: center;
	width: 100%;
	bottom: -1.5em;
}
input[type="checkbox"][data-ontitle].onoff:checked::after {
	content: attr(data-ontitle);
}

input[type="checkbox"].onoff::before {
	position: absolute;
	content: '';
	display: block;
	top: 0;
	left: 0;
	width: 50%;
	height: 100%;

	border:none;

	-webkit-transform: none;
	transform: none;

	opacity: 1;
	transition: 500ms;
	background: var(--lt-border-color);
	border:1px solid var(--lt-border-color);
	border-radius: 0.75em;
}
input[type="checkbox"].onoff:checked::before {
	background: var(--lt-white-color);
}


input[type="checkbox"].onoff:checked {
	color: #fff;
	border-color: var(--lt-border-color);
	background: var(--lt-on-color);
}
input[type="checkbox"].onoff.color_scheme_eu:checked {
	color: #fff;
	border-color: var(--lt-border-color);
	background: #022f9b;
}
input[type="checkbox"].onoff.color_scheme_eu:checked::before {
	background: #ffcd00;
}

input[type="checkbox"].onoff.danger_when_on:checked {
	color: #fff;
	border-color: var(--lt-border-color);
	background: var(--lt-red-light-color);
}

input[type="checkbox"].onoff:checked::before {
	opacity: 1;
	transition: 500ms;
	xtransform: rotate(45deg) scale(1.0);
	left: 50%;
}
input[type="checkbox"].onoff ~ label {
	margin-left: 0.5em;
	margin-top: 0.1em;
	vertical-align: top;
}
input[type="checkbox"].onoff:checked ~ label::before {
	-webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
	clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* end of switches via checkboxes */

.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
	background-color: #e5e4e4cc;
	color: #0007;
	box-shadow: none;
	border-color: var(--lt-tint-dark-1);
}

/* flex forms */
.form-flex {
	display:flex;
	align-items: center;
	gap: var(--lt-padding-half);
	flex-wrap: wrap;
}

.form-flex .form-group,
.form-flex .radio_group {
	margin-bottom:0;
}

.checkbox.indent
{
padding-left: calc(var(--lt-padding) * 1.5);
}
