/* ===============================================
   DCONSULTING V2 - RESPONSIVE STYLES
   Mobile-first responsive design
   =============================================== */

/* ===== TABLET (max-width: 1024px) ===== */
@media (max-width: 1024px) {
    :root {
        --container-padding: 1.5rem;
        --spacing-3xl: 4rem;
        --spacing-2xl: 3rem;
    }

    .section {
        padding: var(--spacing-2xl) 0;
    }

    /* Hero */
    .hero {
        padding: 8rem 0 6rem;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .hero-content {
        order: 1;
    }

    .hero-visual {
        order: 2;
        max-width: 500px;
        margin: 0 auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-tags {
        justify-content: center;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-image {
        max-width: 400px;
        margin: 0 auto;
    }

    /* Services */
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    /* Qualiopi */
    .qualiopi-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .qualiopi-visual {
        order: 2;
    }

    .qualiopi-content {
        order: 1;
    }

    .qualiopi-image {
        margin: 0 auto;
    }

    /* CPF */
    .cpf-card {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
        text-align: center;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-info {
        text-align: center;
    }

    .contact-social {
        justify-content: center;
    }

    /* Stats (V3) */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Process (V3) */
    .process-timeline {
        flex-wrap: wrap;
        gap: 2rem;
    }

    .process-step {
        flex: 0 0 calc(50% - 1rem);
        min-width: 0;
    }

    .process-connector {
        display: none;
    }
}

/* ===== MOBILE (max-width: 768px) ===== */
@media (max-width: 768px) {
    :root {
        --container-padding: 1rem;
        --spacing-3xl: 3rem;
        --spacing-2xl: 2rem;
        --spacing-xl: 2rem;
    }

    /* Typography */
    .section-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }

    .section-description {
        font-size: 1rem;
    }

    /* Header */
    .nav-container {
        height: 70px;
    }

    .nav-logo img {
        width: 40px;
        height: 40px;
    }

    .nav-brand {
        font-size: 1.125rem;
    }

    .nav-toggle {
        display: flex;
        z-index: 100;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--color-white);
        flex-direction: column;
        gap: 0;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all var(--transition-base);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 1rem;
        text-align: center;
    }

    .btn-nav-contact {
        margin-top: 0.5rem;
        display: block;
        text-align: center;
    }

    /* Hero */
    .hero {
        margin-top: 70px;
        padding: 6rem 0 4rem;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .hero-description {
        font-size: 1.0625rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-tags {
        flex-direction: column;
        align-items: center;
    }

    .hero-tag {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    /* About */
    .about-qualities {
        grid-template-columns: 1fr;
    }

    .about-frame {
        display: none;
    }

    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 1.5rem;
    }

    /* Qualiopi */
    .qualiopi-badge {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    /* CPF */
    .cpf-title {
        font-size: 2rem;
    }

    .cpf-card {
        padding: 1.5rem;
    }

    /* Testimonials — carousel horizontal mobile */
    .testimonials-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
        padding-bottom: 1rem;
        /* Cacher la scrollbar visuellement */
        scrollbar-width: none;
    }
    .testimonials-grid::-webkit-scrollbar { display: none; }
    .testimonials-grid .testimonial-card {
        flex: 0 0 85%;
        scroll-snap-align: start;
        min-width: 0;
    }

    /* Contact */
    .contact-form-wrapper {
        padding: 1.5rem;
    }

    .contact-details {
        align-items: center;
    }

    /* Form row (V3) */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Stats (V3) */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Process (V3) — timeline animée mobile */
    .process-timeline {
        flex-direction: column;
        max-width: 480px;
        margin: 2rem auto 0;
        gap: 1.25rem;
        padding-left: 3.25rem;
        position: relative;
    }

    .process-step {
        position: relative;
        flex-direction: row;
        text-align: left;
        align-items: center;
        padding: 1rem 1.25rem;
        background: var(--color-white);
        border-radius: var(--radius-lg);
        border: 2px solid var(--color-gray-100);
        gap: 1rem;
    }

    /* Numéro d'étape = nœud de la timeline */
    .process-step-number {
        position: absolute;
        left: -2.125rem;
        top: 50%;
        transform: translateY(-50%);
        width: 1.75rem;
        height: 1.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--color-gray-100);
        color: var(--color-gray-400);
        border-radius: 50%;
        font-size: 0.625rem;
        font-weight: 800;
        letter-spacing: 0.05em;
        border: 2px solid var(--color-gray-300);
        z-index: 2;
        margin-bottom: 0;
        writing-mode: initial;
        transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    }

    .process-step.is-visible .process-step-number {
        background: var(--gradient-primary);
        color: var(--color-white);
        border-color: transparent;
        box-shadow: 0 0 0 4px rgba(123, 82, 204, 0.15);
    }

    .process-step--highlight .process-step-number {
        background: var(--gradient-primary);
        color: var(--color-white);
        border-color: transparent;
    }

    .process-step--highlight {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 4px rgba(123, 82, 204, 0.08);
    }

    .process-connector {
        display: none;
    }

    .process-step-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1rem;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .process-step-content {
        flex: 1;
    }

    /* Animation slide-from-left pour les étapes */
    .process-timeline .process-step[data-animate="fade-up"] {
        opacity: 0;
        transform: translateX(-40px);
        transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .process-timeline .process-step[data-animate="fade-up"].is-visible {
        opacity: 1;
        transform: translateX(0);
    }

    /* Délais en cascade : 1 → 2 → 3 → 4 → 5 */
    .process-timeline .process-step:nth-child(1) { transition-delay: 0ms; }
    .process-timeline .process-step:nth-child(2) { transition-delay: 180ms; }
    .process-timeline .process-step:nth-child(3) { transition-delay: 360ms; }
    .process-timeline .process-step:nth-child(4) { transition-delay: 540ms; }
    .process-timeline .process-step:nth-child(5) { transition-delay: 720ms; }

    /* Hero stats (V3) */
    .hero-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .hero-floating-badge {
        position: static;
        display: inline-flex;
        align-self: flex-start;
        animation: none;
        box-shadow: 0 2px 12px rgba(0,0,0,0.1);
        margin-top: 1rem;
    }

    /* About badge (V3) */
    .about-badge {
        right: 0;
        top: 1rem;
        font-size: 0.75rem;
    }

    /* Toast */
    .toast {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    /* Buttons */
    .btn-large {
        padding: 1rem 1.75rem;
        font-size: 1rem;
    }

    /* Floating CTA (V3) */
    .floating-cta {
        display: flex;
    }
}

/* ===== SMALL MOBILE (max-width: 480px) ===== */
@media (max-width: 480px) {
    :root {
        --container-padding: 1rem;
        font-size: 15px;
    }

    .hero-title {
        font-size: 1.875rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .cpf-title {
        font-size: 1.75rem;
    }

    .service-icon {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1.5rem;
    }

    .quality-icon,
    .contact-detail-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9375rem;
    }

    .btn-large {
        padding: 0.875rem 1.5rem;
    }

    /* Stats (V3) */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    /* Hero stats (V3) */
    .hero-stats {
        display: none;
    }

    /* FAQ (V3) */
    .faq-question {
        font-size: 0.9375rem;
        padding: 1rem;
    }

    .faq-answer {
        padding: 0 1rem 1rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .header,
    .nav-toggle,
    .hero-actions,
    .contact-form-wrapper,
    .toast,
    .floating-cta,
    .back-to-top,
    .scroll-progress {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    .section {
        page-break-inside: avoid;
        padding: 1rem 0;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    img {
        max-width: 100%;
        page-break-inside: avoid;
    }
}

/* ===== ACCESSIBILITY ===== */
@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 {
        --color-gray-200: #999;
        --color-gray-300: #888;
        --color-gray-400: #666;
    }

    .btn {
        border-width: 3px;
    }

    .nav-link::after {
        height: 3px;
    }
}

/* ===== DARK MODE SUPPORT (Optional) ===== */
@media (prefers-color-scheme: dark) {
    /* Vous pouvez activer le mode sombre si souhaité
    :root {
        --color-white: #0F172A;
        --color-light: #1E293B;
        --color-gray-900: #F8F9FC;
        --color-gray-800: #E2E8F0;
        --color-gray-700: #CBD5E1;
    }
    */
}