@page {
    size: A4;
    margin: 20mm;
}

html {
    font-size: 11pt;
}

body {
    font-family: sans-serif;
    color: #000;
    background: #fff;
    line-height: 1.4;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
}

.page {
    max-width: 800px;
    margin: auto;
    position: relative;
}

.first-part {
    position: relative;
}

header, footer {
    text-align: center;
    font-size: 1rem;
}

header {
    display: flex;
    width: 100%;
}

header figure {
    display: flex;
    align-items: center;
}

header p {
    text-align: center;
    flex-grow: 1;
    font-size: 1.2rem;
}

header p .name {
    font-size: 1.5em;
}

h1, h2 {
    text-transform: uppercase;
}

h1, .conditions h2 {
    margin: 1.5em 0 1em;
    text-align: center;
    font-size: 1.4rem;
    border: solid black;
    border-width: 1px 2px 2px 1px;
    padding: 3px 0;
}

.form-section {
    margin-bottom: 1.2em;
}

.form-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.form-row label {
    white-space: nowrap;
    font-weight: normal;
}

.inline {
    margin-left: 10px;
}

input, textarea {
    border: none;
    background: none;
    font-family: inherit;
    font-size: 14px;
    padding: 2px 4px;
    flex: 1;
}

input, textarea, [contenteditable] {
    border-bottom: 1px solid #000;
}

[contenteditable] {
    display: inline-block;
    min-width: 12px;
    vertical-align: middle;
}

input.short { width: 100px; flex: 0 0 auto; }
input.medium { width: 200px; flex: 0 0 auto; }
textarea { width: 100%; resize: none; }

input[type="checkbox"], input[type="radio"] {
    width: fit-content;
    flex: 0;
    vertical-align: middle;
    margin: 0 -10px 0 0;
}

.adh {
    gap: 15px;
}

.adh label {
    margin-bottom: -2px;
}

fieldset {
    margin: 2em 0;
    padding: 1em 1.5em .5em;
    border: 1px solid black;
}

.infos {
    position: relative;
}

.infos label {
    position: absolute;
    top: 0;
}

.infos textarea {
    text-indent: 17em;
}

.small {
    font-size: .8em;
    margin: 0;
}

.italic {
    font-style: italic;
}

.signatures hr {
    display: inline;
    width: 20%;
    border: 0;
}

.signature-box {
    margin-top: 2em;
}

.signature-box p {
    font-size: .8rem;
    margin: .8em 0 0;
}

.signature-box .signatures-placeholder {
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.signature-box .signatures-placeholder p {
    font-size: 1rem;
}

.sign-line {
    border-bottom: 1px solid #000;
    height: 4em;
    width: 250px;
    margin-top: 10px;
}

.add_animal_container {
    position: relative;
    margin: 0;
}

.remove_animal, #add_animal {
    position: absolute;
    display: block;
    right: .2em;
    font-size: 2em;
    border-radius: 50%;
    border-style: solid;
    padding: 0 .25em .1em .25em;
    width: 50px;
    height: 50px;
    z-index: 2;
}

.remove_animal {
    transform: translateY(97%);
}

#add_animal {
    transform: translateY(-200%);
}

.page-break {
    page-break-before: always;
    margin: 5em 0;
    border-top: 1px dashed black;
    text-align: center;
    position: relative;
}

.page-break span {
    display: inline-block;
    padding: 0 1em;
    background: white;
    left: 50%;
    top: 0;
    transform: translate(-50%, -50%);
    position: absolute;
}

.conditions {
    font-size: .8rem;
}

.conditions ol {
    padding-left: 20px;
}

.conditions ol li {
    margin: 2em 0;
}

.conditions .signatures {
    margin-top: 4em;
}

footer {
    font-size: 10px;
    margin-top: 20mm;
}

@media print {
    html {
        font-size: 8pt;
    }

    input, textarea, [contenteditable] {
        border: 0;
    }

    .page-break {
        margin: 0;
        border: 0;
        font-size: 0;
    }

    .page-break span, button, .add_animal_container {
        display: none !important;
    }
}
