/* ═══════════════════════════════════════════════════════════
   MonDocument — doc-style.css
   Design A4 professionnel, sobre et imprimable
   ═══════════════════════════════════════════════════════════ */

/* ── Wrapper principal ──────────────────────────────────── */
.doc-outer {
  margin-top: 20px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.55);
}

/* ── Barre d'outils du document ─────────────────────────── */
.doc-toolbar {
  background: #111827;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.doc-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #9ba3b8;
  font-family: 'DM Sans', sans-serif;
}

.doc-toolbar-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #2ecc71;
  display: inline-block;
}

.doc-toolbar-actions {
  display: flex;
  gap: 6px;
}

.doc-tool-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: #9ba3b8;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.doc-tool-btn:hover { background: rgba(255,255,255,0.12); color: #e8eaf0; }
.doc-tool-btn.print-btn { border-color: rgba(201,168,76,0.35); color: #c9a84c; }
.doc-tool-btn.print-btn:hover { background: rgba(201,168,76,0.12); }

/* ── Feuille A4 ─────────────────────────────────────────── */
.doc-sheet-wrap {
  background: #525659;
  padding: 24px;
  overflow-y: auto;
  max-height: 600px;
}

.doc-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 794px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 12pt;
  line-height: 1.6;
  color: #1a1a1a;
  position: relative;
}

/* ── En-tête du document ────────────────────────────────── */
.doc-sheet-header {
  background: #1a2744;
  padding: 22px 40px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.doc-sheet-header-left { flex: 1; }

.doc-sheet-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.doc-sheet-logo span { color: #c9a84c; font-weight: 700; }

.doc-sheet-ref {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  margin-top: 6px;
}

.doc-sheet-header-right {
  text-align: right;
  flex-shrink: 0;
}

.doc-sheet-date {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  line-height: 1.7;
}

/* ── Ligne dorée ────────────────────────────────────────── */
.doc-gold-line {
  height: 3px;
  background: linear-gradient(90deg, #c9a84c, #e8c97a, #c9a84c);
}

/* ── Corps du document ──────────────────────────────────── */
.doc-body {
  padding: 36px 48px 40px;
}

/* Titre principal */
.doc-main-title {
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 18pt;
  font-weight: 700;
  color: #1a2744;
  text-align: center;
  margin: 0 0 6px 0;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.doc-sub-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 10pt;
  color: #666;
  text-align: center;
  margin: 0 0 24px 0;
  font-style: italic;
}

.doc-title-divider {
  width: 60px;
  height: 2px;
  background: #1a2744;
  margin: 12px auto 28px;
}

/* Section */
.doc-section-title {
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 10.5pt;
  font-weight: 700;
  color: #1a2744;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 22px 0 10px 0;
  padding: 7px 12px;
  background: #f0f4ff;
  border-left: 3px solid #1a2744;
}

/* Texte courant */
.doc-paragraph {
  font-size: 11pt;
  color: #2a2a2a;
  margin: 0 0 10px 0;
  text-align: justify;
  line-height: 1.75;
}

/* Champ clé::valeur */
.doc-fields-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 16px;
  margin: 10px 0 14px 0;
  background: #fafbff;
  border: 1px solid #e4e8f0;
  border-radius: 6px;
  padding: 12px 16px;
}

.doc-field-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10pt;
  font-weight: 600;
  color: #1a2744;
  white-space: nowrap;
  padding-right: 8px;
  border-right: 2px solid #c9a84c;
}

.doc-field-value {
  font-size: 10.5pt;
  color: #2a2a2a;
  font-family: 'Times New Roman', Georgia, serif;
}

/* Items de liste */
.doc-item {
  font-size: 11pt;
  color: #2a2a2a;
  padding: 3px 0 3px 20px;
  position: relative;
  line-height: 1.65;
}
.doc-item::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #1a2744;
  font-size: 9pt;
  top: 5px;
}

.doc-sub-item {
  font-size: 10.5pt;
  color: #444;
  padding: 2px 0 2px 40px;
  position: relative;
  line-height: 1.6;
}
.doc-sub-item::before {
  content: '–';
  position: absolute;
  left: 24px;
  color: #888;
}

/* Zone de signature */
.doc-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #dde3ef;
}

.doc-signature-block { text-align: center; }

.doc-signature-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 9.5pt;
  font-weight: 600;
  color: #1a2744;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.doc-signature-role {
  font-size: 9pt;
  color: #888;
  font-style: italic;
  margin-bottom: 28px;
  font-family: 'DM Sans', sans-serif;
}

.doc-signature-area {
  border-bottom: 1.5px solid #bbb;
  margin: 0 16px;
  padding-bottom: 4px;
  min-height: 48px;
}

.doc-signature-date {
  font-size: 8.5pt;
  color: #aaa;
  margin-top: 6px;
  font-family: 'DM Sans', sans-serif;
}

/* Note légale */
.doc-note {
  font-size: 8.5pt;
  color: #888;
  font-style: italic;
  border-top: 1px solid #eee;
  padding-top: 10px;
  margin-top: 12px;
  line-height: 1.5;
  font-family: 'DM Sans', sans-serif;
}

/* ── Pied de page du document ───────────────────────────── */
.doc-sheet-footer {
  background: #f8f9fc;
  border-top: 1px solid #e4e8f0;
  padding: 10px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-footer-brand {
  font-family: 'DM Sans', sans-serif;
  font-size: 8pt;
  color: #aaa;
}
.doc-footer-brand strong { color: #c9a84c; }

.doc-footer-page {
  font-size: 8pt;
  color: #ccc;
  font-family: 'DM Sans', sans-serif;
}

/* ── Scrollbar ──────────────────────────────────────────── */
.doc-sheet-wrap::-webkit-scrollbar { width: 6px; }
.doc-sheet-wrap::-webkit-scrollbar-track { background: #3a3a3a; }
.doc-sheet-wrap::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }

/* ── Textarea caché ─────────────────────────────────────── */
.result-text-hidden { display: none !important; }

/* ── IMPRESSION A4 ──────────────────────────────────────── */
@media print {
  body > *:not(#print-area) { display: none !important; }

  #print-area {
    display: block !important;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 99999;
    background: white;
  }

  .doc-outer, .doc-sheet-wrap, .doc-sheet {
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .doc-toolbar { display: none !important; }
  .doc-sheet-wrap { background: white !important; padding: 0 !important; max-height: none !important; }
  .doc-sheet { max-width: 100% !important; }
  .doc-body { padding: 28px 48px !important; }

  @page {
    margin: 0;
    size: A4;
  }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .doc-sheet-wrap { padding: 10px; }
  .doc-body { padding: 20px 20px 28px; }
  .doc-sheet-header { padding: 16px 20px; flex-direction: column; gap: 8px; }
  .doc-sheet-header-right { text-align: left; }
  .doc-fields-grid { grid-template-columns: 1fr; }
  .doc-field-label { border-right: none; border-bottom: 1px solid #c9a84c; padding-bottom: 2px; margin-bottom: 2px; }
  .doc-signatures { grid-template-columns: 1fr; gap: 20px; }
  .doc-main-title { font-size: 14pt; }
  .doc-sheet-footer { padding: 8px 16px; flex-direction: column; gap: 4px; text-align: center; }
  .doc-toolbar { flex-wrap: wrap; gap: 6px; }
}
