/* assets/css/cnam_print.css */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&display=swap');

/* CONFIGURATION GLOBALE A4 */
@page {
    size: A4;
    margin: 0;
}

body {
    margin: 0;
    padding: 0;
    background: #525659;
    /* Fond type visionneuse PDF pour le mode écran */
    -webkit-print-color-adjust: exact;
}

/* ZONE D'IMPRESSION & APERÇU */
#print-overlay {
    display: block !important;
    width: 210mm;
    margin: 20mm auto;
    position: relative;
    z-index: 1000;
}

.a4-page {
    position: relative;
    width: 210mm;
    height: 297mm;
    overflow: hidden;
    background: white;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 15mm;
}

.bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 210mm;
    height: 297mm;
    z-index: 1;
}

/* STYLE DES CHAMPS OVERLAY (MANUSCRIT) */
.ov-field {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-size: 16pt;
    font-weight: 500;
    color: #0033bb;
    /* Bleu encre réaliste */
    z-index: 10;
    white-space: nowrap;
    transform: rotate(-0.8deg);
    /* Inclinaison naturelle globale */
    filter: drop-shadow(0.1mm 0.1mm 0.1mm rgba(0, 0, 0, 0.1));
}

/* Classes de Variation (Irrégularité Naturelle) */
.rot-1 {
    transform: rotate(-1.2deg);
}

.rot-2 {
    transform: rotate(0.8deg);
}

.rot-3 {
    transform: rotate(-0.4deg);
}

.rot-4 {
    transform: rotate(0.4deg) translateX(1px);
}

.ink-black {
    color: #111111;
}

/* --- POSITIONNEMENT MILLIMÉTRIQUE (Vérifié) --- */

/* Identification Patient */
.f-nom {
    top: 85mm;
    left: 140mm;
}

.f-prenom {
    top: 92mm;
    left: 140mm;
}

.f-immat {
    top: 100mm;
    left: 145mm;
    letter-spacing: 4.5mm;
    font-family: monospace;
    font-size: 14pt;
}

.f-id-unique {
    top: 112mm;
    left: 145mm;
    font-size: 11pt;
    letter-spacing: 1.5mm;
}

.f-date {
    top: 140mm;
    left: 25mm;
}

/* SECTION I: SOINS DENTAIRES */
.f-s1-dent {
    top: 151mm;
    left: 45mm;
    text-align: center;
    width: 10mm;
}

.f-s1-code {
    top: 151mm;
    left: 150mm;
}

.f-s1-cot {
    top: 151mm;
    left: 170mm;
}

.f-s1-prix {
    top: 151mm;
    left: 185mm;
    width: 22mm;
    text-align: right;
}

.f-s2-dent {
    top: 159mm;
    left: 45mm;
    text-align: center;
    width: 10mm;
}

.f-s2-code {
    top: 159mm;
    left: 150mm;
}

.f-s2-cot {
    top: 159mm;
    left: 170mm;
}

.f-s2-prix {
    top: 159mm;
    left: 185mm;
    width: 22mm;
    text-align: right;
}

.f-s3-dent {
    top: 167mm;
    left: 45mm;
    text-align: center;
    width: 10mm;
}

.f-s3-code {
    top: 167mm;
    left: 150mm;
}

.f-s3-cot {
    top: 167mm;
    left: 170mm;
}

.f-s3-prix {
    top: 167mm;
    left: 185mm;
    width: 22mm;
    text-align: right;
}

.f-s4-dent {
    top: 175mm;
    left: 45mm;
    text-align: center;
    width: 10mm;
}

.f-s4-code {
    top: 175mm;
    left: 150mm;
}

.f-s4-cot {
    top: 175mm;
    left: 170mm;
}

.f-s4-prix {
    top: 175mm;
    left: 185mm;
    width: 22mm;
    text-align: right;
}

/* SECTION II: PROTHÈSES */
.f-p1-dent {
    top: 225mm;
    left: 45mm;
    text-align: center;
    width: 10mm;
}

.f-p1-code {
    top: 225mm;
    left: 150mm;
}

.f-p1-cot {
    top: 225mm;
    left: 170mm;
}

.f-p1-prix {
    top: 225mm;
    left: 185mm;
    width: 22mm;
    text-align: right;
}

.f-p2-dent {
    top: 233mm;
    left: 45mm;
    text-align: center;
    width: 10mm;
}

.f-p2-code {
    top: 233mm;
    left: 150mm;
}

.f-p2-cot {
    top: 233mm;
    left: 170mm;
}

.f-p2-prix {
    top: 233mm;
    left: 185mm;
    width: 22mm;
    text-align: right;
}

/* ADMINISTRATIVE */
.f-reg-cns {
    top: 73.5mm;
    left: 172.5mm;
    font-size: 18pt;
    color: #cc0000;
}

.f-reg-cnrps {
    top: 73.5mm;
    left: 184.5mm;
    font-size: 18pt;
    color: #cc0000;
}

.f-reg-conv {
    top: 73.5mm;
    left: 196.5mm;
    font-size: 18pt;
    color: #cc0000;
}

.f-note {
    top: 255mm;
    left: 22mm;
    width: 165mm;
    white-space: normal;
    line-height: 6mm;
    font-size: 14pt;
    transform: rotate(-0.5deg);
}

.f-dr {
    bottom: 35mm;
    left: 135mm;
    font-size: 10pt;
    color: #000;
    opacity: 0.8;
}

/* SPÉCIFIQUE IMPRESSION */
@media print {
    body {
        background: white !important;
    }

    #print-overlay {
        margin: 0 !important;
        width: 210mm !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }

    .a4-page {
        margin: 0 !important;
        box-shadow: none !important;
    }

    /* Masquer le reste de l'UI si nécessaire */
    .no-print {
        display: none !important;
    }
}