/* ========================================
   RESPONSIVE DESIGN - MEDIA QUERIES
   ======================================== */

/* Tablets & Small Desktops (max-width: 1024px) */
@media (max-width: 1024px) {
    :root {
        --text-5xl: 2.5rem;
        --text-4xl: 2rem;
        --text-3xl: 1.75rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }

    .hero-text {
        text-align: center;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-image {
        order: -1;
    }

    .tarification-container {
        grid-template-columns: 1fr;
    }

    .tarification-sidebar {
        padding: var(--space-6);
    }

    .progress-tracker {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
        margin-bottom: var(--space-8);
    }

    .progress-bar-container {
        grid-column: 1 / -1;
    }

    .contact-container {
        grid-template-columns: 1fr;
    }

    .contact-info {
        text-align: center;
    }

    .contact-method {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

/* Tablets (max-width: 768px) */
@media (max-width: 768px) {
    :root {
        --text-5xl: 2rem;
        --text-4xl: 1.75rem;
        --text-3xl: 1.5rem;
        --text-2xl: 1.25rem;
        --space-20: 3rem;
        --space-16: 2.5rem;
        --space-12: 2rem;
    }

    .container {
        padding: 0 var(--space-4);
    }

    /* Navigation */
    .navbar {
        position: relative;
    }

    .nav-toggle {
        display: flex;
        z-index: 1001;
    }

    .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: 80px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: white;
        padding: var(--space-6);
        box-shadow: var(--shadow-lg);
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        gap: var(--space-4);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        margin-left: 0;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-link {
        padding: var(--space-3) var(--space-4);
        border-radius: var(--radius-lg);
    }

    .nav-link:hover {
        background: var(--primary-50);
    }

    .nav-link::after {
        display: none;
    }

    .btn-nav {
        width: 100%;
        justify-content: center;
    }

    /* Hero Section */
    .hero {
        min-height: auto;
        padding: var(--space-16) 0 var(--space-12);
    }

    .hero-title {
        font-size: var(--text-4xl);
    }

    .hero-subtitle {
        font-size: var(--text-lg);
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--space-4);
        align-items: flex-start;
    }

    .hero-card {
        max-width: 100%;
    }

    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    /* Avantages Grid */
    .avantages-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    /* Process Timeline */
    .process-timeline {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .process-cta {
        margin-top: 80px;
        margin-bottom: var(--space-12);
    }

    /* Tarification Form */
    .tarification-form-container {
        padding: var(--space-6);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .insurance-selector {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .progress-tracker {
        grid-template-columns: 1fr;
    }

    /* Partenaires */
    .partenaires-logos {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: var(--space-4);
    }

    /* Témoignages */
    .temoignages-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    /* Contact */
    .contact-methods {
        margin-bottom: var(--space-8);
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        text-align: center;
    }

    .footer-column ul {
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .footer-certifications {
        flex-direction: column;
        gap: var(--space-3);
    }

    /* Scroll to top button */
    .scroll-top {
        bottom: var(--space-6);
        right: var(--space-6);
        width: 45px;
        height: 45px;
    }

    /* Protection Sociale Section */
    .protection-intro {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .protection-stats {
        grid-template-columns: 1fr;
    }

    .visual-circle {
        width: 150px;
        height: 150px;
    }

    .visual-circle i {
        font-size: 3.5rem;
    }

    .protection-products {
        grid-template-columns: 1fr;
    }

    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .protection-cta {
        flex-direction: column;
        text-align: center;
    }

    .cta-content {
        flex-direction: column;
        text-align: center;
    }

    .cta-actions {
        flex-direction: column;
        width: 100%;
    }

    .cta-actions .btn {
        width: 100%;
    }

    /* Assurance TNS */
    .publics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tns-produits-grid {
        grid-template-columns: 1fr;
    }

    .madelin-avantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .exemple-box {
        grid-template-columns: 1fr;
    }

    .comparison-table-container {
        overflow-x: scroll;
    }

    .comparison-table {
        min-width: 800px;
    }

    .tns-cta {
        padding: var(--space-6);
    }

    .cta-content-tns {
        flex-direction: column;
        text-align: center;
    }

    /* Assurance Emprunteur */
    .emprunteur-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .dispositifs-grid {
        grid-template-columns: 1fr;
    }

    .example-comparison {
        flex-direction: column;
        gap: var(--space-4);
    }

    .comparison-arrow {
        transform: rotate(90deg);
    }

    .process-steps-horizontal {
        flex-direction: column;
        gap: var(--space-8);
    }

    .process-arrow-h {
        transform: rotate(90deg);
    }

    .step-number-h {
        top: -15px;
    }

    .emprunteur-cta {
        padding: var(--space-6);
    }

    .cta-content-large {
        flex-direction: column;
        text-align: center;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
    :root {
        --text-5xl: 1.75rem;
        --text-4xl: 1.5rem;
        --text-3xl: 1.25rem;
        --text-2xl: 1.125rem;
        --text-xl: 1.125rem;
        --text-lg: 1rem;
        --space-20: 2.5rem;
        --space-16: 2rem;
        --space-12: 1.5rem;
        --space-10: 1.25rem;
        --space-8: 1rem;
    }

    .container {
        padding: 0 var(--space-3);
    }

    /* Navigation */
    .navbar {
        height: 85px;
    }

    .header {
        top: 0;
    }

    .hero {
        margin-top: 85px;
    }

    .logo {
        height: 50px;
        max-width: 280px;
    }

    .logo-text {
        font-size: var(--text-lg);
    }

    /* Hero */
    .hero-badge {
        font-size: var(--text-xs);
        padding: var(--space-1) var(--space-3);
    }

    .hero-title {
        font-size: var(--text-3xl);
        margin-bottom: var(--space-4);
    }

    .hero-subtitle {
        font-size: var(--text-base);
        margin-bottom: var(--space-6);
    }

    .stat-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--space-2);
    }

    .stat-item i {
        font-size: var(--text-2xl);
    }

    .stat-item strong {
        font-size: var(--text-xl);
    }

    .hero-card {
        padding: var(--space-6);
    }

    .card-header {
        flex-direction: column;
        text-align: center;
        gap: var(--space-2);
    }

    .card-header i {
        font-size: var(--text-xl);
    }

    .pricing-preview h2 {
        font-size: var(--text-3xl);
    }

    /* Section Headers */
    .section-badge {
        font-size: var(--text-xs);
    }

    .section-title {
        font-size: var(--text-2xl);
    }

    .section-subtitle {
        font-size: var(--text-base);
    }

    /* Service Cards */
    .service-card {
        padding: var(--space-6);
    }

    .service-icon {
        width: 56px;
        height: 56px;
        font-size: var(--text-xl);
    }

    .featured-badge {
        font-size: 0.7rem;
        padding: var(--space-1) var(--space-2);
    }

    /* Avantage Cards */
    .avantage-card {
        padding: var(--space-6);
    }

    .avantage-icon {
        width: 64px;
        height: 64px;
        font-size: var(--text-2xl);
        margin-bottom: var(--space-4);
    }

    /* Process */
    .step-number {
        width: 50px;
        height: 50px;
        font-size: var(--text-xl);
        margin-bottom: var(--space-4);
    }

    .step-content {
        padding: var(--space-4);
    }

    .step-icon {
        width: 40px;
        height: 40px;
        font-size: var(--text-lg);
    }

    /* Tarification */
    .tarification-sidebar {
        padding: var(--space-4);
    }

    .tarification-form-container {
        padding: var(--space-4);
    }

    .form-step-title {
        font-size: var(--text-xl);
        margin-bottom: var(--space-6);
    }

    .form-step-title i {
        font-size: var(--text-xl);
    }

    .progress-step {
        padding: var(--space-3);
    }

    .step-circle {
        width: 40px;
        height: 40px;
    }

    .step-circle i {
        font-size: var(--text-lg);
    }

    .step-info strong {
        font-size: var(--text-sm);
    }

    /* Protection Sociale Mobile */
    .protection-intro {
        padding: var(--space-6);
    }

    .intro-text h3 {
        font-size: var(--text-xl);
    }

    .protection-stats {
        grid-template-columns: 1fr;
    }

    .stat-box {
        flex-direction: column;
        text-align: center;
    }

    .visual-circle {
        width: 120px;
        height: 120px;
    }

    .visual-circle i {
        font-size: 3rem;
    }

    .product-card {
        padding: var(--space-6);
    }

    .product-icon {
        width: 64px;
        height: 64px;
    }

    .product-icon i {
        font-size: 2rem;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .benefit-item i {
        font-size: 2rem;
    }

    .protection-cta {
        padding: var(--space-6);
    }

    .cta-content i {
        font-size: 3rem;
    }

    .cta-content h3 {
        font-size: var(--text-xl);
    }

    /* Assurance TNS Mobile */
    .intro-alert {
        flex-direction: column;
        padding: var(--space-6);
    }

    .intro-alert i {
        font-size: 2rem;
    }

    .publics-grid {
        grid-template-columns: 1fr;
    }

    .public-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }

    .tns-card {
        padding: var(--space-6);
    }

    .tns-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }

    .madelin-explication {
        flex-direction: column;
        padding: var(--space-6);
    }

    .madelin-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }

    .madelin-avantages-grid {
        grid-template-columns: 1fr;
    }

    .madelin-card-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

    .madelin-exemple {
        padding: var(--space-6);
    }

    .comparison-table th,
    .comparison-table td {
        padding: var(--space-3);
        font-size: var(--text-sm);
    }

    .cta-content-tns i {
        font-size: 3rem;
    }

    .cta-content-tns h3 {
        font-size: var(--text-2xl);
    }

    /* Assurance Emprunteur Mobile */
    .intro-highlight {
        flex-direction: column;
        padding: var(--space-6);
    }

    .intro-highlight i {
        font-size: 2rem;
    }

    .intro-highlight h3 {
        font-size: var(--text-xl);
    }

    .benefit-icon {
        width: 48px;
        height: 48px;
        font-size: var(--text-xl);
    }

    .example-card {
        padding: var(--space-6);
    }

    .example-header i {
        font-size: 2rem;
    }

    .comparison-item .price {
        font-size: var(--text-3xl);
    }

    .example-savings i {
        font-size: 2rem;
    }

    .example-savings strong {
        font-size: var(--text-xl);
    }

    .dispositif-card {
        padding: var(--space-6);
    }

    .dispositif-icon {
        width: 48px;
        height: 48px;
        font-size: var(--text-2xl);
    }

    .dispositif-header h4 {
        font-size: var(--text-xl);
    }

    .step-icon-h {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .step-number-h {
        width: 35px;
        height: 35px;
        font-size: var(--text-base);
    }

    .process-step-h h4 {
        font-size: var(--text-lg);
    }

    .cta-content-large i {
        font-size: 3rem;
    }

    .cta-content-large h3 {
        font-size: var(--text-2xl);
    }

    .faq-question i {
        font-size: var(--text-xl);
    }

    .step-info span {
        font-size: 0.7rem;
    }

    .trust-item {
        font-size: var(--text-xs);
    }

    .card-icon {
        width: 50px;
        height: 50px;
        font-size: var(--text-xl);
    }

    .card-title {
        font-size: var(--text-sm);
    }

    .card-desc {
        font-size: 0.7rem;
    }

    .card-price {
        font-size: var(--text-xs);
    }

    /* Loading State */
    .loader {
        width: 60px;
        height: 60px;
        border-width: 4px;
    }

    .loading-state h3 {
        font-size: var(--text-xl);
    }

    .loading-step {
        padding: var(--space-3);
        font-size: var(--text-sm);
    }

    .spinner {
        width: 16px;
        height: 16px;
    }

    /* Result State */
    .success-icon {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }

    .result-header h3 {
        font-size: var(--text-2xl);
    }

    .result-header p {
        font-size: var(--text-base);
    }

    .devis-summary {
        padding: var(--space-6);
    }

    .next-steps {
        padding: var(--space-4);
    }

    /* Partenaires */
    .partenaires-logos {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .partner-logo {
        padding: var(--space-4);
        font-size: var(--text-sm);
    }

    .certification-badge {
        padding: var(--space-6);
    }

    .badge-content {
        flex-direction: column;
        text-align: center;
        gap: var(--space-4);
    }

    .badge-content i {
        font-size: 3rem;
    }

    .badge-content strong {
        font-size: var(--text-lg);
    }

    /* Témoignages */
    .temoignage-card {
        padding: var(--space-6);
    }

    .author-avatar {
        width: 40px;
        height: 40px;
        font-size: var(--text-xs);
    }

    /* Contact */
    .contact-info h2 {
        font-size: var(--text-2xl);
    }

    .contact-info > p {
        font-size: var(--text-base);
    }

    .contact-method strong {
        font-size: var(--text-base);
    }

    .method-icon {
        width: 40px;
        height: 40px;
        font-size: var(--text-lg);
    }

    .social-links a {
        width: 40px;
        height: 40px;
        font-size: var(--text-lg);
    }

    .contact-form-wrapper {
        padding: var(--space-6);
    }

    .contact-form h3 {
        font-size: var(--text-xl);
        margin-bottom: var(--space-6);
    }

    /* Footer */
    .footer {
        padding: var(--space-12) 0 var(--space-4);
    }

    .footer-content {
        gap: var(--space-6);
    }

    .footer-column h4 {
        font-size: var(--text-base);
        margin-bottom: var(--space-4);
    }

    .footer-column p,
    .footer-column ul li {
        font-size: var(--text-sm);
    }

    /* Buttons */
    .btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-sm);
    }

    .btn-lg {
        padding: var(--space-3) var(--space-6);
        font-size: var(--text-base);
    }

    .btn i {
        font-size: var(--text-sm);
    }
}

/* Very Small Devices (max-width: 360px) */
@media (max-width: 360px) {
    :root {
        --text-5xl: 1.5rem;
        --text-4xl: 1.25rem;
        --text-3xl: 1.125rem;
    }

    .container {
        padding: 0 var(--space-2);
    }

    .hero-cta .btn-lg {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
    }

    .hero-stats {
        gap: var(--space-3);
    }

    .stat-item strong {
        font-size: var(--text-lg);
    }

    .service-card,
    .avantage-card,
    .temoignage-card {
        padding: var(--space-4);
    }

    .tarification-form-container,
    .tarification-sidebar {
        padding: var(--space-3);
    }

    .form-group {
        margin-bottom: var(--space-4);
    }

    .form-actions {
        padding-top: var(--space-6);
        margin-top: var(--space-6);
    }
}

/* Print Styles */
@media print {
    .header,
    .nav-toggle,
    .hero-cta,
    .btn,
    .scroll-top,
    .tarification-sidebar,
    .form-actions {
        display: none !important;
    }

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

    .section {
        page-break-inside: avoid;
        padding: 1cm 0;
    }

    .hero {
        min-height: auto;
        page-break-after: always;
    }

    a {
        text-decoration: underline;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-600: #0000EE;
        --gray-600: #000000;
    }

    .btn-primary {
        border: 2px solid #000000;
    }

    .nav-link::after {
        height: 3px;
    }
}

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

    .hero-card {
        animation: none;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment if dark mode support is needed */
    /*
    :root {
        --gray-50: #1F2937;
        --gray-100: #111827;
        --gray-900: #F9FAFB;
    }

    body {
        background-color: #111827;
        color: #F9FAFB;
    }
    */
}

/* Landscape Mode Adjustments for Small Devices */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-12) 0;
    }

    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }

    .hero-image {
        order: 2;
    }

    .hero-card {
        padding: var(--space-6);
    }

    .section {
        padding: var(--space-12) 0;
    }
}