/* ============================================================
   PETIT BAC : page « Feuille à imprimer »
   Configurateur (écran) + feuille A4 (écran et impression)
   ============================================================ */

/* ── Configurateur ─────────────────────────────────────────── */
#feuille-app{
  background:var(--bg-white);
  border:3px solid var(--dark);
  border-radius:24px;
  box-shadow:0 8px 0 var(--dark),0 16px 40px rgba(15,23,42,.15);
  margin:2.5rem 0 2rem;
  overflow:hidden;
}
.fc-section{padding:1.75rem 2rem 0}
.fc-section h2{font-size:1.25rem;margin-bottom:.5rem;display:flex;align-items:center;gap:.5rem}
.fc-aide{font-size:.9rem;color:var(--text-light);margin-bottom:1rem}
#fc-compte{font-weight:700;color:var(--primary)}
.fc-raccourcis{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:1rem}
.fc-perso{margin-top:1.25rem;padding-top:1.25rem;border-top:1px dashed var(--border)}
.fc-label{font-weight:600;font-size:.9rem;margin-bottom:.5rem}
.fc-perso-ligne{display:flex;gap:.6rem;flex-wrap:wrap}
.fc-input{
  flex:1;min-width:220px;padding:.7rem 1rem;
  border:2px solid var(--border);border-radius:var(--radius-md);
  font-size:1rem;background:var(--bg-white);
}
.fc-input:focus{outline:none;border-color:var(--primary)}
.fc-reglages{display:flex;gap:2rem;flex-wrap:wrap;padding-bottom:.5rem}
.cat-toggle.perso{border-color:var(--menthe-dark);background:var(--menthe-pale)}
.cat-toggle .cat-suppr{
  margin-left:auto;border:none;background:none;cursor:pointer;
  color:var(--text-light);font-size:1rem;line-height:1;padding:0 .1rem;
}
.cat-toggle .cat-suppr:hover{color:var(--danger)}

.fc-barre{
  margin-top:1.75rem;padding:1.25rem 2rem;
  background:var(--bg-alt);border-top:1px solid var(--border);
  display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;
}
.fc-resume{font-size:.9rem;color:var(--text-light)}
.fc-resume strong{color:var(--primary);font-weight:700}
.fc-actions{display:flex;gap:.6rem;flex-wrap:wrap}
.fc-titre-apercu{
  font-size:1.15rem;text-align:center;color:var(--text-light);
  font-family:var(--font-body);font-weight:600;
  text-transform:uppercase;letter-spacing:.08em;
  margin:2.5rem 0 -1rem;
}

/* ── FAQ dépliante ─────────────────────────────────────────── */
.fc-faq{max-width:820px;margin:0 auto;display:flex;flex-direction:column;gap:.7rem}
.fc-faq-item{
  background:var(--bg-white);border:2.5px solid var(--dark);
  border-radius:14px;box-shadow:0 4px 0 var(--dark);
  padding:.9rem 1.25rem;
}
.fc-faq-item summary{
  cursor:pointer;font-family:var(--font-display);font-weight:600;
  font-size:1rem;color:var(--dark);list-style:none;
  display:flex;justify-content:space-between;align-items:center;gap:1rem;
}
.fc-faq-item summary::-webkit-details-marker{display:none}
.fc-faq-item summary::after{content:'+';font-size:1.4rem;color:var(--primary);line-height:1}
.fc-faq-item[open] summary::after{content:'−'}
.fc-faq-item p{margin-top:.75rem;font-size:.95rem;line-height:1.65;color:var(--text-light)}

/* ── Cadre d'aperçu de la feuille ──────────────────────────── */
.feuille-cadre{
  margin:2.5rem 0 3rem;padding:2rem;
  background:var(--bg-alt);border-radius:24px;
  display:flex;justify-content:center;
  overflow-x:auto;
}

