/* ============================================================
   BILAN-PRO.FR — Feuille de styles principale
   ============================================================ */

/* 1. Variables & Reset
   ------------------------------------------------------------ */
:root {
  --primary:       #1E3D6E;
  --primary-dark:  #152C52;
  --primary-light: #2A5494;
  --accent:        #E07A54;
  --accent-dark:   #C96540;
  --green:         #2A9D6E;
  --bg:            #F7F8FC;
  --bg-alt:        #EEF1F7;
  --white:         #FFFFFF;
  --text:          #1A2332;
  --text-light:    #5C6B80;
  --border:        #DDE4EF;
  --shadow-sm:     0 2px 8px rgba(30,61,110,.07);
  --shadow:        0 4px 20px rgba(30,61,110,.10);
  --shadow-lg:     0 8px 40px rgba(30,61,110,.13);
  --radius:        10px;
  --radius-lg:     16px;
  --transition:    .22s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
ul, ol { padding-left: 1.4em; }

/* 2. Typographie
   ------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--primary);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); margin-bottom: .8rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); margin-bottom: .6rem; }
h4 { font-size: 1.05rem; margin-bottom: .5rem; }

p { margin-bottom: 1.1rem; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--primary); }

/* 3. Layout
   ------------------------------------------------------------ */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container--narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: 4rem 0; }
section.alt { background: var(--white); }

/* 4. Header & Navigation
   ------------------------------------------------------------ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 2rem;
}

/* Logo */
.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}
.logo span.logo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 2px;
}
.logo:hover { color: var(--primary); }

/* Nav principale */
.main-nav { display: flex; align-items: center; gap: .25rem; }
.main-nav a {
  font-size: .88rem;
  font-weight: 500;
  color: var(--text);
  padding: .45rem .75rem;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active {
  background: var(--bg);
  color: var(--primary);
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > a::after {
  content: ' ▾';
  font-size: .7rem;
  opacity: .6;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 240px;
  padding: .5rem;
  z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: .5rem .75rem;
  font-size: .85rem;
  border-radius: 6px;
  color: var(--text);
}
.nav-dropdown-menu a:hover { background: var(--bg); color: var(--primary); }

/* CTA header */
.header-cta {
  background: var(--accent);
  color: var(--white) !important;
  padding: .5rem 1.1rem !important;
  border-radius: 8px;
  font-weight: 600 !important;
  font-size: .88rem !important;
  transition: background var(--transition) !important;
  flex-shrink: 0;
}
.header-cta:hover { background: var(--accent-dark) !important; color: var(--white) !important; }

/* Burger mobile */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* 5. Hero (page d'accueil)
   ------------------------------------------------------------ */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  color: var(--white);
  padding: 5rem 0 4.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 400px; height: 400px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -40px;
  width: 300px; height: 300px;
  background: rgba(224,122,84,.12);
  border-radius: 50%;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}
.hero-eyebrow {
  display: inline-block;
  background: rgba(224,122,84,.2);
  color: #FFCBB5;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .35rem .9rem;
  border-radius: 20px;
  margin-bottom: 1.2rem;
}
.hero h1 { color: var(--white); font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1.1rem; }
.hero-sub {
  font-size: 1.1rem;
  opacity: .88;
  max-width: 580px;
  margin-bottom: 2rem;
  line-height: 1.65;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 2.2rem;
}
.badge {
  background: rgba(255,255,255,.12);
  color: var(--white);
  font-size: .82rem;
  font-weight: 500;
  padding: .35rem .9rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.18);
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }

/* 6. Boutons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.6rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover { background: var(--accent-dark); color: var(--white); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(224,122,84,.35); }
.btn-secondary {
  background: rgba(255,255,255,.15);
  color: var(--white);
  border: 1px solid rgba(255,255,255,.3);
}
.btn-secondary:hover { background: rgba(255,255,255,.25); color: var(--white); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }

/* 7. Breadcrumb
   ------------------------------------------------------------ */
.breadcrumb {
  padding: .9rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.breadcrumb ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  font-size: .82rem;
  color: var(--text-light);
}
.breadcrumb li { display: flex; align-items: center; gap: .4rem; }
.breadcrumb li + li::before { content: '›'; opacity: .5; }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }

