/* ============================================================
   MARKET LENDER — global.css
   Variables CSS, Reset, Typographie, Utilitaires globaux
   ============================================================ */

/* ─── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── Variables CSS ─────────────────────────────────────────── */
:root {
  /* Couleurs principales */
  --marine-profond:    #0D2B4E;
  --marine-moyen:      #1A4A7A;
  --bleu-ciel:         #2E8BC0;
  --or-cta:            #F4A500;
  --or-cta-hover:      #D9920A;

  /* Fonds */
  --fond-clair:        #F7F9FC;
  --fond-section:      #EEF3F9;
  --blanc:             #FFFFFF;

  /* Textes */
  --texte-principal:   #1C2B3A;
  --texte-secondaire:  #6B8299;
  --texte-inverse:     #FFFFFF;

  /* Bordures */
  --bordure:           #D6E4F0;
  --bordure-focus:     #2E8BC0;

  /* Ombres */
  --ombre-xs:  0 1px 3px rgba(13, 43, 78, 0.08);
  --ombre-sm:  0 2px 8px rgba(13, 43, 78, 0.10);
  --ombre-md:  0 6px 24px rgba(13, 43, 78, 0.12);
  --ombre-lg:  0 16px 48px rgba(13, 43, 78, 0.16);

  /* Typographie */
  --font-display: 'Sora', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Tailles de police */
  --fs-xs:   0.75rem;    /* 12px */
  --fs-sm:   0.875rem;   /* 14px */
  --fs-base: 1rem;       /* 16px */
  --fs-md:   1.125rem;   /* 18px */
  --fs-lg:   1.25rem;    /* 20px */
  --fs-xl:   1.5rem;     /* 24px */
  --fs-2xl:  1.875rem;   /* 30px */
  --fs-3xl:  2.25rem;    /* 36px */
  --fs-4xl:  3rem;       /* 48px */
  --fs-5xl:  3.75rem;    /* 60px */

  /* Espacement */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;
  --space-4xl:  6rem;
  --space-5xl:  8rem;

  /* Rayons */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-base:   0.25s ease;
  --transition-slow:   0.4s ease;

  /* Largeur max du contenu */
  --container-max: 1200px;
  --container-pad: 1.5rem;

  /* Taux de crédit */
  --taux-credit: 2%;
}

