@import url('https://fonts.googleapis.com/css2?family=Comfortaa&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap');

/* General Styles */

body {
	margin: 0;
	padding: 0;
	background-color: white;
	font-family: 'Open Sans', sans-serif;
	font-size: 1.5vh;
	overflow-x: hidden;
	background: linear-gradient(to bottom, #f0f8ff, #ffffff); /* Very light blue gradient to white */
}

hr {
	margin: 20px; 
	width: 90%;
	margin-top: -5px;
	border: 0;
	height: 5px;
	background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}

/* Header Styles */

header {
	padding: 15px;
	align-items: center;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	background-color: #27445D; /* Deep sea blue instead of rgb(42, 80, 102) */
	border-radius: 0 0 30px 30px;
	position: sticky;
	position: -webkit-sticky; /* For Safari */
	z-index: 100;
	top: 0;
}

.header-container {
	display: flex;
	flex-direction: column;
	position: relative;
	max-width: 100%;
	padding: 0 20px;
	box-sizing: border-box;
}

/* Login button styles */
.login-link {
	position: absolute;
	top: 15px;
	right: 20px;
	background-color: transparent;
	color: white;
	padding: 5px 10px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 4px;
	text-decoration: none;
	font-size: 0.9rem;
	transition: all 0.3s ease;
}

.login-link:hover {
	background-color: rgba(255, 255, 255, 0.2);
	transform: translateY(-1px);
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Mobile adjustments for login link */
@media (max-width: 768px) {
	.login-link {
		top: 10px;
		right: 10px;
		font-size: 0.8rem;
		padding: 4px 8px;
	}
	
	.header-container {
		padding: 0 10px;
	}
}

.b-letter-text{
	margin-left: 10px;
	margin-right: 10px;
}

.b-letter-container label {
    font-size: 1.5rem;
}

.disability-details {
    padding-left: 48px;
    margin-top: -10px;
    margin-bottom: 10px;
}

.gdb-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.b-letter-container {
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.b-letter-container .checkbox {
    height: 2.5rem;
    width: 2.5rem;
    margin-right: 15px;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    border: 2px solid #60a3bc;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 2.5rem;
    min-height: 2.5rem;
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
}

.b-letter-container .checkbox:checked {
    background-color: #60a3bc;
}

.b-letter-container .checkbox:checked::after {
    content: '✓';
    font-size: 1.2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
}

.logo {
    width: 80%;
    transition: width 0.3s ease, top 0.3s ease, left 0.3s ease, margin 0.3s ease;
}


/* Heading Styles */

.heading-1 {
	font-size: 5vh;
	font-weight: bold;
	color: #edf2f4;
}

.heading-2 {
	font-size: 2.5vh;
	color: #edf2f4;
}

.heading {
	font-weight: bold;
	margin-bottom: 10px;
}

/* Main Styles */

main {
	padding: 15px;
	width: 100%;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	box-sizing: border-box;
}




/* Form Styles */

.form-container {
	padding: 10px;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-top: 20px;
	margin: 5px;
	width: 90vw;
	max-width: 100%;
	box-sizing: border-box;
}


.category {
	font-weight: bold;
	margin-bottom: 15px;
	font-size: 2.5rem;
	color: white;
	background-color: #71BBB2; /* Teal blue instead of rgb(69, 144, 177) */
	width: 100%;
	text-align: center;
	padding: 10px 0 10px 0;
	border-radius: 20px 20px 0 0;
}

.form-element {
	display: flex;
	position: relative;
	border: 1px solid #60a3bc; /* Light blue instead of #999 */
	margin: 10px 0 10px 0;
	border-radius: 15px;
	width: 90%;
	overflow: visible; /* Ensure labels aren't clipped */
}

.two-form-elements {
	display: flex;
	justify-content: space-between;
	width: 90%;
	flex-wrap: wrap;
	gap: 10px; /* Add space between form elements */
}

.category-container {
	margin: 20px 0 20px 0;
	border: 1px solid darkgray;
	background-color: white;
	border-radius: 20px;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	box-shadow: #0a3d62 5px 5px 10px; /* Darker blue shadow instead of darkgray */
	overflow: visible; /* Ensure labels aren't clipped */
}

.check-element {
	display: flex;
	margin: 5px 0 5px 0;
	padding: 8px;
	border-radius: 10px;
	width: 90%;
	font-size: 1.7rem;
	align-items: center;
}

.check-element .checkbox {
	height: 3rem;
	width: 3rem;
	margin-right: 25px;
}

.check-element .radio {
	height: 3rem;
	width: 3rem;
	margin-right: 25px;
}

.hidden {
	display: none;
}

.b-percentage {
	min-width: 0;
	width: 3rem;
	font-size: 1.2rem;
	border-radius: 8px;
	padding: 5px;
	margin-left: 10px;
	border: 1px solid #60a3bc;
	text-align: center;
}

.category-container > fieldset {
	width: 90%;
	margin: 10px 0 20px 0;
	border-radius: 10px;
	color: black;
	background-color: white;
	padding: 15px 10px 10px 10px;
	font-size: 1.7rem;
	border: 1px solid #60a3bc;
	position: relative;
	max-width: 100%;
	box-sizing: border-box;
}

.category-container > fieldset > legend {
	background-color: white;
	padding: 0 10px;
	margin-left: 15px;
	font-weight: bold;
	color: #27445D;
	border-radius: 5px;
}

/* Additional styling for the form elements */
.category-container .form-element {
    margin: 15px 0 10px 0; /* Consistent spacing for all form elements */
}

.category-container .form-element:first-of-type {
    margin-top: 15px; /* Same as other elements, no extra space */
}

.category-container .two-form-elements {
    margin: 15px 0 10px 0; /* Match individual form elements */
}

#street-element, #street-element-contact {
	width: calc(74% - 5px); /* Account for gap */
}

#housenumber-element, #housenumber-element-contact {
	width: calc(24% - 5px); /* Account for gap */
}

#postal-element, #postal-element-contact {
	width: calc(30% - 5px); /* Account for gap */
}

