/**
 * CSS Responsive Ultra-Optimisé
 * Arcogva - Garantit un affichage parfait sur tous les appareils
 * Mobile First Approach
 */

/* ========================================
   BREAKPOINTS
   ======================================== */
/* 
   xs: 0-479px    (petits mobiles)
   sm: 480-767px  (mobiles)
   md: 768-1023px (tablettes)
   lg: 1024-1279px (petits écrans)
   xl: 1280px+    (écrans standards)
*/

/* ========================================
   BASE MOBILE OPTIMIZATIONS
   ======================================== */

/* Empêcher le zoom sur les inputs (iOS) */
input, textarea, select {
  font-size: 16px !important;
}

/* Améliorer le tap sur mobile */
button, a, .btn {
  -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
  touch-action: manipulation;
}

/* Smooth scroll sur iOS */
body {
  -webkit-overflow-scrolling: touch;
}

/* Éviter le dépassement horizontal */
body, html {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ========================================
   PETITS MOBILES (0-479px)
   ======================================== */
@media (max-width: 479px) {
  /* Container ultra serré */
  .container {
    padding: 0 0.75rem;
  }

  /* Titres réduits */
  h1 {
    font-size: 1.75rem !important;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.5rem !important;
    line-height: 1.25;
  }

  h3 {
    font-size: 1.25rem !important;
  }

  /* Boutons full-width sur petit mobile */
  .btn {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1rem;
  }

  /* Hero compact */
  .hero-content {
    padding: 3rem 0;
  }

  .hero h1 {
    font-size: 1.75rem !important;
  }

  .hero p {
    font-size: 1rem !important;
  }

  /* Cards sans gap sur petit mobile */
  .card {
    margin-bottom: 1rem;
  }

  /* Sections plus compactes */
  .section {
    padding: 2rem 0;
  }

  /* Logo header plus petit */
  .logo {
    width: 60px !important;
    height: 60px !important;
  }

  /* Header plus compact */
  .header-container {
    height: 4rem !important;
  }

  /* Menu mobile pleine largeur sur petit écran */
  .mobile-menu-panel {
    width: 100% !important;
    max-width: 100vw !important;
  }

  /* Formulaire empilé */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  /* Service cards stack */
  .service-card {
    padding: 1.5rem !important;
  }

  /* Trust indicators stack */
  .trust-indicators {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  /* Footer compact */
  footer {
    padding: 2rem 0 !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  /* Carousel logos plus petit */
  .logo-carousel-container {
    min-height: 120px !important;
  }
}

/* ========================================
   MOBILES (480-767px)
   ======================================== */
@media (min-width: 480px) and (max-width: 767px) {
  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: 2rem !important;
  }

  h2 {
    font-size: 1.75rem !important;
  }

  /* Hero */
  .hero-content {
    padding: 4rem 0;
  }

  .hero h1 {
    font-size: 2rem !important;
  }

  .hero p {
    font-size: 1.125rem !important;
  }

  /* Boutons flexibles */
  .hero-ctas {
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn {
    padding: 0.875rem 1.5rem;
  }

  /* Grilles 1 colonne sur mobile */
  .service-grid,
  .features-grid,
  .process-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  /* Menu mobile 280px sur mobile moyen */
  .mobile-menu-panel {
    width: 280px;
    max-width: 85vw;
  }

  /* Logo header taille moyenne */
  .logo {
    width: 70px;
    height: 70px;
  }

  .header-container {
    height: 4.5rem;
  }

  /* Footer 2 colonnes sur mobile */
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem;
  }
}

/* ========================================
   TABLETTES (768-1023px)
   ======================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  .container {
    padding: 0 1.5rem;
  }

  h1 {
    font-size: 2.25rem !important;
  }

  h2 {
    font-size: 2rem !important;
  }

  /* Hero tablette */
  .hero-content {
    padding: 5rem 0;
  }

  .hero h1 {
    font-size: 2.5rem !important;
  }

  .hero p {
    font-size: 1.25rem !important;
  }

  .hero-ctas {
    flex-direction: row;
    gap: 1rem;
  }

  /* Grilles 2 colonnes sur tablette */
  .service-grid,
  .features-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem;
  }

  .process-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem;
  }

  /* Menu mobile reste visible sur tablette */
  .mobile-menu-btn {
    display: block !important;
  }

  .nav-desktop {
    display: none !important;
  }

  /* Cacher les actions de navigation sur mobile et tablette */
  .nav-actions {
    display: none !important;
  }

  .mobile-menu-panel {
    width: 320px;
    max-width: 60vw;
  }

  /* Logo header taille normale */
  .logo {
    width: 75px;
    height: 75px;
  }

  .header-container {
    height: 5rem;
  }

  /* Footer 3 colonnes sur tablette */
  .footer-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem;
  }

  /* Sections bien espacées */
  .section {
    padding: 3.5rem 0;
  }
}

