/* ===== PAGES LÉGALES RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-content {
        padding-top: 5rem; /* Moins d'espace sur mobile */
    }
    
    .legal-page {
        padding: 1rem 0;
    }
    
    .legal-page h1 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .legal-section {
        margin-bottom: 2rem;
        padding: 1.5rem;
    }
    
    .legal-section h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding-top: 4rem;
    }
    
    .legal-page h1 {
        font-size: 1.75rem;
    }
    
    .legal-section {
        padding: 1rem;
    }
    
    .legal-section ul li {
        padding-left: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .legal-section ul li::before {
        font-size: 1rem;
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* ===== MOBILE FIRST APPROACH ===== */

/* ===== EXTRA LARGE DEVICES (1400px and up) ===== */
@media (min-width: 1400px) {
  .container {
    max-width: 2000px;
    padding: 0 4rem;
  }
  
  /* Encore plus d'espacement pour les très grands écrans */
  .section {
    padding: 6rem 0;
  }
  
  .section-header {
    max-width: 1600px;
    margin: 0 auto 5rem;
  }
  
  .section-subtitle {
    max-width: 1400px;
  }
  
  .hero-content {
    gap: 8rem;
  }
  
  .hero-text h1 {
    font-size: 4.5rem;
    line-height: 1.1;
  }
  
  .hero-text p {
    font-size: 1.5rem;
  }
  
  /* Grilles avec plus d'espacement */
  .grid-3 {
    gap: 4rem;
  }
  
  .grid-2 {
    gap: 5rem;
  }
  
  .grid-4 {
    gap: 3rem;
  }
  
  /* Cartes plus spacieuses */
  .card {
    padding: 3rem;
  }
  
  .service-card {
    padding: 3.5rem 3rem;
  }
  
  .pricing-card {
    padding: 4rem 3rem;
  }
  
  /* Contact avec plus d'espace */
  .contact-content {
    gap: 8rem;
  }
}

/* ===== LARGE DEVICES (1200px and up) ===== */
@media (min-width: 1200px) {
  .container {
    max-width: 1800px;
    padding: 0 3rem;
  }
  
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Augmenter la largeur des sections pour utiliser l'espace */
  .section-header {
    max-width: 1400px;
    margin: 0 auto 4rem;
  }
  
  .section-subtitle {
    max-width: 1200px;
  }
  
  /* Optimiser les grilles pour desktop avec plus d'espacement */
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }
  
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
  }
  
  /* Ajuster les cartes pour desktop */
  .card {
    padding: 2.5rem;
  }
  
  .service-card {
    padding: 3rem 2.5rem;
  }
  
  .pricing-card {
    padding: 3.5rem 2.5rem;
  }
  
  /* Hero section desktop */
  .hero-content {
    gap: 6rem;
  }
  
  .hero-text h1 {
    font-size: 4rem;
    line-height: 1.1;
  }
  
  .hero-text p {
    font-size: 1.375rem;
  }
  
  /* Contact desktop */
  .contact-content {
    gap: 6rem;
  }
  
  .contact-form {
    padding: 3.5rem;
  }
}

/* ===== MEDIUM DEVICES (992px and up) ===== */
@media (min-width: 992px) {
  .container {
    max-width: 1600px;
    padding: 0 2rem;
  }
  
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Ajuster les sections pour plus de largeur */
  .section-header {
    max-width: 1200px;
  }
  
  .section-subtitle {
    max-width: 1000px;
  }
}

/* ===== TABLET DEVICES (768px and up) ===== */
@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
  
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .nav-menu-desktop {
    display: flex;
  }
  
  .nav-cta {
    display: flex;
  }
  
  .nav-toggle {
    display: none;
  }
  
  .mobile-menu-overlay {
    display: none;
  }
  
  .hero-content {
    grid-template-columns: 1fr 1fr;
  }
  
  .contact-content {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== MOBILE DEVICES (up to 767px) ===== */
@media (max-width: 767px) {
  /* Typography */
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .section-subtitle {
    font-size: 1.125rem;
  }
  
  /* Layout */
  .container {
    padding: 0 1rem;
  }
  
  .section {
    padding: 3rem 0;
  }
  
  .section-header {
    margin-bottom: 2rem;
  }
  
  /* Navigation */
  .nav {
    padding: 0 1rem;
  }
  
  .nav-menu-desktop {
    display: none;
  }
  
  .nav-cta {
    display: none;
  }
  
  .nav-toggle {
    display: block;
  }
  
  .mobile-menu-overlay {
    display: block;
  }
  
  /* Mobile menu container adjustments */
  .mobile-menu-container {
    max-width: 100%;
  }
  
  /* Mobile header adjustments */
  .nav {
    padding: 0 1rem;
    min-height: 70px;
    height: 70px;
  }
  
  .header {
    min-height: 70px;
    height: 70px;
  }
  
  .logo-text {
    font-size: 1.25rem;
  }
  
  .logo-suffix {
    font-size: 1.25rem;
  }
  
  /* Hero Section */
  .hero {
    min-height: 80vh;
    padding: 5rem 0 2rem 0; /* Plus d'espace en haut pour éviter le croppage */
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: left;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: flex-start;
  }
  
  /* Grid Layouts */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* Cards */
  .card {
    padding: 1.5rem;
  }
  
  .service-card {
    padding: 2rem 1rem;
  }
  
  .pricing-card {
    padding: 2rem 1rem;
  }
  
  .pricing-card.featured {
    transform: none;
  }
  
  /* Contact */
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .contact-form {
    padding: 2rem 1rem;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    text-align: left; /* Align to left on mobile */
    gap: 2rem;
  }
  
  /* Buttons */
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }
  
  /* Forms */
  .form-input,
  .form-textarea {
    padding: 0.875rem;
  }
}