/* 8. Section titre
   ------------------------------------------------------------ */
.section-head {
  text-align: center;
  margin-bottom: 3rem;
}
.section-head h2 { margin-bottom: .6rem; }
.section-head p { color: var(--text-light); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }

.section-label {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
}

/* 9. Cards
   ------------------------------------------------------------ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.cards-grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cards-grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.card-icon.green { background: #E6F7F1; }
.card-icon.blue  { background: #E8EFF8; }
.card-icon.orange{ background: #FDF0EB; }

.card h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.card p   { font-size: .9rem; color: var(--text-light); margin: 0; }

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.card-link:hover { color: inherit; }
.card-link .card { cursor: pointer; }
.card-link:hover .card { border-color: var(--primary); }
.card-arrow {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 1.2rem;
}

/* 10. Encadrés & highlight
   ------------------------------------------------------------ */
.highlight-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  margin: 1.5rem 0;
}
.highlight-box.green  { border-left-color: var(--green); background: #F0FAF6; }
.highlight-box.orange { border-left-color: var(--accent); background: #FDF5F2; }
.highlight-box.warning{ border-left-color: #E6A817; background: #FFFAF0; }

.highlight-box p { margin-bottom: 0; }
.highlight-box strong { display: block; margin-bottom: .4rem; }

.info-banner {
  background: linear-gradient(135deg, #E8EFF8, #F0F4FB);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}
.info-banner strong { font-size: 1.6rem; color: var(--primary); display: block; }
.info-banner span { font-size: .9rem; color: var(--text-light); }

/* 11. Tables
   ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
thead { background: var(--primary); color: var(--white); }
thead th { padding: .85rem 1rem; text-align: left; font-weight: 600; font-size: .85rem; }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
td { padding: .8rem 1rem; vertical-align: top; }
td:first-child { font-weight: 500; color: var(--primary); }

/* 12. Page intérieure (contenu article)
   ------------------------------------------------------------ */
.page-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--white);
  padding: 3rem 0 2.8rem;
}
.page-header h1 { color: var(--white); margin-bottom: .7rem; }
.page-header p  { opacity: .85; font-size: 1.05rem; max-width: 620px; margin: 0; }

.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
  padding: 3rem 0 4rem;
}

.page-content h2 {
  margin-top: 2.2rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--border);
}
.page-content h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.page-content h3 { margin-top: 1.5rem; color: var(--text); }
.page-content ul, .page-content ol { margin-bottom: 1rem; }
.page-content li { margin-bottom: .4rem; }

/* Sidebar */
.page-sidebar { position: sticky; top: 88px; }
.sidebar-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
}
.sidebar-card h4 {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-light);
  margin-bottom: 1rem;
}
.sidebar-nav { list-style: none; padding: 0; }
.sidebar-nav li { border-bottom: 1px solid var(--border); }
.sidebar-nav li:last-child { border-bottom: none; }
.sidebar-nav a {
  display: block;
  padding: .55rem 0;
  font-size: .88rem;
  color: var(--text);
}
.sidebar-nav a:hover { color: var(--primary); padding-left: .3rem; }
.sidebar-cta {
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}
.sidebar-cta h4 { color: var(--white); font-size: 1rem; margin-bottom: .5rem; text-transform: none; letter-spacing: 0; }
.sidebar-cta p { font-size: .85rem; opacity: .85; margin-bottom: 1rem; }
.sidebar-cta .btn { width: 100%; justify-content: center; }

/* 13. Étapes (timeline)
   ------------------------------------------------------------ */
.steps { list-style: none; padding: 0; counter-reset: step; }
.step {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 2rem;
  position: relative;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
}
.step-body h3 { margin-top: .3rem; }

/* 14. FAQ
   ------------------------------------------------------------ */
