/* ============================================
   LAYOUT - Navigation et Sections principales
   ============================================ */

/* === CORRECTION GLOBALE: Forcer 100% largeur === */
html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* === NAVIGATION === */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid var(--neutral-200);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-link {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 16px;
    color: var(--neutral-700);
    text-decoration: none;
    position: relative;
    transition: var(--transition);
    padding: 8px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-cta {
    background: var(--gradient-secondary);
    color: var(--white) !important;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.nav-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
}

.language-selector:hover {
    background: var(--neutral-100);
    color: var(--primary-color);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    margin-top: 8px;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
}

.language-option:hover {
    background: var(--neutral-100);
    color: var(--primary-color);
}

.flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 3px;
    box-shadow: var(--shadow-sm);
}

.client-portal {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--neutral-700);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: 8px;
}

.client-portal:hover {
    color: var(--primary-color);
    background: var(--neutral-100);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    padding: 8px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--neutral-700);
    transition: var(--transition);
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

/* Éléments mobiles cachés par défaut */
.mobile-language-selector,
.mobile-portal-link {
    display: none;
}

/* ============================================
   HERO SECTION - RESPONSIVE OPTIMISÉ + FULL WIDTH
   ============================================ */

.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(100px, 15vh, 150px) 0 clamp(80px, 12vh, 120px);
    overflow: hidden;
    transition: background 0.5s ease;
    position: relative;
    /* CORRECTION: Forcer le hero à prendre 100% de la largeur */
    width: 100vw;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

.hero-container {
    max-width: 1400px;
    width: 90%;
    margin: 0 auto;
    padding: 0 clamp(30px, 3vw, 40px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(60px, 8vw, 120px);
    align-items: center;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

.hero-content { 
    animation: fadeInLeft 1.2s ease-out;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 3vh, 2.5rem);
}

.hero-title {
    /* Desktop: 2rem (32px) - Typographie responsive optimisée */
    font-size: clamp(1.5rem, 4vw + 0.5rem, 2rem);
    font-weight: 700;
    color: var(--neutral-900);
    line-height: 1.2;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity 0.3s ease;
    margin: 0;
}

.hero-subtitle {
    /* Desktop: 1.25rem (20px) */
    font-size: clamp(0.95rem, 1.5vw + 0.5rem, 1.25rem);
    color: var(--neutral-600);
    transition: opacity 0.3s ease;
    margin: 0;
    line-height: 1.5;
}

.hero-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInRight 1.2s ease-out;
}

.hero-illustration {
    width: clamp(240px, 35vw, 350px);
    height: clamp(240px, 35vw, 350px);
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(100px, 15vw, 150px);
    color: var(--white);
    box-shadow: var(--shadow-xl);
    animation: pulse 6s ease-in-out infinite;
    border: 4px solid var(--white);
}

.hero-illustration i {
    transition: opacity 0.3s ease;
}

.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.float-element {
    position: absolute;
    width: clamp(50px, 8vw, 70px);
    height: clamp(50px, 8vw, 70px);
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(20px, 3vw, 28px);
    box-shadow: var(--shadow-lg);
    animation: float 4s ease-in-out infinite;
    border: 2px solid var(--neutral-200);
}

.float-1 { top: 15%; left: 5%; animation-delay: 0s; color: var(--secondary-color); }
.float-2 { top: 65%; right: 15%; animation-delay: 1.5s; color: var(--accent-color); }
.float-3 { bottom: 15%; left: 15%; animation-delay: 3s; color: var(--success-color); }

/* === PAGINATION DOTS === */
.pagination-dots {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 100;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero:hover .pagination-dots {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.hero.paused .pagination-dots {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary-light);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}

.pagination-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--neutral-300);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
}

.pagination-dots .dot:hover {
    background: var(--primary-light);
    transform: scale(1.2);
    border-color: var(--primary-light);
}

.pagination-dots .dot.active {
    background: var(--primary-color);
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.2);
    border-color: var(--primary-color);
}

.pagination-dots .dot.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0;
    animation: dotPulse 2s ease-out infinite;
}

@keyframes dotPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

.pagination-dots .dot:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.3);
}

