/* ============================================
   BASE STYLES - Reset, Typography, Animations
   ============================================ */

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--line-height-base);
  color: var(--color-text-primary);
  background-color: var(--color-white);
  overflow-x: hidden;
  min-height: 100vh;
}

/* === ACCESSIBILITY - Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--line-height-heading);
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-extrabold);
}

h3 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
}

h4 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
}

h5 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}

h6 {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
}

@media (min-width: 768px) {
  h1 { font-size: var(--fs-5xl); }
  h2 { font-size: var(--fs-4xl); }
  h3 { font-size: var(--fs-3xl); }
}

@media (min-width: 1024px) {
  h1 { font-size: var(--fs-6xl); }
}

p {
  margin-bottom: var(--space-sm);
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover { color: var(--color-primary-dark); }

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

strong, b { font-weight: var(--fw-bold); }
em, i { font-style: italic; }
small { font-size: var(--fs-sm); }

/* === LISTS === */
ul, ol { list-style: none; }

ul.styled-list,
ol.styled-list {
  list-style-position: inside;
  padding-left: var(--space-md);
}

ul.styled-list { list-style-type: disc; }
ol.styled-list { list-style-type: decimal; }

/* === IMAGES & MEDIA === */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img { border-style: none; }
svg { fill: currentColor; }

/* === FORMS === */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  background-color: var(--color-white);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* === UTILITY CLASSES === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-primary { color: var(--color-primary); }
.text-white { color: var(--color-white); }
.text-uppercase { text-transform: uppercase; }
.text-center { text-align: center; }

/* Skip link - accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-sm);
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-sm) var(--space-md);
  z-index: var(--z-tooltip);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: var(--fw-semibold);
  transition: top var(--transition-base);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: var(--space-sm);
  color: var(--color-white);
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

/* === SELECTION === */
::selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

::-moz-selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* === SCROLLBAR (Webkit) === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background-color: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background-color: var(--color-text-muted);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background-color: var(--color-text-secondary); }

/* === FOCUS === */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* === GLOBAL ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* === ANIMATION UTILITIES === */
.animate-fade-in { animation: fadeIn var(--transition-base); }
.animate-fade-in-up { animation: fadeInUp var(--transition-slow); }
.animate-fade-in-down { animation: fadeInDown var(--transition-slow); }
.animate-slide-in-left { animation: slideInLeft var(--transition-slow); }
.animate-slide-in-right { animation: slideInRight var(--transition-slow); }
.animate-scale-in { animation: scaleIn var(--transition-base); }

/* ==========================================================================
   HARMONISATION ET ALIGNEMENT DE TOUS LES BOUTONS
   ========================================================================== */

/* 1. Base commune stricte pour les liens-boutons et les vrais boutons */
.btn, 
.header__cta, 
.hero__cta .btn, 
.mobile-menu__cta,
.quote-form button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box !important; /* Force le calcul identique de la taille */
  vertical-align: middle;
  text-align: center;
  font-family: 'Inter', sans-serif !important; /* Aligne la police */
  font-weight: 600 !important;
  white-space: nowrap; /* Évite qu'un bouton passe sur deux lignes */
  height: 48px; /* Hauteur standardisée pour tous les boutons par défaut */
  padding: 0 24px !important;
  transition: all 0.3s ease;
}

/* 2. Harmonisation des boutons Large (.btn--lg comme dans le Hero et le Calculateur) */
.btn--lg,
.quote-form .btn--lg {
  height: 56px !important; /* Même hauteur stricte pour tous les grands boutons */
  padding: 0 32px !important;
  font-size: 1.05rem !important;
}

/* 3. Gestion du responsive pour les boutons empilés */
@media (max-width: 768px) {
  /* Force tous les boutons du Hero et du calculateur à prendre 100% de large proprement */
  .hero__cta .btn,
  .quote-form button,
  .btn--block {
    width: 100% !important;
    display: flex !important;
    max-width: 100% !important;
  }
}
/* ==========================================================================
   CORRECTIF SPÉCIFIQUE POUR LE BOUTON "ÉTUDE GRATUITE" (TEXTE LONG)
   ========================================================================== */

/* Applique la même hauteur et le même comportement à ce bouton long */
.why-choose .btn--lg,
a[href="#contact"].btn--lg {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box !important;
  
  /* Même hauteur stricte que le bouton du Hero et du Calculateur */
  height: 56px !important; 
  min-height: 56px !important;
  
  /* Ajustement des espaces pour les textes longs */
  padding: 0 24px !important; 
  font-size: 0.95rem !important; /* Légèrement réduit pour que tout tienne sur une ligne */
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 700 !important;
  
  /* Permet au texte de respirer sans casser la hauteur sur les petits écrans */
  white-space: normal !important; 
  line-height: 1.2 !important;
}

/* Force l'icône flèche à rester bien alignée à droite avec un espace régulier */
.why-choose .btn--lg i,
a[href="#contact"].btn--lg i {
  margin-left: 10px !important;
  display: inline-block;
}

/* --- AJUSTEMENT MOBILE (Écrans inférieurs à 768px) --- */
@media (max-width: 768px) {
  .why-choose .btn--lg,
  a[href="#contact"].btn--lg {
    width: 100% !important; /* Prend toute la largeur sur mobile comme les autres */
    max-width: 100% !important;
    height: auto !important; /* Devient fluide si le texte doit passer sur 2 lignes sur petit mobile */
    min-height: 56px !important;
    padding: 12px 20px !important; /* Padding vertical pour les textes sur 2 lignes */
    font-size: 0.9rem !important;
  }
}
/* ==========================================================================
   ALIGNEMENT DE LA GRILLE DES SERVICES (3 PAR 3 SUR ÉCRAN GRAND / MOYEN)
   ========================================================================== */