@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    /* Palette Institutionnelle Banque Privée */
    --primary: #051428;
    /* Bleu Nuit Abyssal */
    --primary-light: #112642;
    --gold: #B68D40;
    /* Or mat profond */
    --gold-hover: #D4A853;
    --gold-light: #F4EEDF;

    --bg: #FFFFFF;
    --surface: #F9FAFB;
    --surface-alt: #F3F4F6;

    --text: #1F2937;
    --text-muted: #4B5563;

    --border: #E5E7EB;

    --shadow: 0 10px 30px rgba(5, 20, 40, 0.06);
    --shadow-hover: 0 20px 40px rgba(5, 20, 40, 0.12);

    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    color: var(--primary);
    font-weight: 600;
    line-height: 1.25;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

p {
    margin-bottom: 20px;
}

img,
svg {
    max-width: 100%;
}


/* --- NAVIGATION --- */
header {
    background: rgba(255, 255, 255, 0.98);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.03);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    height: 90px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 1.3rem;
    border-radius: 1px;
}

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
}

.nav-links a {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
    position: relative;
    padding: 8px 0;
}

/* Hamburger Menu Button */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 10000;
    padding: 10px;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.burger-menu span {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Mobile Menu Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #FFF;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    padding: 40px;
}

.mobile-overlay.active {
    transform: translateY(0);
}

.mobile-overlay .nav-links-mobile {
    list-style: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mobile-overlay .nav-links-mobile a {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    color: var(--primary);
    font-weight: 500;
}

.mobile-overlay .nav-links-mobile a.active {
    color: var(--gold);
}

.burger-menu.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.nav-links a {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    position: relative;
    padding-bottom: 5px;
}

.nav-links-mobile {
    padding: 0;
    margin: 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--gold);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--primary);
}

/* --- BOUTONS --- */
.btn {
    display: inline-block;
    padding: 16px 40px;
    font-weight: 500;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: none;
    text-align: center;
    border-radius: 0;
}

.btn-primary {
    background: var(--primary);
    color: #FFF;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(5, 20, 40, 0.2);
}

.btn-gold {
    background: var(--gold);
    color: #FFF;
}

.btn-gold:hover {
    background: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(182, 141, 64, 0.25);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #FFF;
}

/* --- SECTIONS --- */
main {
    padding-top: 90px;
    min-height: calc(100vh - 300px);
    overflow-x: hidden;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 40px;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 160px 40px 140px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.hero-subtitle {
    font-family: var(--font-sans);
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 30px;
}

.hero h1 {
    font-size: 5rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    margin-bottom: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.1;
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
    line-height: 1.9;
}

/* Hero Variant with Background Media (for home page) */
.hero-visual {
    padding: 200px 40px 180px;
    background: var(--primary);
}

.hero-visual .hero-bg-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-visual .hero-bg-media img,
.hero-visual .hero-bg-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-visual .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(5, 20, 40, 0.8) 0%, rgba(5, 20, 40, 0.5) 100%);
    z-index: 2;
}

.hero-visual .animate-on-scroll {
    position: relative;
    z-index: 5;
}

.hero-visual h1 {
    color: #FFF;
}

.hero-visual p {
    color: rgba(255, 255, 255, 0.8);
}

.hero-visual .hero-subtitle {
    font-size: 0.9rem;
}

.team-video {
    width: 100%;
    height: 750px;
    object-fit: cover;
    display: block;
}

/* --- CARTES & FORMULAIRES --- */
.card {
    background: var(--bg);
    padding: 60px;
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.02);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.section-title {
    text-align: center;
    margin-bottom: 100px;
}

.section-title h2 {
    font-size: 3.5rem;
    font-weight: 400;
    margin-bottom: 24px;
}

.section-title p {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    font-weight: 300;
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    color: var(--primary);
    font-family: var(--font-sans);
}

.form-control {
    width: 100%;
    padding: 18px 20px;
    border: 1px solid var(--border);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
    background: var(--surface);
    border-radius: 4px;
    /* Slight radius for modern feel */
    color: var(--text);
    box-sizing: border-box;
    /* Ensure padding doesn't break width */
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--bg);
    box-shadow: inset 0 0 0 1px var(--gold);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    /* Reduced gap slightly for better fit */
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

