/*
-----------------------------
Formulare
----------------------------- 
*/

form > h3 {
    margin-top: 2em;
}

form > div.subline {
    margin-top: -1em;
    margin-bottom: 1.4em;
}

.error-message-global {
	width:auto;
    color: rgb(235, 52, 52);
    margin: 1em 0;
    display: none;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}
.error-message-global.shake { 
	animation: shake 0.3s ease; }

.form-group { 
	position: relative; 
	margin-bottom: 1.5em; 
}

input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 1.2em 0.5em 0.5em 0.5em;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: white;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'><path d='M0 0l5 6 5-6z' fill='%23666'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75em center;
    background-size: 0.65em auto;
    padding-right: 2em;
}

input:focus,
select:focus {
    outline: none;
    border-color: #666;
}

.form-group label {
    position: absolute;
    top: 0.85em;
    left: 0.5em;
    pointer-events: none;
    transition: all 0.2s ease;
    background: white;
    padding: 0 0.25em;
    color: #666;
}


input:focus + label,
input:not(:placeholder-shown) + label,
select:focus + label,
select:valid + label {
    top: -0.5em;
    left: 0.4em;
    font-size: 0.8em;
    color: #333;
}

.form-group select:not(.has-value):not(:focus) + label {
  top: 50%;
  transform: translateY(-50%);
  left: 0.75rem;
  font-size: 1em !important;
  color: #666 !important;
}

.form-group select.has-value + label,
.form-group select:focus + label {
  top: -0.5em;
  left: 0.4em;
  font-size: 0.8em;
  color: #333;
}

.form-row {
    display: flex;
    gap: 1em;
}

.plz-group { flex: 0 0 calc((100% - 1em) * 0.3); }
.ort-group { flex: 0 0 calc((100% - 1em) * 0.7); }

.error-input { border: 2px solid red !important; }

.field-error {
    font-size: 0.9em;
    margin-top: 0.25em;
    display: block;
}

.warning-icon {
	height:0.8em;
    display: inline-block;
    color: #f0ad4e;
    margin-right: 0.35em;
	margin-top:-0.2em;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 1.5em;
	font-size:1.1rem;
}
    
.checkbox-group input[type="checkbox"] {
    margin-right: 0.5em;
    transform: scale(1.2);
}

input[type="checkbox"] {
	all: unset;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	display: inline-block;
	width: 1.25em;
	height: 1.25em;
	margin-left: 0.2rem;
	vertical-align: middle;
	cursor: pointer;
	box-sizing: border-box;
	border: 1px solid #ccc;
    border-radius: 4px;
	background-color: white;
	position: relative;
	transition: background-color 0.2s ease, border-color 0.2s ease;
  }
  
  input[type="checkbox"]::after {
	content: "";
	position: absolute;
	top: 0.15em;
	left: 0.35em;
	width: 0.25em;
	height: 0.5em;
	border: solid white;
	border-width: 0 0.2em 0.2em 0;
	transform: rotate(45deg);
	opacity: 0;
	transition: opacity 0.2s ease;
  }
  
  input[type="checkbox"]:checked {
	background-color: #a3d6de;
	border-color: #a3d6de;
  }
  
  input[type="checkbox"]:checked::after { opacity: 1; }
  input[type="checkbox"]:hover { border-color: #333; }
  input[type="checkbox"]:focus { outline: none; box-shadow: 0 0 0 2px #333; }
  
  input[type="checkbox"]:disabled {
	background-color: #eee;
	border-color: #ccc;
	cursor: not-allowed;
  }
  
  input[type="checkbox"]:disabled::after { border-color: #ccc; }