/* ===== SMALL MOBILE DEVICES (up to 480px) ===== */
@media (max-width: 480px) {
  /* Typography */
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  p {
    font-size: 1rem;
  }
  
  /* Layout */
  .section {
    padding: 2rem 0;
  }
  
  /* Cards */
  .card {
    padding: 1rem;
  }
  
  .service-card {
    padding: 1.5rem 0.5rem;
  }
  
  .pricing-card {
    padding: 1.5rem 0.5rem;
  }
  
  .pricing-price {
    font-size: 2.5rem;
  }
  
  /* Contact */
  .contact-form {
    padding: 1.5rem 0.5rem;
  }
  
  /* Hero */
  .hero-text p {
    font-size: 1rem;
  }
  
  /* Team */
  .team-avatar {
    width: 120px;
    height: 120px;
    font-size: 2rem;
  }
  
  /* Testimonials */
  .testimonial-avatar {
    width: 60px;
    height: 60px;
    font-size: 1.25rem;
  }
  
  /* Header adjustments for very small screens */
  .nav {
    padding: 0 0.75rem;
    min-height: 60px;
    height: 60px;
  }
  
  .header {
    min-height: 60px;
    height: 60px;
  }
  
  .logo-text {
    font-size: 1.125rem;
  }
  
  .logo-suffix {
    font-size: 1.125rem;
  }
  
  .mobile-menu-header {
    padding: 1rem 1.5rem;
  }
  
  .mobile-nav-link {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
  
  .mobile-menu-footer {
    padding: 1.5rem;
  }

  /* Footer responsive */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-nav {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: left; /* Align to left on mobile */
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: left; /* Keep left alignment on mobile */
    gap: 1rem;
  }

  .footer-legal {
    justify-content: flex-start; /* Align to left on mobile */
  }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
  }
  
  .hero-content {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  
  .nav-menu {
    flex-direction: row;
    gap: 1rem;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .header,
  .footer,
  .btn,
  .nav-toggle {
    display: none !important;
  }
  
  .hero {
    min-height: auto;
    padding: 4rem 0 2rem 0; /* Plus d'espace en haut pour éviter le croppage */
  }
  
  .section {
    padding: 1rem 0;
    page-break-inside: avoid;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  .card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@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;
  }
  
  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right,
  .scroll-reveal-scale {
    opacity: 1;
    transform: none;
  }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
  :root {
    --text-dark: #000000;
    --text-light: #333333;
    --border-color: #000000;
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.3);
    --shadow-large: 0 8px 16px rgba(0, 0, 0, 0.3);
  }
  
  .btn {
    border: 2px solid currentColor;
  }
  
  .card {
    border: 2px solid var(--border-color);
  }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --text-dark: #f9fafb;
    --text-light: #d1d5db;
    --bg-light: #1f2937;
    --bg-white: #111827;
    --border-color: #374151;
  }
  
  body {
    background-color: var(--bg-white);
    color: var(--text-dark);
  }
  
  .header {
    background: rgba(17, 24, 39, 0.95);
    border-bottom-color: var(--border-color);
  }
  
  .card {
    background: var(--bg-white);
    border-color: var(--border-color);
  }
  
  .form-input,
  .form-textarea {
    background: var(--bg-white);
    border-color: var(--border-color);
    color: var(--text-dark);
  }
}

/* ===== FOCUS STYLES FOR ACCESSIBILITY ===== */
@media (prefers-reduced-motion: no-preference) {
  .btn:focus,
  .nav-link:focus,
  .form-input:focus,
  .form-textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
  }
}

/* ===== CONTAINER QUERIES (FUTURE PROOF) ===== */
@supports (container-type: inline-size) {
  .card-container {
    container-type: inline-size;
  }
  
  @container (max-width: 300px) {
    .card {
      padding: 1rem;
    }
    
    .card h3 {
      font-size: 1.125rem;
    }
  }
}

/* ===== FLEXIBLE GRID WITH CSS GRID ===== */
@media (min-width: 768px) {
  .responsive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
  }
}

@media (max-width: 767px) {
  .responsive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ===== RESPONSIVE IMAGES ===== */
.responsive-img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 767px) {
  .responsive-img {
    max-width: 100%;
    height: auto;
  }
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
@media (max-width: 767px) {
  .responsive-text {
    font-size: clamp(1rem, 4vw, 1.25rem);
    line-height: 1.5;
  }
  
  .responsive-heading {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    line-height: 1.2;
  }
}

/* ===== RESPONSIVE SPACING ===== */
@media (max-width: 767px) {
  .responsive-spacing {
    padding: clamp(1rem, 5vw, 3rem) 0;
  }
  
  .responsive-margin {
    margin: clamp(1rem, 5vw, 2rem) 0;
  }
}