/* ─── Reset moderne ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--texte-principal);
  background-color: var(--blanc);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--texte-principal);
}

p {
  line-height: 1.7;
  color: var(--texte-secondaire);
}

/* ─── Typographie ───────────────────────────────────────────── */
.display-xl {
  font-family: var(--font-display);
  font-size: var(--fs-5xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.display-lg {
  font-family: var(--font-display);
  font-size: var(--fs-4xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.display-md {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: 1.2;
}

.heading-lg {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 600;
  line-height: 1.3;
}

.heading-md {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.35;
}

.heading-sm {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
}

.body-lg {
  font-size: var(--fs-md);
  line-height: 1.7;
}

.body-base {
  font-size: var(--fs-base);
  line-height: 1.6;
}

.body-sm {
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─── Container ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.container--narrow {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* ─── Boutons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.875rem 2rem;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1;
  transition: all var(--transition-base);
  white-space: nowrap;
  cursor: pointer;
}

.btn--primary {
  background: var(--or-cta);
  color: var(--marine-profond);
  box-shadow: 0 4px 16px rgba(244, 165, 0, 0.35);
}

.btn--primary:hover {
  background: var(--or-cta-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(244, 165, 0, 0.45);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--secondary {
  background: transparent;
  color: var(--blanc);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--blanc);
}

.btn--outline {
  background: transparent;
  color: var(--marine-profond);
  border: 2px solid var(--marine-profond);
}

.btn--outline:hover {
  background: var(--marine-profond);
  color: var(--blanc);
}

.btn--ghost {
  background: transparent;
  color: var(--bleu-ciel);
  padding-left: 0;
  padding-right: 0;
}

.btn--ghost:hover {
  color: var(--marine-profond);
}

.btn--lg {
  padding: 1.125rem 2.5rem;
  font-size: var(--fs-md);
}

.btn--sm {
  padding: 0.625rem 1.25rem;
  font-size: var(--fs-sm);
}

/* ─── Badge / Etiquette ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge--marine {
  background: rgba(13, 43, 78, 0.08);
  color: var(--marine-profond);
}

.badge--or {
  background: rgba(244, 165, 0, 0.15);
  color: #B37A00;
}

.badge--bleu {
  background: rgba(46, 139, 192, 0.12);
  color: var(--bleu-ciel);
}

/* ─── Section layout ────────────────────────────────────────── */
.section {
  padding-top: var(--space-5xl);
  padding-bottom: var(--space-5xl);
}

.section--sm {
  padding-top: var(--space-4xl);
  padding-bottom: var(--space-4xl);
}

.section--lg {
  padding-top: 7rem;
  padding-bottom: 7rem;
}

.section--fond-clair {
  background-color: var(--fond-clair);
}

.section--fond-section {
  background-color: var(--fond-section);
}

.section--marine {
  background-color: var(--marine-profond);
  color: var(--texte-inverse);
}

.section--marine h1,
.section--marine h2,
.section--marine h3,
.section--marine h4,
.section--marine h5,
.section--marine h6 {
  color: var(--blanc);
}

.section--marine p {
  color: rgba(255, 255, 255, 0.75);
}

/* En-tête de section centré */
.section-entete {
  text-align: center;
  max-width: 680px;
  margin: 0 auto var(--space-4xl);
}

.section-entete .label {
  color: var(--bleu-ciel);
  margin-bottom: var(--space-md);
  display: block;
}

.section-entete h2 {
  margin-bottom: var(--space-lg);
}

/* ─── Grilles ───────────────────────────────────────────────── */
.grille-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.grille-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.grille-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

/* ─── Carte générique ───────────────────────────────────────── */
.carte {
  background: var(--blanc);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--ombre-sm);
  border: 1px solid var(--bordure);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.carte:hover {
  box-shadow: var(--ombre-md);
  transform: translateY(-4px);
}

/* ─── Séparateur ────────────────────────────────────────────── */
.separateur {
  width: 60px;
  height: 4px;
  background: var(--or-cta);
  border-radius: var(--radius-full);
  margin: var(--space-lg) 0;
}

.separateur--centre {
  margin: var(--space-lg) auto;
}

/* ─── Utilitaires texte ─────────────────────────────────────── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.text-marine   { color: var(--marine-profond); }
.text-bleu     { color: var(--bleu-ciel); }
.text-or       { color: var(--or-cta); }
.text-blanc    { color: var(--blanc); }
.text-muted    { color: var(--texte-secondaire); }

.font-display  { font-family: var(--font-display); }
.font-body     { font-family: var(--font-body); }
.fw-300        { font-weight: 300; }
.fw-400        { font-weight: 400; }
.fw-500        { font-weight: 500; }
.fw-600        { font-weight: 600; }
.fw-700        { font-weight: 700; }
.fw-800        { font-weight: 800; }

/* ─── Utilitaires espacement ────────────────────────────────── */
.mt-auto { margin-top: auto; }
.mb-0    { margin-bottom: 0; }
.mt-md   { margin-top: var(--space-md); }
.mt-lg   { margin-top: var(--space-lg); }
.mt-xl   { margin-top: var(--space-xl); }
.mt-2xl  { margin-top: var(--space-2xl); }
.mb-md   { margin-bottom: var(--space-md); }
.mb-lg   { margin-bottom: var(--space-lg); }
.mb-xl   { margin-bottom: var(--space-xl); }
.mb-2xl  { margin-bottom: var(--space-2xl); }

/* ─── Utilitaires display ───────────────────────────────────── */
.d-flex          { display: flex; }
.align-center    { align-items: center; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-col        { flex-direction: column; }
.gap-sm          { gap: var(--space-sm); }
.gap-md          { gap: var(--space-md); }
.gap-lg          { gap: var(--space-lg); }
.gap-xl          { gap: var(--space-xl); }

/* ─── Focus accessibility ───────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--bordure-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ─── Scrollbar personnalisée ───────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--fond-clair);
}
::-webkit-scrollbar-thumb {
  background: var(--marine-moyen);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--marine-profond);
}

/* ─── Sélection de texte ────────────────────────────────────── */
::selection {
  background: rgba(46, 139, 192, 0.25);
  color: var(--marine-profond);
}

/* ─── Animations globales ───────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease forwards;
}

/* Délais d'animation */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ─── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --fs-5xl: 3rem;
    --fs-4xl: 2.5rem;
    --fs-3xl: 2rem;
    --space-5xl: 6rem;
    --space-4xl: 4rem;
  }

  .grille-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --fs-5xl: 2.25rem;
    --fs-4xl: 1.875rem;
    --fs-3xl: 1.5rem;
    --fs-2xl: 1.375rem;
    --container-pad: 1rem;
    --space-5xl: 4rem;
    --space-4xl: 3rem;
    --space-3xl: 2.5rem;
  }

  .grille-2,
  .grille-3,
  .grille-4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding-top: var(--space-4xl);
    padding-bottom: var(--space-4xl);
  }

  .section-entete {
    margin-bottom: var(--space-3xl);
  }

  .btn--lg {
    padding: 1rem 2rem;
    font-size: var(--fs-base);
  }
}

@media (max-width: 480px) {
  :root {
    --fs-5xl: 1.875rem;
    --fs-4xl: 1.625rem;
    --fs-3xl: 1.375rem;
  }
}