/* brochure.css — Styles print A4 brochure Enerlab Academy
 * Format : A4 portrait, 8 pages
 * Police : Poppins, palette : #0055a4 (bleu) + #ff6b35 (accent)
 */

@page {
    size: A4 portrait;
    margin: 18mm;
}

@page :first {
    margin: 0; /* cover full-bleed */
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 10pt;
    line-height: 1.5;
    color: #212529;
    margin: 0;
    padding: 0;
}

h1, h2 { color: #0055a4; margin-top: 0; }
h1 { font-size: 28pt; margin: 0 0 12pt; }
h2 { font-size: 18pt; margin: 0 0 8pt; border-bottom: 2pt solid #ff6b35; padding-bottom: 4pt; }
h3 { font-size: 12pt; color: #003d7a; margin: 6pt 0 3pt; }
h4 { font-size: 10pt; color: #0055a4; margin: 4pt 0 2pt; }

p { margin: 0 0 6pt; }

.page {
    page-break-after: always;
    min-height: 257mm;
    position: relative;
    padding-bottom: 14mm; /* footer space */
}
.page:last-child { page-break-after: auto; }

.cover {
    page-break-after: always;
    background: linear-gradient(135deg, #0055a4 0%, #003d7a 100%);
    color: #fff;
    padding: 30mm 25mm;
    height: 297mm;
    margin: 0;
    position: relative;
}
.cover h1 { color: #fff; font-size: 36pt; margin-bottom: 6pt; }
.cover .eyebrow { font-size: 11pt; letter-spacing: 2pt; text-transform: uppercase; opacity: 0.85; margin: 0 0 18pt; }
.cover .subtitle { font-size: 14pt; opacity: 0.92; }
.cover .badge {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    border: 1pt solid rgba(255,255,255,0.4);
    padding: 4mm 6mm;
    border-radius: 3mm;
    font-size: 10pt;
    margin-top: 12mm;
}
.cover .logo-zone {
    position: absolute;
    bottom: 20mm; left: 25mm; right: 25mm;
    text-align: center;
    color: rgba(255,255,255,0.85);
    font-size: 9pt;
}

.kpi-row {
    display: flex; gap: 4mm;
    margin: 6mm 0;
    background: #f8f9fa;
    padding: 5mm; border-radius: 3mm;
}
.kpi { flex: 1; text-align: center; }
.kpi-value { font-size: 20pt; font-weight: 700; color: #0055a4; line-height: 1; }
.kpi-label { font-size: 8pt; color: #6c757d; margin-top: 2pt; }

.step {
    display: flex; gap: 4mm;
    margin-bottom: 4mm;
    break-inside: avoid;
}
.step-n {
    flex-shrink: 0;
    width: 9mm; height: 9mm; border-radius: 50%;
    background: #0055a4; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 10pt;
}
.step-content { flex: 1; }

table {
    width: 100%; border-collapse: collapse;
    margin: 3mm 0;
    font-size: 9pt;
}
th, td {
    padding: 2.5mm 3mm;
    text-align: left;
    border-bottom: 0.3pt solid #dee2e6;
    vertical-align: top;
}
th { background: #f8f9fa; color: #0055a4; font-weight: 600; }
tr.total { background: rgba(0,85,164,.08); font-weight: 700; }
td.right, th.right { text-align: right; }

.pillars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5mm;
    margin-top: 5mm;
}
.pillar {
    background: #f8f9fa;
    border-left: 1.5mm solid #0055a4;
    padding: 4mm;
    border-radius: 1.5mm;
    break-inside: avoid;
}
.pillar h3 { color: #0055a4; font-size: 11pt; margin-bottom: 2pt; }
.pillar p { font-size: 9pt; color: #495057; }

.filieres {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4mm;
}
.filiere {
    background: #fff;
    border: 0.5pt solid #dee2e6;
    border-top: 1.5mm solid #0055a4;
    padding: 4mm;
    border-radius: 1.5mm;
    break-inside: avoid;
}
.filiere h3 { color: #0055a4; font-size: 10pt; margin-bottom: 2pt; }
.filiere p { font-size: 8.5pt; color: #6c757d; margin: 0; }

.contact-block {
    background: #f8f9fa;
    padding: 6mm;
    border-radius: 3mm;
    margin: 5mm 0;
}
.contact-block h3 { color: #0055a4; margin-top: 0; }

.qr-block {
    display: flex; gap: 5mm; align-items: center;
    background: #f8f9fa; padding: 5mm; border-radius: 3mm;
    margin-top: 6mm;
    break-inside: avoid;
}
.qr-block img { width: 30mm; height: 30mm; }

.footer-meta {
    position: absolute; bottom: 0; left: 0; right: 0;
    font-size: 7pt; color: #6c757d;
    border-top: 0.3pt solid #dee2e6;
    padding-top: 2mm;
}
.footer-meta .left { float: left; }
.footer-meta .right { float: right; }
.footer-meta::after { content: ""; display: block; clear: both; }

.callout {
    background: #fff3cd;
    border-left: 1.2mm solid #ffc107;
    padding: 4mm;
    border-radius: 1.5mm;
    margin: 4mm 0;
    font-size: 9.5pt;
}

a { color: #0055a4; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Print-only utilities */
.no-print { display: none !important; }

@media screen {
    body { background: #e9ecef; padding: 8mm 0; }
    .page, .cover { background: #fff; margin: 5mm auto; max-width: 210mm; box-shadow: 0 2mm 5mm rgba(0,0,0,.15); padding: 18mm; }
    .cover { padding: 30mm 25mm; height: 297mm; }
    .print-bar {
        position: fixed; top: 0; left: 0; right: 0;
        background: #0055a4; color: white; padding: 10px; text-align: center;
        font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: 14px;
        z-index: 999;
        box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    }
    .print-bar button {
        background: white; color: #0055a4; border: none; padding: 8px 18px;
        border-radius: 4px; cursor: pointer; font-weight: 600; margin-left: 12px;
    }
    body { padding-top: 50px; }
}

@media print {
    .print-bar { display: none !important; }
}