/* ── LA FEUILLE (format A4) ────────────────────────────────── */
.feuille{
  width:210mm;min-height:297mm;
  padding:12mm 11mm 10mm;
  background:#fff;color:#111827;
  box-shadow:0 10px 40px rgba(15,23,42,.22);
  display:flex;flex-direction:column;
  font-family:var(--font-body);
  flex-shrink:0;
}
.fe-tete{
  display:flex;align-items:center;justify-content:space-between;
  gap:1.5rem;padding-bottom:5mm;margin-bottom:5mm;
  border-bottom:3px solid #4A6CF7;
}
.fe-logo{height:20mm;width:auto}
.fe-tete-droite{display:flex;flex-direction:column;gap:3mm;min-width:62mm}
.fe-champ{display:flex;align-items:baseline;gap:2mm;font-size:3.6mm;color:#4B5563}
.fe-champ span:first-child{font-weight:700;color:#111827;white-space:nowrap}
.fe-ligne{flex:1;border-bottom:1.5px dotted #9CA3AF;height:4mm}

.fe-table{width:100%;border-collapse:collapse;table-layout:fixed;flex:1}
.fe-table th,.fe-table td{border:1.2px solid #C7CDD6}
.fe-table thead th{
  background:#4A6CF7;color:#fff;
  font-family:var(--font-display);font-weight:600;
  font-size:3.5mm;line-height:1.2;
  padding:3mm 1.5mm;text-align:center;
  border-color:#3B5CE0;
}
.fe-table thead th.fe-col-lettre{background:#2A4BC8;width:16mm}
.fe-table thead th.fe-col-points{background:#F59E0B;color:#3B2600;border-color:#D97706;width:18mm}
.fe-table td{height:var(--fe-row,13mm);padding:0}
.fe-table td.fe-cell-lettre{
  background:#EEF0FE;text-align:center;
  font-family:var(--font-display);font-weight:700;
  font-size:7mm;color:#2A4BC8;
}
.fe-table td.fe-cell-points{background:#FEF9C3}
.fe-table tbody tr:nth-child(even) td:not(.fe-cell-lettre):not(.fe-cell-points){background:#FAFBFF}
.fe-table tfoot td{
  height:11mm;background:#F1F5F9;
  font-family:var(--font-display);font-weight:600;font-size:3.8mm;
  text-align:right;padding-right:3mm;color:#1E293B;
}
.fe-table tfoot td.fe-total-case{background:#FDE047;border-color:#D97706}

.fe-pied{
  margin-top:5mm;padding-top:3mm;border-top:1.5px solid #E2E8F0;
  display:flex;align-items:center;justify-content:space-between;
  gap:1rem;flex-wrap:wrap;font-size:3.1mm;color:#6B7280;
}
.fe-regle strong{color:#1E293B}
.fe-url{white-space:nowrap}
.fe-url strong{color:#4A6CF7}

/* ── Variante paysage ─────────────────────────────────────── */
.feuille.paysage{width:297mm;min-height:210mm}
.feuille.paysage .fe-logo{height:17mm}
.feuille.paysage .fe-tete{padding-bottom:4mm;margin-bottom:4mm}
.feuille.paysage .fe-pied{margin-top:4mm}

/* ── Écran étroit : on réduit l'aperçu ─────────────────────── */
@media(max-width:860px){
  .feuille-cadre{padding:1rem;border-radius:16px}
  .feuille{transform:scale(.62);transform-origin:top center;margin-bottom:-115mm}
  .feuille.paysage{transform:scale(.44);margin-bottom:-118mm}
}
@media(max-width:520px){
  .feuille{transform:scale(.42);margin-bottom:-172mm}
  .feuille.paysage{transform:scale(.30);margin-bottom:-147mm}
  .fc-section{padding:1.25rem 1.25rem 0}
  .fc-barre{padding:1rem 1.25rem}
}

/* ── IMPRESSION ────────────────────────────────────────────── */
@media print{
  @page{size:A4 portrait;margin:0}
  html,body{background:#fff!important;margin:0!important;padding:0!important}
  .no-print,.site-header,.site-footer,.cta-sticky,.breadcrumb{display:none!important}
  .container{max-width:none!important;padding:0!important;margin:0!important}
  .feuille-cadre{
    margin:0!important;padding:0!important;background:none!important;
    border-radius:0!important;display:block!important;overflow:visible!important;
  }
  .feuille{
    width:auto!important;min-height:auto!important;
    transform:none!important;margin:0!important;
    box-shadow:none!important;
    padding:10mm 9mm 8mm!important;
    page-break-inside:avoid;
  }
  /* Les aplats de couleur doivent être imprimés */
  *{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
}