/* Curseur pour le swipe */
.hero {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.hero:active {
    cursor: grabbing;
}

.hero.simulation-active {
    cursor: default;
}

/* Assombrir légèrement au hover */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.hero:hover::before {
    background: rgba(0, 0, 0, 0.02);
}

/* === SECTIONS GÉNÉRALES === */
.offers, .vision { padding: 120px 0; background: var(--white); }
.how-it-works, .testimonials, .advice { padding: 120px 0; background: var(--gradient-bg); }
.explanation { padding: 120px 0; background: var(--white); }

/* === FOOTER === */
.footer {
    background: var(--neutral-900);
    color: var(--white);
    padding: 100px 0 40px;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 80px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--neutral-300);
    padding: 12px 16px;
    transition: var(--transition);
    border-radius: 8px;
    font-weight: 500;
}

.footer-nav a:hover {
    color: var(--white);
    background: var(--neutral-800);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 80px;
}

.footer-logo { display: flex; align-items: center; gap: 12px; }

/* Logo cliquable dans le footer */
.footer-logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.footer-logo-link:hover {
    transform: scale(1.02);
}

.footer-logo-link .logo-text {
    text-align: left;
}

/* Newsletter améliorée */
.newsletter {
    position: relative;
}

.newsletter-form {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.newsletter-form input {
    width: 200px;
    height: 50px;
    padding: 0 20px;
    border: 2px solid var(--neutral-700);
    background: var(--white);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.newsletter-form input:focus {
    border-color: var(--primary-color);
}

.newsletter-form input.success {
    border-color: var(--success-color);
    background: #ECFDF5;
}

.newsletter-form input.error {
    border-color: var(--error-color);
    background: #FEF2F2;
}

.newsletter-form button {
    width: 60px;
    height: 50px;
    background: var(--gradient-primary);
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.newsletter-form button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.newsletter-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Message de feedback newsletter */
.newsletter-feedback {
    position: absolute;
    bottom: -28px;
    left: 0;
    right: 0;
    font-size: 12px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.newsletter-feedback.show {
    opacity: 1;
}

.newsletter-feedback.success {
    color: var(--success-color);
}

.newsletter-feedback.error {
    color: var(--error-color);
}

.footer-bottom {
    border-top: 1px solid var(--neutral-700);
    padding-top: 30px;
    text-align: center;
}

.copyright {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--neutral-400);
}

/* ============================================
   RESPONSIVE - TABLETTE (769px - 1024px)
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero {
        padding: 140px 0 120px;
        min-height: auto;
    }

    .hero-container {
        width: 90%;
        grid-template-columns: 1fr;
        gap: 60px;
        text-align: center;
    }

    .hero-content {
        align-items: center;
    }

    /* Tablette: h1 = 2rem (32px) */
    .hero-title {
        font-size: 2rem;
        max-width: 700px;
    }

    /* Tablette: subtitle = 1.125rem (18px) */
    .hero-subtitle {
        font-size: 1.125rem;
        max-width: 600px;
    }

    .pagination-dots {
        bottom: 30px;
    }

    .nav-container {
        padding: 0 20px;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .nav-link {
        font-size: 14px;
    }
    
    .nav-cta {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .nav-right {
        gap: 16px;
    }
    
    .language-selector {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .language-selector span {
        display: none;
    }
    
    .client-portal span {
        display: none;
    }
    
    .client-portal {
        padding: 8px;
    }
    
    .logo-text {
        font-size: 14px;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .floating-elements {
        display: none;
    }
}

/* ============================================
   RESPONSIVE - TABLETTE & MOBILE (≤768px)
   ============================================ */
@media (max-width: 768px) {
    .hero {
        padding: 130px 0 110px;
        min-height: auto;
    }

    .hero-container {
        width: 95%;
        grid-template-columns: 1fr;
        gap: 50px;
        text-align: center;
        padding: 0 15px;
    }

    .hero-content {
        align-items: center;
    }

    /* Mobile: h1 = 1.75rem (28px) */
    .hero-title {
        font-size: 1.6rem;
    }

    /* Mobile: subtitle = 1rem (16px) */
    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-illustration {
        width: clamp(220px, 60vw, 280px);
        height: clamp(220px, 60vw, 280px);
        font-size: clamp(90px, 25vw, 120px);
    }

    .pagination-dots {
        bottom: 20px;
        padding: 10px 20px;
        gap: 10px;
    }

    .pagination-dots .dot {
        width: 10px;
        height: 10px;
    }

    .pagination-dots .dot.active {
        transform: scale(1.25);
    }

    .floating-elements {
        display: none;
    }

    .nav-menu {
        position: fixed;
        top: 72px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 72px);
        background: var(--white);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 0;
        transition: var(--transition);
        box-shadow: var(--shadow-xl);
        gap: 0;
        overflow-y: auto;
    }
    
    .nav-menu.active { 
        left: 0; 
    }
    
    .nav-link {
        width: 100%;
        padding: 16px 20px;
        border-bottom: 1px solid var(--neutral-100);
        font-size: 16px;
        text-align: center;
        order: 0;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .nav-cta {
        width: auto;
        margin: 20px 0;
        justify-content: center;
        padding: 14px 32px;
        order: 10;
    }
    
    .nav-right {
        display: none;
    }
    
    .mobile-language-selector,
    .mobile-portal-link {
        display: flex;
        width: 100%;
        max-width: 400px;
        padding: 16px 20px;
        border-bottom: 1px solid var(--neutral-100);
        align-items: center;
        justify-content: center;
        gap: 12px;
        color: var(--neutral-700);
        font-weight: 500;
        cursor: pointer;
        transition: var(--transition);
        order: 5;
    }
    
    .mobile-language-selector:hover,
    .mobile-portal-link:hover {
        background: var(--neutral-50);
        color: var(--primary-color);
    }
    
    .mobile-language-selector i,
    .mobile-portal-link i {
        font-size: 18px;
    }
    
    .mobile-language-selector {
        flex-direction: column;
        align-items: center;
        padding-bottom: 0;
    }
    
    .mobile-language-header {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        max-width: 400px;
        padding-bottom: 16px;
        justify-content: center;
    }
    
    .mobile-language-header .fa-chevron-down {
        display: none;
    }
    
    .mobile-language-options {
        width: 100%;
        max-width: 400px;
        padding: 0;
        display: none;
        flex-direction: column;
        gap: 8px;
        padding-bottom: 16px;
    }
    
    .mobile-language-options.show {
        display: flex;
    }
    
    .mobile-language-option {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 8px;
        transition: var(--transition);
        cursor: pointer;
    }
    
    .mobile-language-option:hover {
        background: var(--neutral-100);
    }
    
    .hamburger { 
        display: flex; 
    }
    
    .footer-content { 
        flex-direction: column; 
        gap: 40px; 
        text-align: center; 
    }
    
    /* Fix alignement logo sur mobile */
    .footer-logo-link {
        justify-content: center;
    }
    
    .footer-logo-link .logo-text,
    .footer-logo-link .logo-line-2 {
        text-align: left !important;
    }
    
    .footer-nav { 
        flex-direction: column; 
        gap: 20px; 
        align-items: center; 
    }
}

/* ============================================
   RESPONSIVE - MOBILE (≤480px)
   ============================================ */
@media (max-width: 480px) {
    .hero {
        padding: 110px 0 100px;
    }

    .hero-container {
        width: 95%;
        gap: 40px;
        padding: 0 10px;
    }

    /* Petit mobile: h1 = 1rem (16px) */
    .hero-title {
        font-size: 1rem;
        line-height: 1.3;
        margin-top: 20px;
    }

    /* Petit mobile: subtitle = 0.95rem (15px) */
    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-illustration {
        width: 220px;
        height: 220px;
        font-size: 90px;
    }

    .pagination-dots {
        bottom: 20px;
        padding: 8px 16px;
        gap: 8px;
    }

    .pagination-dots .dot {
        width: 8px;
        height: 8px;
    }

    .pagination-dots .dot.active {
        transform: scale(1.2);
    }
    
    .nav-container { 
        padding: 0 15px; 
        height: 64px; 
    }

    .nav-menu {
        top: 64px !important; /* Collé à la navbar */
        height: calc(100vh - 64px) !important;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .logo-line-1 {
        font-size: 16px;
    }
    
    .logo-line-2 {
        font-size: 14px;
    }
}