/* ════════════════════════════════════════════════════════
   Fiche de garde Cci&Vous — feuille de style AUTONOME
   (indépendante de styles.css pour éviter tout conflit)
   ════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --f-ink: #1f2a24;
  --f-muted: #5e6e68;
  --f-sage-dark: #384b35;
  --f-sage: #5c7a57;
  --f-sage-light: #e9efe2;
  --f-cream: #fdf6ea;
  --f-line: #d3ccbb;
  --f-white: #ffffff;
  --f-serif: Georgia, 'Times New Roman', serif;
  --f-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
}

body.fiche-body {
  background: #e7e1d3;
  font-family: var(--f-sans);
  color: var(--f-ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* ── Barre d'outils (écran) ── */
.fiche-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 820px;
  margin: 0 auto;
  padding: 18px 20px;
}
.fiche-back {
  color: var(--f-sage-dark);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.92rem;
}
.fiche-back:hover { text-decoration: underline; }
.fiche-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--f-sage);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-family: var(--f-sans);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}
.fiche-print-btn:hover { background: var(--f-sage-dark); }

/* ── Feuille ── */
.fiche {
  max-width: 820px;
  margin: 0 auto 50px;
  background: var(--f-white);
  padding: 38px 44px 44px;
  border-radius: 12px;
  box-shadow: 0 18px 46px rgba(26, 36, 32, 0.14);
}

/* En-tête */
.fiche-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 2.5px solid var(--f-sage-light);
}
.fiche-logo {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  object-fit: contain;
}
.fiche-head-text { flex: 1; min-width: 0; }
.fiche-head h1 {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: 1.9rem;
  color: var(--f-sage-dark);
  margin: 0;
  line-height: 1.1;
}
.fiche-head-sub {
  margin: 3px 0 0;
  font-size: 0.82rem;
  color: var(--f-muted);
  line-height: 1.45;
}

.fiche-intro {
  font-size: 0.86rem;
  color: var(--f-muted);
  background: var(--f-sage-light);
  border-radius: 9px;
  padding: 11px 15px;
  margin: 16px 0 6px;
}

/* ── Blocs ── */
.fiche-block {
  border: none;
  padding: 14px 0 2px;
  margin: 0;
}
.fiche-block + .fiche-block { border-top: 1px solid var(--f-line); }
.fiche-block legend {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--f-serif);
  font-size: 1.08rem;
  color: var(--f-sage-dark);
  padding: 0;
  margin: 4px 0 11px;
  width: 100%;
}
.fiche-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: var(--f-sage);
  color: #fff;
  border-radius: 50%;
  font-family: var(--f-sans);
  font-size: 0.8rem;
  font-weight: 800;
}

/* Grilles de champs */
.fiche-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin-bottom: 10px;
}
.fiche-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.fiche-row.cols-1 { grid-template-columns: 1fr; }

.fiche-field {
  display: block;
  min-width: 0;
}
.fiche-field > span {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--f-muted);
  margin-bottom: 3px;
}
.fiche-field input,
.fiche-field textarea {
  width: 100%;
  font-family: var(--f-sans);
  font-size: 0.92rem;
  color: var(--f-ink);
  background: #faf8f2;
  border: none;
  border-bottom: 1.4px solid var(--f-line);
  border-radius: 4px 4px 0 0;
  padding: 7px 9px;
}
.fiche-field input:focus,
.fiche-field textarea:focus {
  outline: none;
  border-bottom-color: var(--f-sage);
  background: #fff;
}
.fiche-field textarea { resize: vertical; min-height: 38px; }

/* Cases à cocher en ligne */
.fiche-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 2px 0 8px;
}
.fiche-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
}
.fiche-checks input { width: 15px; height: 15px; flex-shrink: 0; }

.fiche-consent {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 0.85rem;
  background: var(--f-cream);
  border-left: 3px solid var(--f-sage);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 8px;
}
.fiche-consent input { margin-top: 2px; flex-shrink: 0; width: 15px; height: 15px; }

/* Signatures */
.fiche-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px solid var(--f-sage-light);
}
.fiche-sign-col span {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--f-muted);
}
.fiche-sign-meta {
  font-size: 0.8rem;
  color: var(--f-muted);
  margin: 4px 0 8px;
}
.fiche-sign-line { display: inline-block; min-width: 90px; border-bottom: 1.4px dotted var(--f-muted); }
.fiche-sign-box {
  margin-top: 6px;
  height: 66px;
  border: 1.4px dashed var(--f-line);
  border-radius: 7px;
}

.fiche-foot {
  margin-top: 18px;
  font-size: 0.72rem;
  color: var(--f-muted);
  line-height: 1.5;
}
.fiche-foot a { color: var(--f-sage-dark); }

@media (max-width: 620px) {
  .fiche { padding: 24px 18px 30px; }
  .fiche-row, .fiche-row.cols-3 { grid-template-columns: 1fr; }
  .fiche-sign { grid-template-columns: 1fr; gap: 16px; }
  .fiche-head h1 { font-size: 1.5rem; }
}

/* ════ Impression ════ */
@page { size: A4; margin: 13mm 14mm; }

@media print {
  .no-print { display: none !important; }
  body.fiche-body { background: #fff; font-size: 11.5px; }
  .fiche {
    max-width: 100%;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .fiche-field input,
  .fiche-field textarea { background: transparent; }
  .fiche-block { break-inside: avoid; }
  .fiche-sign { break-inside: avoid; }
  .fiche-consent { break-inside: avoid; }
  .fiche-head { break-after: avoid; }
}
