/* ================================================
   base.css — MyCarMatch v4 · Variables, reset, body
   ================================================ */

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

/* ─── DESIGN TOKENS ─────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:        #020810;
  --s1:        #050C1C;
  --s2:        #081426;
  --s3:        #0A1830;

  /* Cyan glacé — structure : accents, bordures, brackets, specs, logo */
  --cyan:         #3DDCFF;
  --cyan-rgb:     61,220,255;
  --cyan-dim:     rgba(var(--cyan-rgb),.15);
  --cyan-glow:    0 0 50px rgba(var(--cyan-rgb),.22);
  --cyan-glow-sm: 0 0 20px rgba(var(--cyan-rgb),.30);

  /* Orange électrique — accent : prix, CTAs primaires, badges */
  --orange:      #FF6A1A;
  --orange-rgb:   255,106,26;
  --orange-dim:  rgba(var(--orange-rgb),.15);
  --orange-glow: 0 0 30px rgba(var(--orange-rgb),.28);

  /* Doré — touches ponctuelles : halos de cartes, cartes vedette/sponsorisées */
  --gold:        #D4A017;
  --gold-rgb:    212,160,23;
  --gold-dim:    rgba(var(--gold-rgb),.15);
  --gold-glow:   0 0 30px rgba(var(--gold-rgb),.35);

  /* Violet IA — fonctions IA secondaires (Auto-IA, Fiabilité, Chat, rédaction…) */
  --ia:          #a05aff;
  --ia-rgb:      160,90,255;
  --ia-2:        #7c3aed;       /* violet foncé : départ des dégradés IA */
  --ia-2-rgb:    124,58,237;
  --ia-dim:      rgba(var(--ia-rgb),.12);
  --ia-glow:     0 0 28px rgba(var(--ia-rgb),.32);

  /* Texte */
  --text:     #E4EEFF;
  --text-dim: #8BA8C4;
  --muted:    #3A6080;

  /* Bordures */
  --border:   rgba(var(--cyan-rgb),.18);
  --border-h: rgba(var(--cyan-rgb),.45);

  /* Radii */
  --r:    10px;
  --r-s:  6px;
  --r-l:  16px;
  --r-xl: 24px;

  /* Spacing */
  --gap: 1.5rem;

  /* Fonts */
  --font:        'Inter', sans-serif;
  --font-script: 'Tangerine', cursive;

  /* Transitions */
  --t:      .22s ease;
  --t-fast: .12s ease;

  /* Z-index */
  --z-header: 900;
  --z-modal:  1000;
  --z-toast:  1100;
  --z-sticky: 800;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.6;
  /* overflow-x:CLIP (pas hidden) : clippe le débordement horizontal que mobile
     laisse paner malgré html{overflow-x:hidden} (carrousels 3D, etc.). `clip` ne
     crée PAS de conteneur de scroll → window.scrollY/auto-hide header intacts,
     contrairement à `hidden` qui lui en créerait un (= 2 scrollers, scrollY faussé).
     Les éléments position:fixed (dropdown IA, pub sticky, modales) ne sont pas clippés. */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient background glow — electric blue corners */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 65% at 105% -5%,  rgba(0,100,255,.75) 0%, transparent 48%),
    radial-gradient(ellipse 80%  95% at -5%  105%,  rgba(0,50,220,.50)  0%, transparent 48%),
    radial-gradient(ellipse 60%  50% at 50%  45%,   rgba(0,180,255,.18) 0%, transparent 55%),
    radial-gradient(ellipse 50%  40% at 82%  88%,   rgba(60,0,240,.16)  0%, transparent 40%);
  pointer-events: none;
  z-index: -1;
}

/* ─── TYPOGRAPHIE ───────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--t);
}
a:hover { color: #fff; }

p { line-height: 1.7; }

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

ul, ol { list-style: none; }

button {
  cursor: pointer;
  font-family: var(--font);
  border: none;
  background: none;
}

input, select, textarea {
  font-family: var(--font);
  color: var(--text);
}

/* ─── SÉLECTION ─────────────────────────────────── */
::selection {
  background: var(--cyan-dim);
  color: var(--cyan);
}

/* ─── SCROLLBAR ─────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: var(--s1); }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,229,255,.3); }

/* ─── KEYFRAMES ─────────────────────────────────── */
@keyframes electric-pulse {
  0%, 100% { box-shadow: 0 0 8px  rgba(0,229,255,.25); }
  50%       { box-shadow: 0 0 30px rgba(0,229,255,.55); }
}

@keyframes sheen {
  0%   { transform: translateX(-100%) skewX(-15deg); }
  100% { transform: translateX(350%)  skewX(-15deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

@keyframes ripple {
  to { transform: scale(2.5); opacity: 0; }
}

/* ─── UTILITAIRES ───────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

/* Séparateurs — voir layout.css pour les définitions visuelles (.hairline, .energy-bar) */

/* États de chargement */
.skeleton {
  background: linear-gradient(90deg, var(--s1) 25%, var(--s2) 50%, var(--s1) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: var(--r-s);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
