/**
 * Responsive CSS - Prêt Denis
 * Adaptation mobile et tablette
 */

/* ========================================
   TABLETTE (Max 1024px)
   ======================================== */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    .row {
        gap: var(--spacing-sm);
    }
}

/* ========================================
   MOBILE (Max 768px)
   ======================================== */
@media screen and (max-width: 768px) {
    
    /* Header */
    .header-top .container {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
    }
    
    .header-contact {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .header-main .container {
        position: relative;
    }
    
    /* Menu mobile - SOLUTION FORCÉE */
    .menu-toggle {
        display: flex !important;
    }
    
    body nav#main-nav {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background-color: #ffffff !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.3s ease !important;
        z-index: 1000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body nav#main-nav.active {
        max-height: 600px !important;
        overflow-y: auto !important;
    }
    
    body nav#main-nav ul {
        flex-direction: column !important;
        gap: 0 !important;
        padding: 1rem 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }
    
    body nav#main-nav ul li {
        width: 100% !important;
        text-align: center !important;
        border-bottom: 1px solid #e2e8f0 !important;
        margin: 0 !important;
    }
    
    body nav#main-nav ul li:last-child {
        border-bottom: none !important;
    }
    
    body nav#main-nav ul li a {
        display: block !important;
        padding: 1rem !important;
        width: 100% !important;
    }
    
    body nav#main-nav ul li a.btn-demande {
        margin: 1rem !important;
        width: calc(100% - 2rem) !important;
        display: inline-block !important;
    }
    
    .btn-demande {
        margin: var(--spacing-sm);
    }
    
    /* Animation menu toggle */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Sections */
    section {
        padding: var(--spacing-md) 0;
    }
    
    /* Grille responsive */
    .row {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        grid-column: span 12;
    }
    
    /* Cards */
    .card {
        padding: var(--spacing-sm);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* Boutons */
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Titres */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
    
    .section-title p {
        font-size: 1rem;
    }
    
    /* Formulaires */
    .form-group {
        margin-bottom: var(--spacing-sm);
    }
    
    .form-control {
        font-size: 16px; /* Éviter le zoom sur iOS */
    }
    
    /* Scroll to top button */
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* ========================================
   PETIT MOBILE (Max 480px)
   ======================================== */
@media screen and (max-width: 480px) {
    :root {
        --spacing-md: 1.5rem;
        --spacing-lg: 2rem;
        --spacing-xl: 2.5rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    
    .section-title h2 {
        font-size: 1.5rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.675rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    /* Footer texte plus petit */
    footer {
        font-size: 0.875rem;
    }
    
    .footer-section h4 {
        font-size: 1rem;
    }
    
    /* Header contact */
    .header-top {
        font-size: 0.8125rem;
    }
    
    .header-contact a {
        margin-right: 0;
    }
}

/* ========================================
   RESPONSIVE PAGE D'ACCUEIL
   ======================================== */

/* Tablette (Max 1024px) */
@media screen and (max-width: 1024px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .about-wrapper {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .about-badge {
        bottom: 10px;
        right: 10px;
    }
    
    .simulation-wrapper {
        grid-template-columns: 1fr;
    }
    
    .process-step {
        grid-template-columns: 60px 1fr;
        gap: var(--spacing-sm);
    }
    
    .step-number {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Mobile (Max 768px) */
@media screen and (max-width: 768px) {
    .hero-section {
        min-height: auto;
        padding: var(--spacing-lg) 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .about-wrapper {
        gap: var(--spacing-md);
    }
    
    .about-values {
        grid-template-columns: 1fr;
    }
    
    .simulation-wrapper {
        gap: var(--spacing-md);
    }
    
    .credit-types-grid {
        grid-template-columns: 1fr;
    }
    
    .credit-types-grid-8 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
    }
    
    .bento-large,
    .bento-wide {
        grid-column: span 2;
    }
    
    .bento-tall {
        grid-row: span 1;
    }
    
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    
    .bento-large,
    .bento-wide,
    .bento-tall {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .bento-item {
        min-height: 150px;
    }
    
    .benefit-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .process-step {
        grid-template-columns: 50px 1fr;
        margin-bottom: var(--spacing-md);
    }
    
    .process-step:not(:last-child)::after {
        left: 25px;
        top: 50px;
        bottom: -40px;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .step-icon {
        width: 60px;
        height: 60px;
    }
    
    .cta-banner {
        background-attachment: scroll;
    }
    
    .cta-content h2 {
        font-size: 1.75rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
}

/* Petit Mobile (Max 480px) */
@media screen and (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.9375rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.8125rem;
    }
    
    .section-title h2 {
        font-size: 1.5rem;
    }
    
    .section-title p {
        font-size: 0.9375rem;
    }
    
    .feature-card h3,
    .credit-type-card h3 {
        font-size: 1rem;
    }
    
    .about-badge {
        position: static;
        margin-top: var(--spacing-sm);
        display: inline-block;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .credit-types-grid-8 {
        grid-template-columns: 1fr;
    }
    
    .credit-type-icon-modern {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .bento-grid {
        gap: var(--spacing-xs);
    }
    
    /* Page À Propos mobile */
    .about-hero-content h1 {
        font-size: 2rem;
    }
    
    .about-hero-content p {
        font-size: 1rem;
    }
    
    .intro-text h2,
    .why-choose-content h2,
    .cta-box h2 {
        font-size: 1.5rem;
    }
    
    .numbers-grid,
    .commitments-grid,
    .team-values {
        grid-template-columns: 1fr;
    }
    
    .number-value {
        font-size: 2.5rem;
    }
    
    .number-icon {
        font-size: 2rem;
    }
    
    .cta-box h2 {
        font-size: 1.75rem;
    }
    
    .cta-box p {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
    
    .process-timeline {
        padding: 0;
    }
    
    .process-step {
        grid-template-columns: 40px 1fr;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .process-step:not(:last-child)::after {
        left: 20px;
        top: 40px;
    }
    
    .step-icon {
        width: 50px;
        height: 50px;
    }
    
    .step-content {
        padding: var(--spacing-sm);
    }
    
    .cta-content h2 {
        font-size: 1.5rem;
    }
    
    .faq-question h4 {
        font-size: 1rem;
    }
    
    /* Pages légales responsive */
    .legal-layout {
        grid-template-columns: 1fr;
    }
    
    .legal-sidebar {
        position: static;
        order: 2;
        margin-top: var(--spacing-md);
    }
    
    .legal-main {
        order: 1;
        padding: var(--spacing-md);
    }
    
    .page-hero-content h1 {
        font-size: 1.75rem;
    }
    
    .legal-section h2 {
        font-size: 1.5rem;
    }
    
    /* Page À Propos responsive */
    .intro-content,
    .mission-wrapper,
    .why-choose-wrapper {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .intro-badge {
        position: static;
        margin-top: var(--spacing-sm);
        display: inline-block;
    }
    
    .numbers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .commitments-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .team-values {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   MODE PAYSAGE MOBILE
   ======================================== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    nav.active {
        max-height: 300px;
        overflow-y: auto;
    }
    
    section {
        padding: var(--spacing-sm) 0;
    }
}

/* ========================================
   IMPRESSION
   ======================================== */
@media print {
    header, footer, .btn, .menu-toggle, .scroll-to-top, nav {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* ========================================
   ACCESSIBILITÉ
   ======================================== */

/* Mode sombre (préférence système) */
@media (prefers-color-scheme: dark) {
    /* Optionnel: Ajouter un thème sombre si souhaité */
}

/* Réduction des animations (préférence système) */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus visible pour la navigation au clavier */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* ========================================
   GRILLE RESPONSIVE AVANCÉE
   ======================================== */

/* Tablette */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .col-md-1 { grid-column: span 1; }
    .col-md-2 { grid-column: span 2; }
    .col-md-3 { grid-column: span 3; }
    .col-md-4 { grid-column: span 4; }
    .col-md-5 { grid-column: span 5; }
    .col-md-6 { grid-column: span 6; }
    .col-md-7 { grid-column: span 7; }
    .col-md-8 { grid-column: span 8; }
    .col-md-9 { grid-column: span 9; }
    .col-md-10 { grid-column: span 10; }
    .col-md-11 { grid-column: span 11; }
    .col-md-12 { grid-column: span 12; }
}

/* Desktop */
@media screen and (min-width: 1025px) {
    .col-lg-1 { grid-column: span 1; }
    .col-lg-2 { grid-column: span 2; }
    .col-lg-3 { grid-column: span 3; }
    .col-lg-4 { grid-column: span 4; }
    .col-lg-5 { grid-column: span 5; }
    .col-lg-6 { grid-column: span 6; }
    .col-lg-7 { grid-column: span 7; }
    .col-lg-8 { grid-column: span 8; }
    .col-lg-9 { grid-column: span 9; }
    .col-lg-10 { grid-column: span 10; }
    .col-lg-11 { grid-column: span 11; }
    .col-lg-12 { grid-column: span 12; }
}

/* ========================================
   UTILITAIRES RESPONSIVE
   ======================================== */

/* Cacher sur mobile */
@media screen and (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Cacher sur tablette */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Cacher sur desktop */
@media screen and (min-width: 1025px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Afficher uniquement sur mobile */
@media screen and (min-width: 769px) {
    .show-mobile-only {
        display: none !important;
    }
}