/* ═══════════════════════════════════════════════════
   VARIABLES & RESET
═══════════════════════════════════════════════════ */
:root {
  --navy:         #1a2e5a;
  --navy-mid:     #2d4a8a;
  --navy-light:   #e8edf5;
  --navy-xlight:  #f2f5fb;
  --gold:         #c9a84c;
  --gold-mid:     #e8c96a;
  --gold-light:   #fdf6e3;
  --gold-xlight:  #fffbf0;
  --white:        #ffffff;
  --text-dark:    #1a1a2e;
  --text-mid:     #3a4a6a;
  --text-muted:   #6a7a9a;
  --green:        #1a7a4a;
  --green-light:  #eaf7f0;
  --red:          #c0392b;
  --red-light:    #fdf0ee;
  --purple:       #6a3a9a;
  --purple-light: #f3eefb;

  --font-head: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
}

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

body {
  background: #c8d0e0;
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 56px;
  gap: 32px;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════
   BOUTONS ÉCRAN
═══════════════════════════════════════════════════ */
.screen-btns {
  position: fixed;
  top: 18px;
  right: 24px;
  display: flex;
  gap: 8px;
  z-index: 999;
}
.print-btn {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(26,46,90,0.35);
  letter-spacing: 0.5px;
  transition: background 0.2s, transform 0.1s;
}
.print-btn:hover  { background: var(--navy-mid); transform: translateY(-1px); }
.print-btn:active { transform: translateY(0); }
.btn-lecture {
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(201,168,76,0.35);
  letter-spacing: 0.3px;
  transition: opacity 0.15s, transform 0.1s;
  display: flex; align-items: center;
}
.btn-lecture:hover  { opacity: 0.85; transform: translateY(-1px); }
.btn-lecture:active { transform: translateY(0); }

/* ═══════════════════════════════════════════════════
   ZONE A4
═══════════════════════════════════════════════════ */
.a4 {
  width: 210mm;
  min-height: 297mm;
  background: var(--white);
  box-shadow: 0 10px 50px rgba(26,46,90,0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ═══════════════════════════════════════════════════
   EN-TÊTE
═══════════════════════════════════════════════════ */
.header {
  background: linear-gradient(135deg, var(--navy) 0%, #1e3870 60%, var(--navy-mid) 100%);
  padding: 20px 26px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(201,168,76,0.06);
}
.header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-mid), var(--gold));
}

.header-compact { padding: 14px 26px 12px; }

.logo-circle {
  width: 62px; height: 62px;
  border-radius: 50%;
  border: 2.5px solid var(--gold);
  background: rgba(201,168,76,0.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-circle-sm { width: 46px; height: 46px; }
.logo-ax {
  font-family: var(--font-head);
  font-size: 23px; font-weight: 800;
  color: var(--gold); letter-spacing: 1px;
}
.logo-ax-sm { font-size: 17px; }

.header-text { flex: 1; }
.header-service {
  font-family: var(--font-head);
  font-size: 8.5px; font-weight: 700;
  color: var(--gold); letter-spacing: 2.5px;
  text-transform: uppercase; margin-bottom: 4px;
}
.header-title {
  font-family: var(--font-head);
  font-size: 19px; font-weight: 800;
  color: var(--white); line-height: 1.2; margin-bottom: 4px;
}
.header-title-sm { font-size: 15px; }
.header-subtitle {
  font-family: var(--font-head);
  font-size: 10px; font-weight: 500;
  color: rgba(201,168,76,0.8); letter-spacing: 0.8px;
}

.header-meta { flex-shrink: 0; text-align: center; }
.meta-badge { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.meta-year {
  font-family: var(--font-head);
  font-size: 20px; font-weight: 800; color: var(--gold); line-height: 1;
}
.meta-label {
  font-family: var(--font-head);
  font-size: 7.5px; font-weight: 600;
  color: rgba(255,255,255,0.55); letter-spacing: 1.5px; text-transform: uppercase;
}
.meta-version {
  font-size: 9px; color: rgba(255,255,255,0.35);
  font-family: var(--font-head); margin-top: 4px; letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════
   BANDEAU PRINCIPES
═══════════════════════════════════════════════════ */
.principes {
  display: flex; align-items: center;
  background: var(--white);
  padding: 10px 20px;
  border-bottom: 1.5px solid var(--navy-light);
  gap: 0;
}
.principe-card {
  flex: 1; display: flex; align-items: center;
  gap: 9px; padding: 5px 10px;
}
.principe-icon-wrap {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.principe-green  { background: var(--green-light);  color: var(--green); }
.principe-navy   { background: var(--navy-light);   color: var(--navy); }
.principe-gold   { background: var(--gold-light);   color: #8a6010; }
.principe-purple { background: var(--purple-light); color: var(--purple); }

.principe-titre {
  font-family: var(--font-head);
  font-size: 10px; font-weight: 700;
  color: var(--navy); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 1px;
}
.principe-desc { font-size: 9px; color: var(--text-muted); line-height: 1.3; }
.principe-sep { width: 1px; height: 32px; background: var(--navy-light); flex-shrink: 0; }

/* ═══════════════════════════════════════════════════
   BLOCS SECTIONS
═══════════════════════════════════════════════════ */
.bloc {
  margin: 10px 14px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1.5px solid;
}
.recettes-bloc { border-color: rgba(26,46,90,0.15); }
.depenses-bloc { border-color: rgba(201,168,76,0.3); }
.cloture-bloc  { border-color: rgba(26,46,90,0.12); }
.regles-bloc   { border-color: rgba(26,46,90,0.1); }

.bloc-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
}
.recettes-bh { background: var(--navy); }
.depenses-bh { background: linear-gradient(90deg, #8a6010, #c9a84c); }
.cloture-bh  { background: linear-gradient(90deg, #1a3a6a, #2d5a9a); }
.regles-bh   { background: linear-gradient(90deg, #2d2d4a, #3a3a6a); }

.bloc-header-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  color: var(--white); flex-shrink: 0;
}
.bloc-title {
  font-family: var(--font-head);
  font-size: 12px; font-weight: 800;
  color: var(--white); letter-spacing: 2px; text-transform: uppercase;
}
.bloc-subtitle {
  flex: 1;
  font-size: 9px; font-weight: 500;
  color: rgba(255,255,255,0.7); letter-spacing: 0.3px;
}
.bloc-tag {
  font-family: var(--font-head);
  font-size: 8px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.5px; flex-shrink: 0;
}
.tag-navy { background: rgba(255,255,255,0.2); color: var(--white); }
.tag-gold { background: rgba(255,255,255,0.2); color: var(--white); }

/* ═══════════════════════════════════════════════════
   RECETTES — ÉTAPES VERTICALES
═══════════════════════════════════════════════════ */
.steps-vertical {
  background: var(--navy-xlight);
  padding: 14px 16px 10px;
  display: flex; flex-direction: column; gap: 0;
}
.step-row {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 10px 12px;
  border: 1.5px solid rgba(26,46,90,0.1);
  position: relative;
}
.step-connector {
  width: 2px; height: 10px;
  background: linear-gradient(to bottom, rgba(26,46,90,0.2), rgba(26,46,90,0.05));
  margin-left: 22px;
  flex-shrink: 0;
}

.step-bullet {
  width: 28px; height: 28px; border-radius: 50%;
  font-family: var(--font-head);
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-bullet-navy { background: var(--navy); color: var(--white); }

.step-content { flex: 1; min-width: 0; }
.step-title {
  font-family: var(--font-head);
  font-size: 10.5px; font-weight: 700;
  color: var(--navy); margin-bottom: 4px;
}
.step-title strong { color: var(--navy-mid); }
.step-detail {
  font-size: 9px; color: var(--text-mid);
  line-height: 1.45; margin-bottom: 6px;
}

.step-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 8px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px;
  white-space: nowrap;
}
.tag-info    { background: var(--navy-light); color: var(--navy); }
.tag-warn    { background: #fff3cd; color: #7a5a00; }
.tag-deadline{ background: #fde8e8; color: #8a1a1a; }
.tag-success { background: var(--green-light); color: var(--green); }

.step-who {
  display: flex; flex-direction: column; align-items: flex-end;
  flex-shrink: 0; gap: 2px;
}
.who-label {
  font-size: 7.5px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}
.who-val {
  font-family: var(--font-head);
  font-size: 8.5px; font-weight: 700; color: var(--navy);
  background: var(--navy-light);
  padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}

/* Documents requis */
.docs-requis {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  background: var(--navy); padding: 8px 16px;
}
.docs-gold { background: linear-gradient(90deg, #7a5a08, #c9a84c); }
.docs-label {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-head);
  font-size: 8.5px; font-weight: 700;
  color: var(--gold); text-transform: uppercase; letter-spacing: 0.5px;
}
.docs-gold .docs-label { color: var(--white); }
.doc-item  { font-size: 8.5px; color: rgba(255,255,255,0.85); font-weight: 500; }
.doc-sep   { color: rgba(255,255,255,0.3); font-size: 12px; }

/* ═══════════════════════════════════════════════════
   DÉPENSES — CAS
═══════════════════════════════════════════════════ */
.cas-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--gold-xlight);
  padding: 12px; gap: 10px;
}
.cas-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid rgba(201,168,76,0.2);
}
.cas-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
}
.cas1-header { background: var(--navy); }
.cas2-header { background: linear-gradient(90deg, #8a6010, #c9a84c); }
.cas-num {
  font-family: var(--font-head);
  font-size: 8px; font-weight: 800;
  color: rgba(255,255,255,0.7);
  letter-spacing: 1px; text-transform: uppercase;
  background: rgba(255,255,255,0.15);
  padding: 2px 7px; border-radius: 4px;
}
.cas-titre {
  font-family: var(--font-head);
  font-size: 10px; font-weight: 700; color: var(--white);
}
.cas-desc {
  font-size: 8.5px; color: var(--text-mid);
  line-height: 1.45; padding: 8px 12px 6px;
}
.cas-flow-v { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 0; }

.cas-step-v {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 0; position: relative;
}
.cas-step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-top: 4px;
}
.cas1-step .cas-step-dot { background: var(--navy); }
.cas2-step .cas-step-dot { background: var(--gold); }

.cas-connector {
  width: 2px; height: 8px;
  margin-left: 3px; flex-shrink: 0;
}
.cas1-connector { background: rgba(26,46,90,0.2); }
.cas2-connector { background: rgba(201,168,76,0.4); }

.cas-step-title {
  font-family: var(--font-head);
  font-size: 9.5px; font-weight: 700;
  margin-bottom: 2px;
}
.cas1-step .cas-step-title { color: var(--navy); }
.cas2-step .cas-step-title { color: #7a5a08; }
.cas-step-detail {
  font-size: 8.5px; color: var(--text-mid); line-height: 1.4;
}
.cas-step-detail strong { font-weight: 700; }

.cas-alerte {
  display: flex; align-items: flex-start; gap: 5px;
  font-size: 8px; font-weight: 600;
  padding: 6px 10px;
  border-top: 1px solid;
  line-height: 1.4;
}
.cas1-alerte {
  background: rgba(26,46,90,0.05);
  border-color: rgba(26,46,90,0.1);
  color: var(--navy);
}
.cas2-alerte {
  background: rgba(201,168,76,0.08);
  border-color: rgba(201,168,76,0.2);
  color: #7a5a08;
}
.cas-alerte svg { flex-shrink: 0; margin-top: 1px; }

/* ═══════════════════════════════════════════════════
   CLÔTURE
═══════════════════════════════════════════════════ */
.cloture-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; padding: 12px;
  background: var(--navy-xlight);
}
.cloture-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 10px 10px 10px;
  border-top: 3px solid;
  display: flex; flex-direction: column; gap: 5px;
}
.cloture-green { border-color: var(--green); }
.cloture-red   { border-color: var(--red); }
.cloture-blue  { border-color: var(--navy); }
.cloture-gold  { border-color: var(--gold); }

.cloture-card-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.cloture-green .cloture-card-icon { background: var(--green-light); color: var(--green); }
.cloture-red   .cloture-card-icon { background: var(--red-light);   color: var(--red); }
.cloture-blue  .cloture-card-icon { background: var(--navy-light);  color: var(--navy); }
.cloture-gold  .cloture-card-icon { background: var(--gold-light);  color: #8a6010; }

.cloture-card-title {
  font-family: var(--font-head);
  font-size: 10px; font-weight: 700; color: var(--text-dark);
}
.cloture-card-detail {
  font-size: 8.5px; color: var(--text-mid); line-height: 1.45;
}
.cloture-card-detail strong { font-weight: 700; color: var(--text-dark); }

.cloture-delai {
  display: flex; align-items: center; gap: 7px;
  background: var(--navy-light);
  padding: 8px 14px;
  font-size: 9px; color: var(--navy); line-height: 1.4;
}
.cloture-delai svg { flex-shrink: 0; color: var(--navy); }
.cloture-delai strong { font-weight: 700; }

/* ═══════════════════════════════════════════════════
   RÈGLES PRATIQUES
═══════════════════════════════════════════════════ */
.regles-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; padding: 12px;
  background: #f8f9fc;
}
.regle-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex; align-items: flex-start; gap: 10px;
  border: 1.5px solid rgba(26,46,90,0.08);
}
.regle-icon-wrap {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.regle-navy   { background: var(--navy-light);   color: var(--navy); }
.regle-gold   { background: var(--gold-light);   color: #8a6010; }
.regle-green  { background: var(--green-light);  color: var(--green); }
.regle-red    { background: var(--red-light);    color: var(--red); }

.regle-titre {
  font-family: var(--font-head);
  font-size: 10px; font-weight: 700; color: var(--navy); margin-bottom: 4px;
}
.regle-detail {
  font-size: 8.5px; color: var(--text-mid); line-height: 1.45;
}
.regle-detail strong { font-weight: 700; color: var(--text-dark); }

/* ═══════════════════════════════════════════════════
   BOTTOM GRID (checklist + contacts)
═══════════════════════════════════════════════════ */
.bottom-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin: 0 14px 10px;
}
.checklist-bloc, .contacts-bloc {
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px solid rgba(26,46,90,0.1);
  overflow: hidden;
}
.checklist-title, .contacts-title {
  display: flex; align-items: center; gap: 7px;
  background: var(--navy-light);
  padding: 7px 12px;
  font-family: var(--font-head);
  font-size: 9.5px; font-weight: 700;
  color: var(--navy); text-transform: uppercase; letter-spacing: 0.5px;
}
.checklist { list-style: none; padding: 8px 12px; display: flex; flex-direction: column; gap: 5px; }
.checklist li {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 8.5px; color: var(--text-mid); line-height: 1.4;
}
.check-box {
  width: 14px; height: 14px; border-radius: 3px;
  background: var(--green-light); color: var(--green);
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 12px;
  border-bottom: 1px solid var(--navy-light);
  gap: 8px;
}
.contact-item:last-child { border-bottom: none; }
.contact-label {
  font-family: var(--font-head);
  font-size: 8px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px;
  white-space: nowrap;
}
.contact-val {
  font-size: 8.5px; font-weight: 600; color: var(--navy);
  text-align: right;
}

/* ═══════════════════════════════════════════════════
   BANDEAU RÈGLES RAPIDES
═══════════════════════════════════════════════════ */
.quick-rules {
  background: var(--navy);
  margin: 0 14px 10px;
  border-radius: var(--radius);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 0;
}
.qr-item {
  flex: 1; display: flex; align-items: center; gap: 7px;
  padding: 0 10px;
  font-family: var(--font-head);
  font-size: 9px; font-weight: 600;
  color: var(--gold); letter-spacing: 0.2px;
}
.qr-item svg { flex-shrink: 0; color: var(--gold-mid); }
.qr-sep { width: 1px; height: 28px; background: rgba(255,255,255,0.12); flex-shrink: 0; }

/* ═══════════════════════════════════════════════════
   PIED DE PAGE
═══════════════════════════════════════════════════ */
.footer {
  margin-top: auto;
  padding: 10px 24px;
  display: flex; align-items: center; gap: 12px;
  background: var(--navy-light);
  border-top: 3px solid var(--gold);
}
.footer-page1 { margin-top: 0; }
.footer-logo-small {
  font-family: var(--font-head);
  font-size: 14px; font-weight: 800; color: var(--navy);
  background: var(--gold);
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: 0.5px;
}
.footer-text { flex: 1; }
.footer-assoc {
  font-family: var(--font-head);
  font-size: 8.5px; font-weight: 700; color: var(--navy); letter-spacing: 0.2px;
}
.footer-email {
  font-size: 8px; color: var(--text-muted); font-style: italic; margin-top: 1px;
}
.footer-page {
  font-family: var(--font-head);
  font-size: 8px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════
   PAGE 2
═══════════════════════════════════════════════════ */
.page2 { }

/* ═══════════════════════════════════════════════════
   IMPRESSION
═══════════════════════════════════════════════════ */
@media print {
  @page { size: A4 portrait; margin: 0; }

  body { background: none; padding: 0; margin: 0; gap: 0; }
  .screen-btns { display: none !important; }

  .a4 {
    width: 210mm;
    min-height: 297mm;
    box-shadow: none;
    margin: 0;
    page-break-after: always;
    break-after: page;
  }
  .a4:last-child { page-break-after: auto; break-after: auto; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media screen and (max-width: 820px) {
  .a4 { width: 100%; min-height: auto; }
  .cas-grid { grid-template-columns: 1fr; }
  .cloture-grid { grid-template-columns: 1fr 1fr; }
  .regles-grid { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
  .quick-rules { flex-direction: column; gap: 8px; }
  .qr-sep { display: none; }
  .principes { flex-wrap: wrap; }
}
