/*
=====================================================
UPPER FORMA - RESPONSIVE STYLESHEET
Mobile-first responsive design
Breakpoints: 768px (tablette), 992px (desktop), 1200px (large)
=====================================================
*/

/* ===== TABLETTE (768px et moins) ===== */
@media (max-width: 992px) {
    
    /* Typography */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    /* Grid adjustments */
    .value-grid,
    .formations-grid,
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dropdown-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Hero */
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .hero-stats {
        justify-content: space-around;
    }
    
    /* CTA Section */
    .cta-content {
        grid-template-columns: 1fr;
    }
    
    /* Process */
    .process-steps {
        flex-direction: column;
    }
    
    .process-arrow {
        transform: rotate(90deg);
        padding-top: 0;
        padding-left: 50px;
    }
    
    /* FAQ */
    .faq-grid {
        grid-template-columns: 1fr;
    }
}

/* Empêcher le scroll horizontal sur mobile */
body {
    overflow-x: hidden;
    position: relative;
}

/* Bloquer le scroll du body quand le menu est ouvert */
body.menu-open {
    overflow: hidden;
}

/* ===== MOBILE (768px et moins) ===== */
@media (max-width: 768px) {
    
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    /* Header */
    .header-top {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* ===== TOUCH TARGETS WCAG (44x44px minimum) ===== */
    
    /* Footer links */
    .footer-links a {
        padding: 12px 8px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* S'assurer que les numéros de téléphone restent sur une ligne en mobile */
    .footer-contact a[href^="tel:"],
    .header-top a[href^="tel:"],
    .contact-info a[href^="tel:"],
    a[href^="tel:"] {
        white-space: nowrap !important;
    }
    
    .footer-legal a {
        padding: 10px 12px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        margin: 4px;
    }
    
    .footer-contact a {
        padding: 10px 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Navigation mobile */
    .nav-link {
        padding: 14px 16px;
        min-height: 48px;
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary {
        min-height: 48px;
        padding: 12px 24px;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--color-white);
        flex-direction: column;
        padding: var(--spacing-lg);
        overflow-y: auto;
        transition: all 0.3s ease;
        box-shadow: var(--shadow-lg);
        z-index: 9999;
        /* Cacher sans décalage */
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
    }
    
    .nav-menu.active {
        /* Afficher sans décalage */
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        width: 100%;
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--color-gray-200);
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        min-width: auto;
        padding: 0 var(--spacing-md);
        margin-top: var(--spacing-sm);
        max-height: 0;
        overflow: hidden;
        transition: var(--transition-base);
    }
    
    .dropdown.active .dropdown-menu {
        max-height: 1000px;
        padding: var(--spacing-md);
    }
    
    .dropdown-grid {
        grid-template-columns: 1fr;
    }
    
    .dropdown-footer {
        margin-top: var(--spacing-md);
    }
    
    .nav-cta {
        width: 100%;
    }
    
    .nav-cta .btn-primary {
        width: 100%;
    }
    
    /* Hero */
    .hero {
        padding: var(--spacing-lg) 0;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .hero-cta .btn-lg {
        width: 100%;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .hero-card {
        padding: var(--spacing-md);
    }
    
    /* Grids to single column */
    .value-grid,
    .formations-grid,
    .testimonials-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    /* CTA Section */
    .cta-section {
        padding: var(--spacing-lg) 0;
    }
    
    .cta-content {
        grid-template-columns: 1fr;
    }
    
    .cta-text h2 {
        font-size: 1.75rem;
    }
    
    .cta-text p {
        font-size: 1rem;
    }
    
    .cta-features li {
        font-size: 1rem;
    }
    
    /* Buttons */
    .btn-lg {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 1rem;
    }
    
    /* Certifications Band */
    .certifications-content {
        flex-direction: column;
        text-align: center;
    }
    
    /* Cookie Banner */
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .cookie-buttons button {
        width: 100%;
    }
    
    /* Chat & Scroll buttons */
    .chat-button {
        right: 20px;
        bottom: 20px;
        width: 50px;
        height: 50px;
    }
    
    .scroll-top {
        right: 20px;
        bottom: 90px;
        width: 45px;
        height: 45px;
    }
    
    /* Filter Section */
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-search {
        width: 100%;
    }
    
    .filter-buttons {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .filter-btn {
        white-space: nowrap;
    }
    
    /* Page Header */
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    /* Spacing adjustments */
    .section-header {
        margin-bottom: var(--spacing-lg);
    }
    
    section {
        padding: var(--spacing-lg) 0 !important;
    }
    
    /* Footer */
    .footer-main {
        padding: var(--spacing-lg) 0;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-legal {
        flex-direction: column;
        align-items: center;
    }
}

/* ===== FORMATION DETAIL PAGE RESPONSIVE ===== */
@media (max-width: 992px) {
    .formation-layout {
        grid-template-columns: 1fr;
    }
    
    .formation-sidebar {
        order: -1;
    }
    
    .sticky-sidebar {
        position: static;
    }
    
    .formation-hero-content {
        grid-template-columns: 1fr;
    }
    
    .formation-quick-info {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .methods-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modalities-grid {
        grid-template-columns: 1fr;
    }
    
    .financing-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .formation-hero {
        padding: var(--spacing-md) 0;
    }
    
    .formation-quick-info {
        grid-template-columns: 1fr;
    }
    
    .hero-cta-buttons {
        flex-direction: column;
    }
    
    .hero-cta-buttons .btn-lg {
        width: 100%;
    }
    
    .methods-grid {
        grid-template-columns: 1fr;
    }
    
    .program-module {
        margin-bottom: var(--spacing-md);
    }
    
    .objectives-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== CONTACT PAGE RESPONSIVE ===== */
@media (max-width: 768px) {
    .contact-layout {
        grid-template-columns: 1fr;
    }
    
    .contact-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== A PROPOS PAGE RESPONSIVE ===== */
@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== FINANCEMENT PAGE RESPONSIVE ===== */
@media (max-width: 768px) {
    .financing-cards {
        grid-template-columns: 1fr;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .header,
    .footer,
    .cookie-banner,
    .chat-button,
    .scroll-top,
    .btn-primary,
    .btn-secondary,
    .cta-section {
        display: none !important;
    }
    
    body {
        color: black;
        background: white;
    }
    
    a {
        text-decoration: underline;
    }
    
    .formation-content {
        max-width: 100%;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: var(--spacing-md) 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .nav-menu {
        height: calc(100vh - 60px);
    }
}

/* ===== SMALL MOBILE (480px et moins) ===== */
@media (max-width: 480px) {
    :root {
        --font-size-base: 14px;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .logo-upper,
    .logo-forma {
        font-size: 1.25rem;
    }
    
    .btn-lg {
        padding: var(--spacing-sm);
        font-size: 0.875rem;
    }
    
    .formation-card {
        padding: var(--spacing-md);
    }
    
    .value-card {
        padding: var(--spacing-md);
    }
    
    .value-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
    
    .hero-icon {
        font-size: 3rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
@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;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --shadow-sm: 0 0 0 1px currentColor;
        --shadow-md: 0 0 0 2px currentColor;
        --shadow-lg: 0 0 0 3px currentColor;
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid currentColor;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Can be implemented later if dark mode is desired */
}