#city-element, #city-element-contact {
	width: calc(68% - 5px); /* Account for gap */
}

.form-element {
	position: relative;
}

.form-element > label {
    z-index: 20; /* Increase z-index to ensure labels are above borders */
    position: absolute;
	top: -12px;
	left: 15px;
	color: #27445D;
	background-color: white;
	padding: 2px 8px;
	font-size: 1.4rem;
	font-weight: bold;
	pointer-events: none;
	border-radius: 3px;
	display: block;
	line-height: 1.2;
}

/* Ensure labels are always visible for form elements
.form-element.focused > label,
.form-element.has-content > label,
.form-element > input:focus + label,
.form-element > input:not(:placeholder-shown) + label,
.form-element.date-input > label {
	color: #27445D;
	background-color: white;
	top: -12px;
	left: 15px;
	font-size: 1.4rem;
} */

/* Handle date inputs specifically */
input[type="date"] {
	color: #333;
	font-size: 2rem;
	height: 58px; /* Match the height of other input fields */
	line-height: 1.4;
}

input[type="date"]::-webkit-calendar-picker-indicator {
	cursor: pointer;
	opacity: 0.8;
}

.form-element > input {
	min-width: 0;
	border: 0;
	font-size: 2rem;
	border-radius: 15px;
	flex-basis: 100%;
	padding: 15px;
	background-color: white;
}

.form-element > input::placeholder {
    color: #aaa;
    opacity: 0.7;
    font-style: italic;
    font-size: 1.8rem;
}

/* Field group styles */
.field-group {
    width: 100%;
    margin-bottom: 20px;
}

.field-group-label {
    display: block;
    font-weight: bold;
    color: #27445D;
    margin-bottom: 8px;
    padding-left: 15px;
    font-size: 1.3rem;
}

/* Info Styles */

.info-element {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	align-items: center;
	width: 90%;
	padding: 0px 0 30px 0;
}

.info-icon {
	width: 12%;
	margin-right: 40px;
}

.info-icon.emoji-icon {
	width: auto;
	font-size: 3rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 12%;
	line-height: 1;
}

.info-text {
	font-size: 2rem;
}

.infotext-container, .summary-container {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	margin: 5px;
	margin-bottom: 50px;
	width: 90vw;
	font-size: 1rem;
	border-radius: 20px;
	border: 1px solid darkgray;
	background-color: white;
	align-items: center;
	box-shadow: #0a3d62 5px 5px 10px; /* Darker blue shadow instead of darkgray */
}

.summary-container > fieldset{
	width: 90%;
	padding: 0;
	border-radius: 10px;
	margin: 10px 0 10px 0;
	color: black;
	background-color: white;
	padding: 0 5px 0 5px;
	position: relative;
}

.summary-container > fieldset > legend {
	background-color: white;
	padding: 0 10px;
	margin-left: 15px;
	font-weight: bold;
	color: #27445D;
	border-radius: 5px;
}

.registration-agreement-text{
	font-size: 1rem;
}

.summary-key {
	font-weight: bold;
}

.summary-value{
	text-align: right;
	overflow-wrap: anywhere; /* Add this line */
}

.summary-element{
	display:flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	padding: 5px;
}