/* ========================================
   DESKTOP PETITS ÉCRANS (1024-1279px)
   ======================================== */
@media (min-width: 1024px) and (max-width: 1279px) {
  .container {
    padding: 0 2rem;
    max-width: 1024px;
  }

  /* Navigation desktop visible */
  .nav-desktop {
    display: flex !important;
  }

  .mobile-menu-btn {
    display: none !important;
  }

  /* Grilles 3-4 colonnes */
  .service-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem;
  }

  .process-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem;
  }

  /* Footer 4 colonnes */
  .footer-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 2.5rem;
  }

  /* Hero desktop */
  .hero-content {
    padding: 6rem 0;
  }

  .hero h1 {
    font-size: 3rem !important;
  }

  .hero p {
    font-size: 1.375rem !important;
  }

  .hero-ctas {
    flex-direction: row;
    gap: 1rem;
  }
}

/* ========================================
   DESKTOP STANDARDS (1280px+)
   ======================================== */
@media (min-width: 1280px) {
  .container {
    padding: 0 2rem;
    max-width: 1200px;
  }

  /* Grilles optimales */
  .service-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 3rem;
  }

  .features-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 2rem;
  }

  .process-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 2rem;
  }

  .footer-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 3rem;
  }

  /* Hero grand écran */
  .hero-content {
    padding: 6rem 0;
  }

  .hero h1 {
    font-size: 3.75rem !important;
  }

  .hero p {
    font-size: 1.5rem !important;
  }
}

/* ========================================
   MENU MOBILE OPTIMIZATIONS
   ======================================== */

/* Bloquer le scroll du body quand menu ouvert */
body.mobile-menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Améliorer le slide du menu */
.mobile-menu-overlay {
  will-change: opacity;
}