/* Update existing media queries and add new ones for better responsiveness */
@media (max-width: 900px) {

    .grid-2,
    .grid-3,
    .grid-4,
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .nav-links {
        display: none;
        /* Can be replaced with a hamburger menu later if needed */
    }

    .hero h1,
    .section-title h2 {
        font-size: 2.5rem !important;
    }

    .logo-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 1rem !important;
    }

    .logo {
        font-size: 1.1rem !important;
        order: 1;
        padding-left: 15px;
        height: 60px;
        display: flex;
        align-items: center;
    }

    .nav-container {
        padding: 0 !important;
        height: auto !important;
        min-height: 60px !important;
        flex-wrap: wrap;
    }

    .nav-container .btn {
        display: flex !important;
        width: auto !important;
        font-size: 0.65rem !important;
        padding: 8px 12px !important;
        margin-left: auto;
        margin-right: 10px;
        order: 2;
    }

    .burger-menu {
        display: flex;
        order: 3;
        padding: 5px 15px 5px 5px;
    }

    .hero {
        padding: 100px 20px 60px;
        text-align: center;
    }

    .hero p {
        font-size: 1.1rem !important;
        padding: 0 10px;
    }

    .container {
        padding: 40px 20px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .card,
    .simulator-box {
        padding: 30px 20px !important;
    }

    /* Make buttons full width on small screens except header button */
    .btn:not(.nav-container .btn) {
        width: 100% !important;
        display: inline-block !important;
        padding: 16px 20px !important;
        font-size: 1rem !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Team Card Override for mobile */
    .team-card {
        bottom: 20px !important;
        left: 20px !important;
        right: 20px !important;
        padding: 20px !important;
    }

    .hero h1,
    .section-title h2,
    h1,
    h2 {
        font-size: 2.2rem !important;
        word-break: break-word;
    }

    h3 {
        font-size: 1.8rem !important;
    }

    .footer-title {
        font-size: 0.75rem !important;
        margin-bottom: 20px !important;
    }

    .footer-logo {
        font-size: 1.5rem !important;
    }

    .footer-legal p,
    .footer-legal {
        line-height: 1.5 !important;
    }

    .team-card-subtitle {
        font-size: 0.7rem !important;
        line-height: 1.5;
    }

    .team-video {
        height: 500px !important;
    }

    /* Adjust specific large elements */
    .result-value {
        font-size: 2.5rem !important;
    }

    .range-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .range-header>div {
        width: 100%;
        justify-content: flex-start;
    }

    .animate-on-scroll {
        opacity: 1 !important;
        transform: translateY(0) !important;
        transition: none !important;
    }

    /* Adjust footer */
    footer {
        padding: 60px 20px 100px !important;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 50px !important;
        padding: 0 !important;
    }

    .footer-bottom {
        flex-direction: column !important;
        text-align: center !important;
        gap: 30px !important;
        padding: 30px 0 0 !important;
        margin-top: 40px !important;
    }

    .footer-legal {
        padding: 0 0 30px 0 !important;
        text-align: left;
        font-size: 0.7rem;
    }

    .footer-disclaimer {
        font-size: 0.85rem !important;
        padding: 0 !important;
        line-height: 1.5;
    }

    div[style*="font-size: 4rem"],
    div[style*="font-size: 3.5rem"] {
        font-size: 2.5rem !important;
    }

    /* Ajustement de la taille des boutons de la page d'accueil (Hero) */
    .hero div[style*="display: flex"] {
        flex-direction: column;
        gap: 15px !important;
        margin-top: 40px !important;
        align-items: center;
    }

    .hero .btn {
        width: auto !important;
        min-width: 200px;
        padding: 14px 28px !important;
        font-size: 0.85rem !important;
    }
}

@media (min-width: 901px) and (max-width: 1100px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- LANGUAGE SELECTOR --- */
.lang-selector {
    position: relative;
    margin-left: 30px;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    transition: all 0.3s ease;
}

.globe-icon {
    flex-shrink: 0;
    margin-right: -2px;
}

.lang-selector:hover .lang-current {
    border-color: var(--gold);
    color: var(--gold);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    list-style: none;
    padding: 10px 0;
    min-width: 140px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.lang-selector:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: background 0.2s ease;
    color: var(--text);
}

.lang-dropdown li a:hover {
    background: var(--surface);
    color: var(--gold);
}

.flag-icon {
    font-size: 1.1rem;
}

@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }
}