.infotext-heading, .summary-heading {
	font-weight: bold;
	margin-bottom: 15px;
	font-size: 2.5rem;
	color: white;
	background-color: #497D74; /* Turquoise instead of rgb(224, 130, 66) */
	width: 100%;
	text-align: center;
	padding: 10px 0 10px 0;
	border-radius: 20px 20px 0 0;
}

.infotext {
	width: 90%;
	padding: 20px;
	text-align: center;
	font-size: 2.5rem;
}

/* Button Styles */

.submit-button {
	background-color: #3c6382; /* Medium blue instead of rgb(89, 163, 76) */
	color:white;
	font-size: 3rem;
	border-radius: 0 0 20px 20px;
	padding: 50px;
	width: 100%;
	border: 1px solid rgb(94, 87, 87);
	font-family: 'Open Sans', sans-serif;
}

.clear-button{
	width: 50%;
	height: 100%;
	font-size: 2.5rem;
	font-family: 'Open Sans', sans-serif;
	margin-top: 15px;
	border-radius: 15px;
	padding: 5px;
	color: black;
}

/* Menu Styles */

#menu {
	background-color: #8d99ae;
	border-radius: 5px;
	text-align: center;
	display: flex;
	justify-content: center;
	align-items: center;
	position: sticky;
	bottom: 0px;
	width: 100%;
	height: 50px;
}

canvas{
	border: 1px solid black;
	margin-top: 20px;
	width: 90%;
}

#registration-final{
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-top: 0px;
	width: 100%;
	box-sizing: border-box;
}

.return-link {
	text-decoration: none;
}

.mandatory {
	color: #d64636;
}	

.mandatory-notice {
    font-size: 0.9rem;
    color: #d64636;
    margin: 10px 0;
    display: block;
    text-align: center;
}

/* Error Highlighting Styles */
.highlight-error {
    border: 2px solid #ff3860 !important;
    background-color: #ffeff3 !important;
}

/* More specific rules for form-field inputs */
.form-field input.highlight-error,
.form-field select.highlight-error {
    border: 2px solid #ff3860 !important;
    background-color: #ffeff3 !important;
}

/* Ensure birthdate selectors also get highlighted */
.birthdate-select.highlight-error {
    border: 2px solid #ff3860 !important;
    background-color: #ffeff3 !important;
}

/* Highlight error for checkboxes and radio buttons */
input[type="checkbox"].highlight-error,
input[type="radio"].highlight-error,
.check-element input.highlight-error {
    border: 2px solid #ff3860 !important;
    background-color: #ffeff3 !important;
}

/* Special styling for disability percentage input */
.b-percentage.highlight-error {
    border: 2px solid #ff3860 !important;
    background-color: #ffeff3 !important;
}

/* Highlight error for any input regardless of parent */
input.highlight-error,
select.highlight-error,
textarea.highlight-error {
    border: 2px solid #ff3860 !important;
    background-color: #ffeff3 !important;
}

.invalid {
    position: relative;
}

.invalid::after {
    content: "Pflichtfeld";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #ff3860;
    opacity: 0.8;
}

/* Form field specific invalid state */
.form-field.invalid {
    position: relative;
}

.form-field.invalid::after {
    content: "Pflichtfeld";
    position: absolute;
    right: 15px;
    top: 1rem;
    font-size: 0.75rem;
    color: #ff3860;
    font-weight: 600;
    background: white;
    padding: 0 4px;
    z-index: 10;
}

fieldset.highlight-error {
    border: 2px solid #ff3860 !important;
    background-color: #ffeff3 !important;
    position: relative;
}

fieldset.highlight-error legend {
    color: #ff3860;
    font-weight: bold;
}

fieldset.highlight-error::after {
    content: "Bitte auswählen";
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 0.8rem;
    color: #ff3860;
    opacity: 0.8;
}

/* Animation for error feedback */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* Submit button hover animation */
.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Additional styles for input focus when there's an error */
.highlight-error:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 56, 96, 0.3);
}

.validation-message {
    color: #ff3860;
    font-size: 1rem;
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    background-color: #ffeff3;
    border: 1px solid #ff3860;
    font-weight: bold;
    animation: pulse 1.5s;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.hidden {
    display: none !important;
}

/* Signature container styles */
.signature-container {
    width: 100%;
	max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 15px 0;
    position: relative;
}

.signature-container label {
    z-index: 20;
    position: absolute;
    top: 5px;
    left: 25px;
    color: #27445D;
    background-color: white;
    padding: 2px 8px;
    font-size: 1.4rem;
    font-weight: bold;
    pointer-events: none;
    border-radius: 3px;
    display: block;
    line-height: 1.2;
}

#signature-canvas {
    width: 90%;
    border: 1px solid #60a3bc;
    border-radius: 15px;
    margin-top: 15px;
    margin-bottom: 10px;
}