:root {
    --a4-width: 210mm;
    --a4-height: 297mm;
    --page-padding: 0mm 15mm;
    --page-padding-top: 0mm;
}

@page {
    size: A4;
    margin: var(--page-padding);
}

main {
    width: min(100%, var(--a4-width));
    min-height: var(--a4-height);
    margin: 0 auto;
    padding: var(--page-padding);
    padding-top: var(--page-padding-top);
    box-sizing: border-box;
    font-size: 14px;
}

@media print {
    html,
    body {
        margin: 0;
        padding: 0;
    }

    main {
        width: var(--a4-width);
        min-height: auto;
        margin: 0;
        padding: var(--page-padding);
        padding-top: var(--page-padding-top);
    }

    .credentials2,
    .address,
    .owner,
    .phone,
    .email {
        grid-template-columns: 120px minmax(0, 1fr);
    }

    .notes {
        display: flex;
        max-width: none;
    }

    #print-button,
    .signature-clear,
    .geo-button,
    input[type="file"],
    .pictures label {
        display: none !important;
    }
}

section {
    margin-top: 1.5rem;
}


/* Logo und Heading */


.logo {
    width: 300px;
    margin: 16px auto 12px auto;
    display: block;
}

h5 {
    font-size: 1.1em;
    text-align :center;
    margin-bottom: 2em !important;
}

body {
    font-size: 0.95rem;
}


/* Kontaktinformationen */


.contact {
    display: grid;
    gap: 12px;
    max-width: 550px;
}

.credentials1,
.credentials2 {
    display: grid;
    column-gap: 12px;
    align-items: start;
}

.credentials1 {
    grid-template-columns: 1fr;
    row-gap: 12px;
}

.credentials2 {
    grid-template-columns: 120px minmax(0, 1fr);
}

.address,
.owner,
.phone,
.email {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
}

.input-with-icon {
    position: relative;
    width: 100%;
}

.input-with-icon input {
    padding-right: 36px;
    width: 100%;
    box-sizing: border-box;
}

.geo-button {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    color: #1f1f1f;
}

.geo-button svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.credentials2-wrapper {
    display: grid;
    row-gap: 12px;
}

.phone,
.email {
    grid-template-columns: 100px minmax(0, 1fr);
}
.contact input {
    border: 1px solid #1f1f1f;
    border-radius: 6px;
}


/* Datum und Uhrzeit */


.datetime label {
    width: 60px;
    
}

.datetime input {
    margin-bottom: 1rem;
    width: 180px;
    box-sizing: border-box;
}

.datetime input:last-of-type {
    margin-bottom: 0;
}


/* Checkboxen */


.checkboxes input {
    width: 16px;
    height: 16px;
    margin-right: 0.5em;
}


/* Notizen */


.notes {
    display: flex;
    gap: 1rem;
}

.notes textarea {
    height: 120px;
}


/* Bilderupload */


.pictures {
    display: grid;
    gap: 12px;
    max-width: 720px;
}

.picture-previews {
    display: flex;
    gap: 12px;
}

.picture-previews .preview-item {
    flex: 1;
    min-width: 0;
    aspect-ratio: 4 / 3;
    max-width: 220px;
}

.picture-previews img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #1f1f1f;
    border-radius: 6px;
    display: block;
}


/* Unterschrift Pads */ 


.signatures {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
	margin-top: 16px;
}

.signature-block {
	display: grid;
	gap: 8px;
}

.signature-pad {
	border: 1px solid #1f1f1f;
	border-radius: 6px;
	background: #fff;
	height: 100px;
	position: relative;
	touch-action: none;
}

.signature-pad canvas {
	width: 100%;
	height: 100%;
	display: block;
}

.signature-clear {
	width: fit-content;
}


/* Druck-Button */


#print-button {
    display: block;
    margin: 24px auto 0 auto;
    background-color:#d72622;
    color:white;
    border:0;
    box-shadow: none;
    border-radius:3px;
    padding-left:11px;
    padding-right:11px;
    padding-top:7px;
    padding-bottom:7px;
    font-size:16px;
}

@media screen and (max-width: 500px)
{

    main
    {
        padding: 20px;
    }
    .credentials2
    {
        grid-template-columns: auto;
    }
    .checkboxes
    {
        font-size:12px;
    }
    .address,
    .owner {
        grid-template-columns: 100px minmax(0, 1fr);
    }

    .notes
    {
        display:inline-block;
        max-width:100%;

        textarea
        {
            max-width:100%;
            width:100%;
            border:1px solid black;
        }
    }
}