/* ===========================
   STYLE DU BON DE PRISE EN CHARGE - HELPORDI
   VERSION PROPRE
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --blue: #1a3a5c;
    --accent: #e8b84b;
    --text: #1a3a5c;
    --muted: #8a99aa;
    --bg: #f8fafc;
    --radius: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    padding: 20px 10px;
    min-height: 100vh;
}

/* ✅ CENTRAGE GARANTI */
.container {
    max-width: 820px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* HEADER */
.header {
    background: var(--blue);
    color: white;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo-header {
    height: 65px;
    width: auto;
}

.header-right {
    flex: 1;
    min-width: 240px;
}

.doc-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.doc-date,
.doc-num {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* BODY */
.body-wrap {
    padding: 30px 25px 40px;
}

.section {
    margin-bottom: 28px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e5e9f0;
}

/* Champs */
.field {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 2px solid #e5e9f0;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 14px;
}

.field input,
.field textarea {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    outline: none;
    color: var(--text);
}

.field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Info photos */
.field + div {
    font-size: 11px;
    color: var(--muted);
    padding-left: 32px;
    margin-top: -2px;
    margin-bottom: 6px;
}

/* Grille */
.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    margin-top: 8px;
}

/* Checkboxes */
.check-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    cursor: pointer;
}

.check-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.check-box {
    width: 19px;
    height: 19px;
    border: 2px solid var(--blue);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.check-item input:checked + .check-box {
    background: var(--blue);
}

.check-box svg {
    opacity: 0;
}

.check-item input:checked + .check-box svg {
    opacity: 1;
}

.check-label {
    font-size: 0.95rem;
}

/* Signature */
.sig-wrap {
    position: relative;
    border: 2px dashed #c3d0e0;
    border-radius: 10px;
    background: #fafcff;
    margin: 12px 0 15px;
}

#signature {
    width: 100%;
    height: 110px;
}

.sig-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--muted);
    font-size: 0.9rem;
}

/* Boutons */
.btn-clear {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-generate {
    width: 100%;
    background: var(--blue);
    color: white;
    border: none;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 10px;
}

/* Clause */
.clause {
    background: #fffaf0;
    border: 1px solid #f0d78a;
    padding: 16px;
    border-radius: 10px;
    font-size: 0.92rem;
}

/* Responsive */
@media (max-width: 640px) {
    .grid2 {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }
}
