/* style.css - version professionnelle avec support impression A4 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', Times, serif;
    background-color: #f0f3f5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 20px;
    line-height: 1.5;
    color: #1e2b3a;
}

.contract-container {
    max-width: 1000px;
    width: 100%;
    background: white;
    padding: 35px 40px;
    border-radius: 8px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.05);
    margin: 0 auto;
}

/* En-tête avec logo et coordonnées */
.contract-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid #1f4e79;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.logo-company {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.logo {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}

.company-details h1 {
    color: #1f4e79;
    font-size: 26px;
    margin: 0 0 5px 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.company-details p {
    margin: 2px 0;
    font-size: 13px;
    color: #2c3e50;
}

.contract-number {
    background: #1f4e79;
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 8px rgba(31,78,121,0.3);
    min-width: 180px;
    align-self: center;
}

h2 {
    text-align: center;
    font-size: 24px;
    color: #0b3b5c;
    margin: 5px 0 20px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    border-bottom: 1px solid #a0c4d7;
    padding-bottom: 12px;
}

/* Identité des parties */
.employee-info {
    margin: 30px 0;
    text-align: justify;
}

.employee-info h3 {
    color: #1f4e79;
    font-size: 18px;
    margin-bottom: 15px;
    border-left: 5px solid #1f4e79;
    padding-left: 12px;
}

.employee-info p {
    margin: 10px 0;
}

.et {
    font-weight: bold;
    font-size: 1.1em;
    margin: 15px 0;
}

/* Articles du contrat */
.contract-details {
    text-align: justify;
    margin-top: 20px;
}

.contract-details h3 {
    color: #1f4e79;
    font-size: 16px;
    margin-top: 25px;
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid #cbd5e0;
    padding-bottom: 5px;
}

.contract-details p {
    margin-bottom: 10px;
    text-align: justify;
}

.fait {
    margin-top: 35px;
    font-style: italic;
    text-align: right;
}

/* Signatures */
.signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px dashed #556b7c;
}

.signature-employer, .signature-employee {
    width: 45%;
}

.signature-employer p, .signature-employee p {
    margin: 5px 0;
}

.mention {
    font-style: italic;
    color: #4a5c66;
    font-size: 0.95em;
    margin-top: 10px;
}

.signature-place {
    margin-top: 15px;
    font-size: 0.9em;
    color: #2c3e50;
    border-top: 1px solid #b0c4ce;
    padding-top: 8px;
    width: 80%;
}

/* QR Code */
.qr-code {
    text-align: center;
    margin-top: 50px;
    padding-top: 25px;
    border-top: 2px solid #d0dfe6;
}

.qr-image {
    width: 150px;
    height: 150px;
    border: 1px solid #7f8c8d;
    padding: 8px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin: 10px 0;
}

.qr-reference {
    font-size: 12px;
    color: #4f6f7f;
}

/* Formulaire */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

form {
    background: #fbfcfc;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e5e8e8;
}

label {
    display: block;
    margin-top: 18px;
    font-weight: 600;
    color: #1e3b5c;
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    border: 1px solid #ccd1d9;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 15px;
    transition: border 0.2s;
}

input:focus, textarea:focus, select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

textarea {
    height: 100px;
    resize: vertical;
}

input[type="submit"] {
    background: #1e8449;
    color: white;
    border: none;
    padding: 14px 25px;
    margin-top: 30px;
    cursor: pointer;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    transition: background 0.2s;
    width: 100%;
    letter-spacing: 1px;
}

input[type="submit"]:hover {
    background: #196f3d;
}

#date_fin_div {
    display: none;
}

/* Impression A4 */
@media print {
    body {
        background: white;
        padding: 0;
    }
    .contract-container {
        box-shadow: none;
        border-radius: 0;
        padding: 0.2cm;
    }
    .contract-number {
        background: #1f4e79;
        color: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .logo {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    a {
        text-decoration: none;
        color: black;
    }
    .qr-image {
        box-shadow: none;
        border: 1px solid black;
    }
    .qr-reference {
        display: none;
    }
    @page {
        margin: 2cm;
    }
}