/* =========================================
   B-MO FINANCIAL — main.css
   Design System Premium 2026
   Variables · Reset · Typographie · Layout
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* --- Variables --- */
:root {
  /* Couleurs principales */
  --navy:        #0B1F3A;
  --navy-mid:    #1E3A5F;
  --navy-light:  #2a5280;
  --navy-grad:   linear-gradient(135deg, #0B1F3A, #1E3A5F);

  /* Accent / CTA */
  --gold:        #F59E0B;
  --gold-light:  #FCD34D;
  --gold-dark:   #D97706;

  /* Boutons */
  --blue:        #3B82F6;
  --blue-dark:   #2563EB;

  /* Succès */
  --green:       #22C55E;
  --green-dark:  #16A34A;

  /* Fonds */
  --cream:       #F5F7FA;
  --cream-dark:  #E8ECF2;
  --white:       #ffffff;
  --gray-100:    #F5F7FA;
  --gray-200:    #E5E7EB;
  --gray-400:    #9CA3AF;
  --gray-600:    #6B7280;
  --gray-800:    #374151;

  /* Texte */
  --text-main:   #1F2937;
  --text-muted:  #333333;
  --text-light:  #6B7280;

  /* Bordures */
  --border:      #E5E7EB;
  --border-md:   rgba(0,0,0,0.15);

  /* États */
  --success-bg:  #DCFCE7;
  --success-txt: #166534;
  --success-bdr: #22C55E;
  --warn-bg:     #FEF3C7;
  --warn-txt:    #92400E;
  --warn-bdr:    #F59E0B;
  --info-bg:     #DBEAFE;
  --info-txt:    #1E40AF;
  --info-bdr:    #3B82F6;
  --danger-bg:   #FEE2E2;
  --danger-txt:  #991B1B;
  --danger-bdr:  #EF4444;

  /* Radius */
  --r:           8px;
  --r-sm:        6px;
  --r-lg:        12px;
  --r-xl:        16px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;

  /* Ombres */
  --shadow:      0 10px 25px rgba(0,0,0,0.05);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.08);
  --shadow-card: 0 1px 4px rgba(0,0,0,0.06);

  /* Transitions */
  --transition:  all 0.2s ease;

  /* Polices */
  --font-serif:  'Barlow', sans-serif;
  --font-sans:   'Inter', sans-serif;
}

/* --- Reset --- */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--gray-100);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font-sans); }
input, select, textarea { font-family: var(--font-sans); }
ul, ol { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-main);
}

h1 { font-size: 60px; }
h2 { font-size: 38px; }
h3 { font-size: 28px; }
h4 { font-size: 22px; }

.serif { font-family: var(--font-serif); }
.muted { color: var(--text-light); }
.gold  { color: var(--gold); }

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1.25rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }

/* --- Cards --- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-navy {
  background: var(--navy-grad);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  color: var(--white);
  box-shadow: 0 8px 24px rgba(11,31,58,0.25);
}

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.badge-ok      { background: var(--success-bg); color: var(--success-txt); }
.badge-warn    { background: var(--warn-bg);    color: var(--warn-txt); }
.badge-info    { background: var(--info-bg);    color: var(--info-txt); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-txt); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 500;
  font-family: var(--font-sans);
  border: none;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  letter-spacing: 0.3px;
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(11,31,58,0.3);
}
.btn-primary:hover {
  background: var(--navy-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(11,31,58,0.4);
}

.btn-gold {
  background: var(--gold);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(245,158,11,0.35);
}
.btn-gold:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,158,11,0.45);
}

.btn-blue {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(59,130,246,0.35);
}
.btn-blue:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.45);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.btn-ghost-light {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.25);
}
.btn-ghost-light:hover {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-mid); }

.btn-sm { padding: 6px 16px; font-size: 14px; }
.btn-full { width: 100%; }

.btn:active { transform: scale(0.98); }

/* --- Form elements --- */
.fg { margin-bottom: 1.25rem; }
.fg label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fg input,
.fg select,
.fg textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--white);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fg input:focus,
.fg select:focus,
.fg textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.fg textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.fg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* --- Step bar --- */
.step-bar {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}
.step-bar .si {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-size: 15px;
  background: var(--gray-100);
  color: var(--text-light);
  border-right: 1px solid var(--border);
  transition: var(--transition);
  font-weight: 500;
}
.step-bar .si:last-child { border-right: none; }
.step-bar .si.act  { background: var(--navy); color: var(--white); font-weight: 600; }
.step-bar .si.done { background: var(--success-bg); color: var(--success-txt); }

/* --- Tab form panels --- */
.tf { display: none; }
.tf.act { display: block; }

/* --- Progress bar --- */
.prog-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--blue));
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Divider --- */
.divider { border: none; border-top: 1px solid var(--border); }

/* --- Utility --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex  { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.fw-5 { font-weight: 500; }

/* --- Pages visibility --- */
.pg { display: none; }
.pg.act { display: block; }

/* --- Panels in dashboard --- */
.dpanel { display: none; }
.dpanel.act { display: block; }

/* --- Tab forms in apply page --- */
.tab-content { display: none; }
.tab-content.act { display: block; }

/* --- Section headers --- */
.sec-h2 {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--navy);
}
.sec-sub {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* --- Page transitions --- */
.pg {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.pg.act {
  opacity: 1;
  transform: translateY(0);
}

/* --- Loading overlay --- */
#page-loader {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.92);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(4px);
}
#page-loader .loader-ring {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
#page-loader .loader-text {
  font-size: 15px;
  color: var(--text-light);
  font-family: var(--font-sans);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Responsive --- */
@media (max-width: 768px) {
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  h3 { font-size: 22px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .fg-row { grid-template-columns: 1fr; }
  .container, .wrap { padding: 0 1rem; }
  .sec-h2 { font-size: 26px !important; }

  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  .grid-4 {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    overflow: hidden !important;
  }
  .grid-4 > * {
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .team-card { padding: 1.25rem 0.75rem !important; }
  .hero-inner h1 { font-size: 30px !important; }
  .wrap { padding: 0 1rem !important; }
  .footer-inner { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
  .figures { grid-template-columns: 1fr 1fr !important; }

  /* Formulaire mobile */
  .step-bar { flex-direction: row !important; overflow-x: auto !important; }
  .step-bar .si { font-size: 12px !important; padding: 8px 4px !important; white-space: nowrap !important; }
  .tf { padding: 0 !important; }
  .apply-layout { grid-template-columns: 1fr !important; }
  .sum-card { display: none !important; }
}