.faq-list { list-style: none; padding: 0; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  background: var(--white);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.1rem 1.4rem;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: background var(--transition), color var(--transition);
}
.faq-question:hover { background: var(--bg); color: var(--primary); }
.faq-question.open { color: var(--primary); background: var(--bg); }
.faq-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  transition: transform var(--transition), background var(--transition);
}
.faq-question.open .faq-icon { transform: rotate(45deg); background: var(--primary); color: var(--white); }
.faq-answer {
  display: none;
  padding: 0 1.4rem 1.2rem;
  font-size: .92rem;
  color: var(--text-light);
  line-height: 1.7;
  border-top: 1px solid var(--border);
}
.faq-answer.open { display: block; }

/* 15. Stats / chiffres clés
   ------------------------------------------------------------ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  text-align: center;
}
.stat-item { padding: 1.5rem 1rem; }
.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: .3rem;
}
.stat-number span { color: var(--accent); }
.stat-label { font-size: .85rem; color: var(--text-light); }

/* 16. CTA Banner
   ------------------------------------------------------------ */
.cta-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 4rem 0;
  text-align: center;
}
.cta-banner h2 { color: var(--white); margin-bottom: .7rem; }
.cta-banner p { opacity: .85; font-size: 1.05rem; margin-bottom: 2rem; max-width: 520px; margin-left: auto; margin-right: auto; }

/* 17. Glossaire
   ------------------------------------------------------------ */
.glossary-letter {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: .5rem;
  margin: 2rem 0 1rem;
}
.glossary-term { margin-bottom: 1.5rem; }
.glossary-term dt {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: .25rem;
}
.glossary-term dd {
  font-size: .92rem;
  color: var(--text-light);
  line-height: 1.65;
  margin-left: 0;
}

/* 18. Formulaire contact
   ------------------------------------------------------------ */
.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .4rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,61,110,.1);
}
.form-group textarea { min-height: 130px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* 19. Footer
   ------------------------------------------------------------ */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.75);
  padding: 3.5rem 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: 2rem 2.5rem; }
}
.footer-brand .logo { color: var(--white); margin-bottom: .8rem; }
.footer-brand p { font-size: .88rem; line-height: 1.6; opacity: .75; }
.footer-col h4 {
  color: var(--white);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: .55rem; }
.footer-col a {
  font-size: .88rem;
  color: rgba(255,255,255,.65);
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  padding: 1.4rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  opacity: .55;
  flex-wrap: wrap;
  gap: .5rem;
}

/* 20. Grilles utilitaires (tool pages, split sections)
   ------------------------------------------------------------ */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 4rem;
  align-items: start;
}

/* 21. Responsive
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
  .page-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .tool-grid, .split-grid, .contact-grid { grid-template-columns: 1fr; gap: 2rem; }

  /* Navigation mobile */
  .main-nav { display: none; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 68px;
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem 1.5rem;
    box-shadow: var(--shadow);
    z-index: 99;
    gap: .1rem;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }
  .main-nav.open a { padding: .65rem .75rem; }
  /* Dropdowns visibles en mobile, imbriqués en liste */
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--border);
    padding: .25rem 0 .25rem 1rem;
    margin: .15rem 0 .5rem .5rem;
    min-width: unset;
  }
  /* Désactive le hover desktop sur mobile (doit venir avant la règle open) */
  .nav-dropdown:hover .nav-dropdown-menu { display: none; }
  /* Affiche tous les sous-menus quand le menu burger est ouvert (priorité via ordre) */
  .main-nav.open .nav-dropdown-menu { display: block; }
  /* Masque la flèche dropdown sur mobile (sous-menus déjà visibles) */
  .main-nav.open .nav-dropdown > a::after { display: none; }
  .burger { display: flex; }
  .header-cta { display: none; }
}
@media (max-width: 640px) {
  section { padding: 2.8rem 0; }
  .hero { padding: 3.5rem 0 3rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .cards-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .cards-grid-4 { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}
