:root {
    --main-font: "Times New Roman", "Liberation Serif", Georgia, serif;
    --accent-font: "Arial", "Helvetica", sans-serif;
    --border-color: #444;
    --text-color: #222;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 1.5rem 0 2rem 0;
    background: #e5e5e5;
    font-family: var(--accent-font);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.form-wrapper {
    background: #fff;
    border-radius: 4px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 0 6px rgba(0,0,0,0.15);
    font-size: 0.9rem;
}

.form-title {
    font-weight: bold;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #005bbb;
}

.form-section {
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.6rem 1rem;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-wrapper {
        padding: 1rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.35rem 0.45rem;
    font-size: 0.85rem;
    border-radius: 3px;
    border: 1px solid #ccc;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 50px;
}

.checkbox-group-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    font-size: 0.8rem;
}

.checkbox-group-inline label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-actions {
    margin-top: 0.7rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
}

.btn {
    display: inline-block;
    background: #ffffff;
    color: #333;
    border: 1px solid #888;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}

.btn.primary {
    background: #005bbb;
    color: #fff;
    border-color: #004b9a;
}

.btn.primary:hover {
    background: #004b9a;
}

.btn:hover {
    background: #f4f4f4;
}

.hint {
    font-size: 0.75rem;
    color: #555;
}

.page {
    width: 21cm;
    min-height: auto;
    margin: 0 auto;
    padding: 1.5cm 2cm;
    background: #fff;
    box-shadow: 0 0 12px rgba(0,0,0,0.18);
    position: relative;
    font-family: var(--main-font);
    color: var(--text-color);
}

/* Pour l'impression et l'export PDF */
@media print {
    body {
        background: #fff;
        padding: 0;
    }
    .form-wrapper {
        display: none !important;
    }
    .page {
        margin: 0;
        box-shadow: none;
        width: auto;
        min-height: auto;
        padding: 2.5cm 2.3cm;
    }
}

/* Cache le formulaire pour l'export PDF */
.pdf-export .form-wrapper {
    display: none !important;
}

.pdf-export .container {
    padding: 0 !important;
}

.pdf-export body {
    padding: 0 !important;
    background: #fff !important;
}

header {
    border-bottom: 2px solid #000;
    padding-bottom: 1rem;
    margin-bottom: 1.2rem;
    font-size: 1rem;
}

.cabinet-info {
    white-space: pre-line;
    font-family: var(--accent-font);
    line-height: 1.8;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.logo-placeholder {
    width: 90px;
    height: 90px;
    border: 1px solid #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--accent-font);
    font-size: 0.65rem;
    color: #777;
}

.ref-info {
    text-align: right;
    font-size: 0.8rem;
    font-family: var(--accent-font);
}

h1 {
    text-align: center;
    font-size: 1.6rem;
    letter-spacing: 0.08em;
    margin: 0.8rem 0 0.8rem 0;
    text-transform: uppercase;
}

h1 span {
    border-bottom: 2px solid #000;
    padding-bottom: 0.15rem;
}

.subtitle {
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-family: var(--accent-font);
    letter-spacing: 0.05em;
}

.section {
    margin-bottom: 1rem;
}

.section-title {
    font-size: 0.95rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0.2rem;
    font-family: var(--accent-font);
}

.field-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.label-print {
    min-width: 130px;
    font-weight: bold;
}

.value-print {
    flex: 1;
    border-bottom: 1px dotted #555;
    padding: 0 0 0.1rem 0.3rem;
    min-height: 1.1em;
}

.inline-block {
    display: inline-block;
    min-width: 70px;
    border-bottom: 1px dotted #555;
    margin: 0 0.25rem;
    min-height: 1.1em;
}

.checkbox-line {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.box {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 1px solid #000;
    margin-right: 0.35rem;
    vertical-align: middle;
    text-align: center;
    line-height: 8px;
    font-size: 9px;
    font-weight: bold;
}

.comment-area {
    min-height: 65px;
    border: 1px dotted #999;
    padding: 0.4rem;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.legal-note {
    font-size: 0.78rem;
    color: #555;
    margin-top: 0.6rem;
    font-family: var(--accent-font);
}

.signature-row {
    display: flex;
    justify-content: space-between;
    margin-top: 2.2rem;
    font-size: 0.95rem;
}

.signature-block {
    width: 50%;
    text-align: left;
}

.signature-line {
    margin-top: 2.2rem;
    border-top: 1px solid #000;
    width: 70%;
}

footer {
    margin-top: 2rem;
    font-size: 0.65rem;
    font-family: var(--accent-font);
    color: #777;
    border-top: 1px solid #ccc;
    padding-top: 0.3rem;
    display: flex;
    justify-content: space-between;
}

/* Styles pour l'export PDF - annule les styles responsive */
.pdf-exporting header {
    font-size: 1rem !important;
    padding-bottom: 1rem !important;
    margin-bottom: 1.2rem !important;
}

.pdf-exporting .cabinet-info {
    line-height: 1.8 !important;
}

.pdf-exporting h1 {
    font-size: 1.6rem !important;
    margin: 0.8rem 0 !important;
}

.pdf-exporting .subtitle {
    font-size: 0.9rem !important;
    margin-bottom: 1rem !important;
}

.pdf-exporting .section {
    margin-bottom: 1rem !important;
}

.pdf-exporting .section-title {
    font-size: 0.95rem !important;
}

.pdf-exporting .field-row {
    font-size: 0.95rem !important;
    flex-direction: row !important;
    gap: 0 !important;
}

.pdf-exporting .label-print {
    min-width: 130px !important;
}

.pdf-exporting .value-print {
    border-bottom: 1px dotted #555 !important;
    padding: 0 0 0.1rem 0.3rem !important;
}

.pdf-exporting .checkbox-line {
    font-size: 0.95rem !important;
}

.pdf-exporting .comment-area {
    min-height: 65px !important;
    font-size: 0.9rem !important;
}

.pdf-exporting .signature-row {
    flex-direction: row !important;
    gap: 0 !important;
    margin-top: 2.2rem !important;
}

.pdf-exporting .signature-block {
    width: 50% !important;
}

.pdf-exporting .signature-line {
    margin-top: 2.2rem !important;
    width: 70% !important;
}

.pdf-exporting footer {
    margin-top: 2rem !important;
    font-size: 0.65rem !important;
}

@media (max-width: 900px) {
    body {
        padding: 0;
    }

    .container {
        padding: 0;
        max-width: 100%;
    }

    .form-wrapper {
        margin-bottom: 1rem;
        border-radius: 0;
        padding: 1rem;
    }

    .form-section {
        margin-bottom: 1rem;
        padding-bottom: 0.8rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn {
        width: 100%;
        padding: 0.6rem;
    }

    .page {
        width: 100%;
        min-height: auto;
        padding: 1rem;
        box-shadow: none;
        margin: 0;
    }

    footer {
        margin-top: 1.5rem;
        font-size: 0.6rem;
    }

    .signature-row {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .signature-block {
        width: 100%;
    }

    .signature-line {
        margin-top: 1.5rem;
        width: 100%;
    }

    header {
        font-size: 0.8rem;
        padding-bottom: 0.8rem;
        margin-bottom: 1rem;
    }

    .cabinet-info {
        line-height: 1.5;
        max-width: 100%;
    }

    h1 {
        font-size: 1.2rem;
        margin: 0.6rem 0;
    }

    .subtitle {
        font-size: 0.8rem;
        margin-bottom: 0.8rem;
    }

    .section {
        margin-bottom: 0.8rem;
    }

    .section-title {
        font-size: 0.85rem;
    }

    .field-row {
        font-size: 0.85rem;
        flex-direction: column;
        gap: 0.2rem;
    }

    .label-print {
        min-width: auto;
        font-weight: bold;
    }

    .value-print {
        border-bottom: 1px solid #999;
        padding: 0.2rem 0;
    }

    .checkbox-line {
        font-size: 0.85rem;
    }

    .comment-area {
        min-height: 50px;
        font-size: 0.85rem;
    }
}
