/* ============================================================
   BOOSTDRIVING — BASE.CSS
   Design System Foundation
   Polices : Geist Sans (titres) + Manrope (corps) | Primary : #0EA5E9
   ============================================================ */

/* —— FONTS ——————————————————————————————————————————————————— */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/geist@1.2.0/dist/fonts/geist-sans/style.css');

/* —— RESET ——————————————————————————————————————————————————— */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--gray-900);
  background-color: var(--surface-page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body > main,
body > .listing-page,
body > .compare-page,
body > .simulateur-page,
body > .auth-page,
body > .login-page,
body > .user-layout {
  flex: 1;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18);
  border-radius: 10px;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}


/* —— VARIABLES —————————————————————————————————————————————— */

:root {

  /* ── Couleurs principales ─────────────────────────────────── */
  --color-primary:       #0EA5E9;
  --color-primary-hover:  #0284C7;
  --color-primary-active: #0369A1;
  --color-primary-light:  #E0F2FE;
  --color-primary-50:     #F0F9FF;

  /* Degrade signature BoostDriving (logo) — cyan → bleu ciel → rose → orange */
  --brand-gradient:      linear-gradient(135deg, #0EA5E9 0%, #38BDF8 30%, #F472B6 65%, #FB923C 100%);
  --brand-gradient-deep: linear-gradient(135deg, #0284C7 0%, #0EA5E9 30%, #EC4899 65%, #EA580C 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(14,165,233,0.10) 0%, rgba(244,114,182,0.08) 60%, rgba(251,146,60,0.10) 100%);

  --color-accent:        #E94560;
  --color-accent-hover:   #DC2643;
  --color-accent-light:   #FEE2E8;

  --color-gold:          #F59E0B;
  --color-gold-light:     #FEF3C7;

  /* ── Couleurs sémantiques ─────────────────────────────────── */
  --color-success:       #10B981;
  --color-success-light:  #D1FAE5;
  --color-success-dark:   #065F46;

  --color-warning:       #F59E0B;
  --color-warning-light:  #FEF3C7;
  --color-warning-dark:   #92400E;

  --color-danger:        #EF4444;
  --color-danger-light:   #FEE2E2;
  --color-danger-dark:    #991B1B;

  --color-info:          #0EA5E9;
  --color-info-light:     #E0F2FE;
  --color-info-dark:      #0369A1;

  /* ── Navy (sidebar admin, dark sections) ──────────────────── */
  --navy-900:            #0F172A;
  --navy-800:            #1E293B;
  --navy-700:            #334155;
  --navy-600:            #475569;
  --navy-500:            #64748B;
  --navy-400:            #94A3B8;
  --navy-300:            #CBD5E1;
  --navy-200:            #E2E8F0;
  --navy-100:            #F1F5F9;
  --navy-50:             #F8FAFC;

  /* ── Gris neutres ─────────────────────────────────────────── */
  --gray-50:             #F9FAFB;
  --gray-100:            #F3F4F6;
  --gray-200:            #E5E7EB;
  --gray-300:            #D1D5DB;
  --gray-400:            #9CA3AF;
  --gray-500:            #6B7280;
  --gray-600:            #4B5563;
  --gray-700:            #374151;
  --gray-800:            #1F2937;
  --gray-900:            #111827;

  /* ── Surfaces ─────────────────────────────────────────────── */
  --surface-page:        #F8FAFC;
  --surface-card:        #FFFFFF;
  --surface-elevated:    #FFFFFF;
  --surface-overlay:     rgba(15, 23, 42, 0.5);

  /* ── Bordures ─────────────────────────────────────────────── */
  --border-light:        #F1F5F9;
  --border-default:      #E2E8F0;
  --border-medium:       #CBD5E1;
  --border-strong:       #94A3B8;

  /* ── Typographie ──────────────────────────────────────────── */
  --font-family:         'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading:        'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --text-xs:             0.75rem;    /* 12px */
  --text-sm:             0.8125rem;  /* 13px */
  --text-base:           0.9375rem;  /* 15px */
  --text-lg:             1.125rem;   /* 18px */
  --text-xl:             1.25rem;    /* 20px */
  --text-2xl:            1.5rem;     /* 24px */
  --text-3xl:            2rem;       /* 32px */
  --text-4xl:            2.5rem;     /* 40px */

  --font-regular:        400;
  --font-medium:         500;
  --font-semibold:       600;
  --font-bold:           700;

  --tracking-tight:      -0.04em;
  --tracking-snug:       -0.02em;
  --tracking-normal:     0;

  --leading-tight:       1.25;
  --leading-normal:      1.5;
  --leading-relaxed:     1.6;

  /* ── Espacements ──────────────────────────────────────────── */
  --space-1:             0.25rem;    /* 4px */
  --space-2:             0.5rem;     /* 8px */
  --space-3:             0.75rem;    /* 12px */
  --space-4:             1rem;       /* 16px */
  --space-5:             1.25rem;    /* 20px */
  --space-6:             1.5rem;     /* 24px */
  --space-8:             2rem;       /* 32px */
  --space-10:            2.5rem;     /* 40px */
  --space-12:            3rem;       /* 48px */
  --space-16:            4rem;       /* 64px */

  /* ── Rayons ───────────────────────────────────────────────── */
  --radius-sm:           6px;
  --radius-md:           8px;
  --radius-lg:           10px;
  --radius-xl:           14px;
  --radius-2xl:          20px;
  --radius-full:         9999px;

  /* ── Ombres ───────────────────────────────────────────────── */
  --shadow-xs:           0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm:           0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md:           0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg:           0 10px 15px rgba(0, 0, 0, 0.06), 0 4px 6px rgba(0, 0, 0, 0.04);
  --shadow-xl:           0 20px 25px rgba(0, 0, 0, 0.08), 0 8px 10px rgba(0, 0, 0, 0.04);

  /* ── Transitions ──────────────────────────────────────────── */
  --transition-fast:     150ms ease;
  --transition-base:     200ms ease;
  --transition-slow:     300ms ease;

  /* ── Z-index ──────────────────────────────────────────────── */
  --z-dropdown:          100;
  --z-sticky:            200;
  --z-sidebar:           300;
  --z-overlay:           400;
  --z-modal:             500;
  --z-toast:             600;
  --z-tooltip:           700;

  /* ── Conteneur ────────────────────────────────────────────── */
  --container-sm:        640px;
  --container-md:        768px;
  --container-lg:        1024px;
  --container-xl:        1200px;
  --container-2xl:       1400px;
}


/* —— UTILITAIRES TYPOGRAPHIE ————————————————————————————————— */

.text-xs     { font-size: var(--text-xs); }
.text-sm     { font-size: var(--text-sm); }
.text-base   { font-size: var(--text-base); }
.text-lg     { font-size: var(--text-lg); }
.text-xl     { font-size: var(--text-xl); }
.text-2xl    { font-size: var(--text-2xl); }
.text-3xl    { font-size: var(--text-3xl); }
.text-4xl    { font-size: var(--text-4xl); }

.font-regular  { font-weight: var(--font-regular); }
.font-medium   { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold     { font-weight: var(--font-bold); }

.text-primary   { color: var(--gray-900); }
.text-secondary { color: var(--gray-500); }
.text-tertiary  { color: var(--gray-400); }
.text-muted     { color: var(--navy-400); }
.text-white     { color: #FFFFFF; }
.text-accent    { color: var(--color-primary); }


/* —— HEADINGS (Geist) ————————————————————————————————————— */

h1, h2, h3, h4, h5, h6,
.heading {
  font-family: var(--font-heading);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: var(--gray-900);
}

h1, .h1 {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  letter-spacing: -0.04em;
}

h2, .h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  letter-spacing: -0.03em;
}

h3, .h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  letter-spacing: -0.02em;
}

h4, .h4 {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  letter-spacing: -0.02em;
}

h5, .h5 {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: -0.01em;
}

/* Classe pour forcer Geist sur un élément non-heading */
.font-heading {
  font-family: var(--font-heading);
  letter-spacing: var(--tracking-tight);
}

/* Grands chiffres (stats, KPIs) — Geist serré */
.stat-number {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  letter-spacing: -0.04em;
}


/* —— UTILITAIRES LAYOUT ——————————————————————————————————— */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

.grid        { display: grid; }
.grid-2      { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3      { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4      { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.w-full      { width: 100%; }
.h-full      { height: 100%; }

.hidden      { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* —— UTILITAIRES ESPACEMENT ———————————————————————————————— */

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

.mx-auto { margin-left: auto; margin-right: auto; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }


/* —— UTILITAIRES VISUELS ——————————————————————————————————— */

.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.transition {
  transition: all var(--transition-base);
}


/* —— ICONES SVG ——————————————————————————————————————————— */

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

.icon-filled svg {
  fill: currentColor;
  stroke: none;
}


/* —— SCROLLBAR CUSTOM ————————————————————————————————————— */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}


/* —— SELECTION ————————————————————————————————————————————— */

::selection {
  background: var(--color-primary-light);
  color: var(--color-primary-active);
}