@media (max-width: 900px) {
    .lang-selector {
        width: 100% !important;
        order: -1 !important;
        margin-left: 0 !important;
        justify-content: flex-end !important;
        background: var(--surface-alt);
        padding: 8px 20px !important;
        border-bottom: 1px solid var(--border);
    }

    .lang-current span {
        display: inline-block;
        /* Show text on tablet/mobile if space permits or just keep it minimal */
        font-size: 0.8rem;
    }

    .lang-current {
        padding: 5px 10px;
        border: none;
        background: transparent;
    }

    .lang-dropdown {
        right: 20px;
        top: 100%;
    }
}

footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.6);
    padding: 100px 40px 40px;
    font-size: 0.9rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 80px;
    margin-bottom: 80px;
}

.footer-legal {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0 40px 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.6;
    text-align: justify;
}

.footer-disclaimer {
    color: var(--gold);
    text-transform: uppercase;
    font-family: var(--font-serif);
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-align: center;
    margin-top: 20px;
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: #FFF;
    margin-bottom: 30px;
    display: block;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-title {
    color: #FFF;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 30px;
    font-weight: 600;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-links a {
    transition: color 0.3s ease;
    font-weight: 300;
}

.footer-links a:hover {
    color: var(--gold);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 40px;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* --- ANIMATIONS --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.165, 0.84, 0.44, 1), transform 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.animate-on-scroll.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.decorative-line {
    width: 60px;
    height: 2px;
    background: var(--gold);
    margin: 30px auto;
}

.content-block {
    margin-bottom: 60px;
}

.content-block h3 {
    margin-bottom: 20px;
    font-size: 2rem;
}

.text-gold {
    color: var(--gold);
}

.footer-legal,
.footer-content,
.footer-bottom {
    box-sizing: border-box;
}

/* --- APP-LIKE MOBILE NAVIGATION --- */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    z-index: 2000;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
}

.mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    gap: 4px;
    width: 20%;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav a svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
    transition: all 0.3s ease;
}

.mobile-nav a.active {
    color: var(--primary);
}

.mobile-nav a.active svg {
    stroke: var(--gold);
}

@media (max-width: 900px) {
    .mobile-nav {
        display: flex;
    }

    body {
        /* Prevent bounce and overflow on mobile where possible */
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
        -webkit-tap-highlight-color: transparent;
    }

    /* Modify existing footer to not sit under the nav */
    footer {
        padding-bottom: calc(40px + 70px + env(safe-area-inset-bottom)) !important;
        width: 100% !important;
        overflow-x: hidden;
    }
}

/* --- CAROUSEL PARTENAIRES --- */
.partners-carousel-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
    background: var(--surface);
}

.partners-track {
    display: flex;
    width: max-content;
    animation: logos-scroll 40s linear infinite;
    align-items: center;
    padding: 60px 0;
}

.partner-slide {
    padding: 0 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    filter: grayscale(1);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.partner-slide:hover {
    filter: grayscale(0);
    opacity: 1;
}

@keyframes logos-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.partners-carousel-wrapper::before,
.partners-carousel-wrapper::after {
    content: "";
    height: 100%;
    position: absolute;
    width: 150px;
    z-index: 2;
    pointer-events: none;
}

.partners-carousel-wrapper::before {
    left: 0;
    top: 0;
    background: linear-gradient(to right, var(--surface) 0%, transparent 100%);
}

.partners-carousel-wrapper::after {
    right: 0;
    top: 0;
    background: linear-gradient(to left, var(--surface) 0%, transparent 100%);
}