.mobile-menu-panel {
  will-change: transform;
  overscroll-behavior: contain;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Zone de tap plus grande sur mobile */
@media (max-width: 1023px) {
  .mobile-nav-link {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }

  .mobile-nav-link svg {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
  }

  .mobile-menu-header {
    padding: 1.25rem;
  }

  .mobile-menu-close {
    padding: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .lang-selector {
    gap: 0.5rem;
  }

  .lang-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ========================================
   FORMULAIRES RESPONSIVE
   ======================================== */

/* Mobile: inputs full-width avec bonne taille de tap */
@media (max-width: 767px) {
  .form-input,
  .form-textarea,
  .form-select {
    padding: 0.875rem 1rem;
    font-size: 16px; /* Évite le zoom iOS */
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .btn[type="submit"] {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
  }

  .form-group {
    margin-bottom: 1.25rem;
  }
}

/* Tablette: grille 2 colonnes */
@media (min-width: 768px) and (max-width: 1023px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .form-group.full-width {
    grid-column: 1 / -1;
  }
}

/* ========================================
   CAROUSEL LOGOS RESPONSIVE
   ======================================== */

@media (max-width: 479px) {
  .logo-carousel-container {
    min-height: 120px;
    aspect-ratio: 2 / 1;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .logo-carousel-container {
    min-height: 140px;
    aspect-ratio: 2.5 / 1;
  }
}

@media (min-width: 768px) {
  .logo-carousel-container {
    min-height: 160px;
    aspect-ratio: 5 / 2;
  }
}

/* ========================================
   CARDS RESPONSIVE
   ======================================== */

@media (max-width: 767px) {
  .card {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }

  .service-card {
    padding: 1.5rem;
  }

  .service-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .service-icon {
    width: 3rem !important;
    height: 3rem !important;
  }

  .service-features {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .card {
    padding: 2rem;
  }

  .service-card {
    padding: 2rem;
  }

  .service-features {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* ========================================
   IMAGES RESPONSIVE
   ======================================== */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.hero-bg-image {
  object-fit: cover;
  object-position: center;
}

/* Sur mobile: optimiser l'affichage des images hero */
@media (max-width: 767px) {
  .hero-bg-image {
    object-position: center 30%;
  }
}

/* ========================================
   ESPACEMENTS RESPONSIVE
   ======================================== */

@media (max-width: 479px) {
  .mt-12 { margin-top: 2rem !important; }
  .mt-16 { margin-top: 2.5rem !important; }
  .mb-12 { margin-bottom: 2rem !important; }
  .mb-16 { margin-bottom: 2.5rem !important; }
  .py-16 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
  .py-20 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
  .py-24 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
  .gap-8 { gap: 1.5rem !important; }
  .gap-12 { gap: 2rem !important; }
}

@media (min-width: 480px) and (max-width: 767px) {
  .mt-12 { margin-top: 2.5rem !important; }
  .mt-16 { margin-top: 3rem !important; }
  .mb-12 { margin-bottom: 2.5rem !important; }
  .mb-16 { margin-bottom: 3rem !important; }
  .py-16 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
  .py-20 { padding-top: 3.5rem !important; padding-bottom: 3.5rem !important; }
  .py-24 { padding-top: 4rem !important; padding-bottom: 4rem !important; }
}

/* ========================================
   TEXTES RESPONSIVE
   ======================================== */

/* Ajuster la taille de police pour la lisibilité */
@media (max-width: 767px) {
  body {
    font-size: 0.9375rem;
    line-height: 1.6;
  }

  p {
    font-size: 0.9375rem;
  }

  .text-sm {
    font-size: 0.875rem;
  }

  .text-lg {
    font-size: 1.0625rem;
  }

  .text-xl {
    font-size: 1.125rem;
  }
}

/* ========================================
   PERFORMANCES MOBILE
   ======================================== */

/* Optimiser les animations sur mobile */
@media (max-width: 1023px) {
  .card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }

  /* Réduire les transitions */
  * {
    transition-duration: 0.2s !important;
  }
}

/* Réduire les animations pour économiser la batterie */
@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;
  }
}

/* ========================================
   MODE PAYSAGE MOBILE
   ======================================== */

@media (max-height: 500px) and (orientation: landscape) {
  .hero-content {
    padding: 2rem 0 !important;
  }

  .mobile-menu-panel {
    width: 280px;
  }

  .mobile-menu-nav {
    padding: 1rem;
  }

  .mobile-nav-link {
    padding: 0.5rem 1rem;
  }

  .section {
    padding: 2rem 0;
  }
}

/* ========================================
   PRINT (bonus)
   ======================================== */

@media print {
  .mobile-menu-btn,
  .mobile-menu-overlay,
  .nav-desktop,
  footer {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: black;
  }

  .hero,
  .section {
    page-break-inside: avoid;
  }
}

/* ========================================
   ACCESSIBILITÉ AMÉLIORÉE
   ======================================== */

/* Focus visible au clavier */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* Zone de tap minimum 44x44px (recommandation Apple/Android) */
@media (max-width: 1023px) {
  button,
  .btn,
  a {
    min-height: 44px;
    min-width: 44px;
  }
}

