﻿/* --- VARIABLES --- */
:root {
    --bg-color: #F8F9FA;
    --text-primary: #1A1A2E;
    --text-secondary: #6c757d;
    --primary-blue: #0F3460;
    --accent-cyan: #00ADB5;
    --card-bg: #FFFFFF;
    --header-height: 90px;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* --- RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    /* Prevent scroll for SPA feel */
    height: 100vh;
    width: 100vw;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- HEADER (Fixed & Centered Logic) --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background: rgba(248, 249, 250, 0.85);
    /* Semi-transparent */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    /* Essential for absolute centering */
}

/* Logo (Left) */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

.logo-icon {
    height: 40px;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-blue);
    letter-spacing: 1px;
}

.logo-text .highlight {
    color: var(--accent-cyan);
}

/* Right Group */
.header-right-group {
    display: flex;
    align-items: center;
}

.nav-right {
    display: flex;
    gap: 15px;
    /* Spacing between square buttons */
}

/* Square White Buttons */
.square-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 24px;
    background: #fff;
    color: var(--primary-blue);
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0;
    /* Square shape */
    transition: all 0.2s ease;
    cursor: pointer;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    /* Subtle shadow for white on off-white */
}

.square-btn:hover {
    background: #fff;
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.square-btn.active-link {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
    color: #fff;
}

/* Contact Specifics */
.btn-contact-white {
    font-weight: 700;
    border: 1px solid var(--primary-blue);
}

.btn-contact-white:hover {
    background: var(--primary-blue);
    color: #fff;
}

/* --- VIEWPORT & SECTIONS --- */
#viewport {
    position: relative;
    width: 100%;
    height: 100vh;
    padding-top: var(--header-height);
    overflow: hidden;
}

.section-slide {
    position: absolute;
    top: 0;
    /* Align to top of viewport (which is padded) */
    left: 0;
    width: 100%;
    height: 100%;
    padding-top: var(--header-height);
    /* Internal padding for content */
    /* Internal padding for content */
    overflow-y: visible;
    /* Allow content to flow naturally */
    background: var(--bg-color);
    /* Internal padding for content */
    overflow-y: visible;
    /* Allow content to flow naturally */
    background: var(--bg-color);
    display: flex;
    align-items: center;
    /* Center vertically */
    justify-content: center;
    /* Center horizontally */
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease;
}

.section-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 5;
    transform: translateX(0);
}

/* Slide States for JS Logic */
.slide-left {
    transform: translateX(-100%);
}

.slide-right {
    transform: translateX(100%);
}


/* --- CONTENT STYLES --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center content within container */
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Hero */
.hero-content {
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
}

.hero-desc {
    max-width: 600px;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 50px;
    line-height: 1.6;
}

.btn-primary {
    padding: 15px 40px;
    background: var(--primary-blue);
    color: #fff;
    font-weight: 600;
    border-radius: 5px;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: var(--accent-cyan);
    transform: scale(1.05);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(15, 52, 96, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 52, 96, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
}

/* Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.service-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Ensure equal height in grid */
}

.service-card:hover {
    transform: translateY(-5px);
    /* Reduced movement to prevent layout jitter with heavy content */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.card-icon {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--accent-cyan);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.service-card h3 {
    font-size: 1.2rem;
    /* Slightly smaller to fit content */
    color: var(--primary-blue);
    margin-bottom: 10px;
    min-height: 2.4rem;
    /* Force alignment for single/double line titles */
}

/* Service Lists (Ported from V1) */
.service-list {
    list-style: none;
    margin-top: 15px;
    text-align: left;
    /* Ensure list is left-aligned even if card is centered (flex) */
}

.service-list li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-left: 15px;
    position: relative;
    line-height: 1.4;
}

.service-list li::before {
    content: '>';
    color: var(--accent-cyan);
    position: absolute;
    left: 0;
    top: 2px;
    font-weight: 700;
    font-size: 0.8rem;
}

/* Process */
.process-timeline {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    position: relative;
}

.process-timeline::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(0, 0, 0, 0.05);
    z-index: 0;
}

.process-step {
    position: relative;
    z-index: 1;
    background: var(--bg-color);
    padding: 0 10px;
    text-align: center;
    flex: 1;
}

.step-num {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--accent-cyan);
    background: #fff;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Contact */
.contact-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-box {
    background: #fff;
    padding: 60px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 700px;
}

.contact-title {
    font-size: 3rem;
    font-family: var(--font-heading);
    color: var(--primary-blue);
}

.contact-details {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-link {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.contact-link:hover {
    background: rgba(0, 173, 181, 0.1);
}

.footer-fixed {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.8;
    z-index: 1000;
    /* Ensure above everything */
    pointer-events: none;
}

/* Client Area Button */
.btn-client {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-cyan));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 173, 181, 0.3);
}

.btn-client:hover {
    box-shadow: 0 6px 20px rgba(0, 173, 181, 0.5);
    background: linear-gradient(135deg, var(--accent-cyan), var(--primary-blue));
    color: white;
    transform: translateY(-2px);
    border-color: transparent;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 47, 0.85);
    /* Dark overlay */
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

/* Modal Content */
.modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-top: 5px solid var(--accent-cyan);
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

/* Close Button */
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-primary);
}

/* Modal Header */
.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-header h2 {
    color: var(--primary-blue);
    font-family: var(--font-heading);
    margin-bottom: 10px;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Form Styles */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.input-group input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 173, 181, 0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.btn-login:hover {
    background: var(--accent-cyan);
    transform: translateY(-1px);
}

.modal-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.modal-footer a {
    color: var(--text-secondary);
    text-decoration: underline;
}

.modal-footer a:hover {
    color: var(--primary-blue);
}

/* =============================================
   FIXES : Formulaire contact + Responsive Mobile
   ============================================= */

/* Fix contact section scrollable + padding badge bar */
#contact {
    overflow-y: auto !important;
}

.contact-container {
    padding-bottom: 130px !important;
    min-height: 100%;
    align-items: flex-start;
    padding-top: 30px;
}

.contact-box {
    padding: 40px !important;
    margin: auto;
    max-height: none;
    overflow: visible;
}

/* =============================================
   RESPONSIVE MOBILE (max 768px)
   ============================================= */
@media (max-width: 768px) {

    /* Header : réduire taille */
    :root {
        --header-height: 70px;
    }

    .header-container {
        padding: 0 15px;
    }

    .logo-text {
        font-size: 0.9rem;
    }

    .logo-icon {
        height: 30px;
    }

    /* Nav : une seule ligne */
    .header-right-group {
        width: 100%;
    }

    .nav-right {
        display: flex;
        flex-wrap: nowrap;
        width: 100%;
        gap: 3px;
    }

    .square-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 8px 2px;
        font-size: 2.5vw;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        letter-spacing: -0.2px;
    }

    .btn-client {
        padding: 8px 2px;
        font-size: 2.5vw;
    }

    /* Titre hero */
    .hero-title {
        font-size: 2rem;
    }

    .hero-desc {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }

    /* Sections scrollables sur mobile */
    .section-slide {
        overflow-y: auto !important;
        align-items: flex-start;
        padding-top: calc(var(--header-height) + 20px);
    }

    .container {
        padding: 15px 20px;
        justify-content: flex-start;
    }

    /* Services grid 1 colonne */
    .services-grid {
        grid-template-columns: 1fr;
        margin-top: 20px;
    }

    /* Process timeline vertical */
    .process-timeline {
        flex-direction: column;
        gap: 30px;
        margin-top: 30px;
    }

    .process-timeline::before {
        display: none;
    }

    /* Contact box compact */
    .contact-box {
        padding: 25px !important;
    }

    .contact-title {
        font-size: 1.8rem !important;
    }

    /* Badges footer : 2 rangées */
    /* (le badge bar a déjà flex-wrap: wrap) */

    /* Section header */
    .section-title {
        font-size: 1.8rem;
    }

    .section-subtitle {
        font-size: 0.7rem;
    }

    /* Process step numbers smaller */
    .step-num {
        font-size: 1.5rem;
        width: 56px;
        height: 56px;
        line-height: 56px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .contact-title {
        font-size: 1.4rem !important;
    }

    .square-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 6px 1px;
        font-size: 2.2vw;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* =============================================
   RESPONSIVE MOBILE v2 — Complete overhaul
   ============================================= */

/* On mobile: badge bar leaves fixed mode and flows in the page */
@media (max-width: 768px) {

    /* ---- BODY: allow scroll on mobile ---- */
    body {
        overflow-y: auto !important;
        height: auto !important;
    }

    #viewport {
        overflow: visible !important;
        height: auto !important;
    }

    /* ---- Sections: stacked, not absolute ---- */
    .section-slide {
        position: relative !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
        height: auto !important;
        min-height: 100svh;
        padding-top: 80px;
        padding-bottom: 100px;
        display: flex;
        align-items: flex-start;
        overflow: visible !important;
    }

    /* Hide non-active sections on mobile — show all */
    /* We override the JS-driven slide behavior */

    /* ---- Header ---- */
    :root {
        --header-height: 60px;
    }

    .header-container {
        padding: 0 12px;
        flex-wrap: wrap;
        gap: 6px;
        height: auto;
        min-height: 60px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .logo-text {
        font-size: 0.85rem;
    }

    .logo-icon {
        height: 28px;
    }

    /* Nav: une ligne, taille adaptative */
    .nav-right {
        display: flex;
        flex-wrap: nowrap;
        width: 100%;
        gap: 3px;
    }

    .square-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 6px 2px;
        font-size: 2.5vw;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        letter-spacing: -0.2px;
        border-radius: 4px;
    }

    .btn-client {
        padding: 6px 2px;
        font-size: 2.5vw;
    }

    /* ---- Hero ---- */
    .hero-title {
        font-size: 1.8rem !important;
        line-height: 1.2;
        margin-bottom: 16px;
    }

    .hero-desc {
        font-size: 0.9rem;
        margin-bottom: 24px;
    }

    /* ---- Services grid: 1 col ---- */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 20px;
    }

    /* ---- Section headers ---- */
    .section-title {
        font-size: 1.6rem !important;
    }

    .section-subtitle {
        font-size: 0.65rem;
    }

    /* ---- Process: vertical ---- */
    .process-timeline {
        flex-direction: column;
        gap: 24px;
        margin-top: 24px;
    }

    .process-timeline::before {
        display: none;
    }

    .step-num {
        font-size: 1.4rem;
        width: 52px;
        height: 52px;
        line-height: 52px;
    }

    /* ---- Contact box ---- */
    .contact-box {
        padding: 24px !important;
        max-width: 100%;
    }

    .contact-title {
        font-size: 1.5rem !important;
    }

    /* ---- Badge bar: INLINE on mobile (no longer fixed) ---- */
    #badge-bar {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        width: 100% !important;
        z-index: 1 !important;
        background: rgba(248, 250, 252, 0.95) !important;
        border-top: 1px solid rgba(0, 173, 181, 0.15);
        padding: 12px 0 16px;
        margin-top: 0;
    }

    #badge-bar>div:first-child {
        gap: 6px !important;
        padding: 6px 10px !important;
        justify-content: center;
    }

    /* Copyright smaller */
    #badge-bar>div:last-child {
        font-size: 0.7rem !important;
    }

    /* Container padding */
    .container {
        padding: 15px 16px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.4rem !important;
    }

    .contact-title {
        font-size: 1.2rem !important;
    }

    .square-btn {
        padding: 5px 8px;
        font-size: 0.6rem;
    }

    .logo-text {
        display: none;
    }

    /* just icon on very small */
}

/* Footer links: keep clickable despite pointer-events:none on parent */
#badge-bar a {
    pointer-events: auto !important;
}

#badge-bar a * {
    pointer-events: auto !important;
}

/* Footer-fixed: links stay clickable */
.footer-fixed {
    pointer-events: none;
}

.footer-fixed a {
    pointer-events: auto !important;
    color: var(--text-secondary) !important;
    text-decoration: underline !important;
}

/* =============================================
   MODE PAYSAGE MOBILE (téléphone tourné)
   Cible : écrans larges mais hauteur <500px
   ============================================= */
@media (orientation: landscape) and (max-height: 500px) {

    /* Header ultra-compact : logo + nav SUR LA MÊME LIGNE */
    :root {
        --header-height: 48px;
    }

    .header-container {
        padding: 0 15px;
        height: 48px !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .logo-icon {
        height: 24px !important;
    }

    .logo-text {
        font-size: 0.75rem !important;
        white-space: nowrap !important;
        display: block !important;
    }

    /* Nav sur une ligne compacte */
    .header-right-group {
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }

    .nav-right {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
    }

    .square-btn {
        padding: 5px 10px !important;
        font-size: 0.72rem !important;
        white-space: nowrap !important;
        min-width: 0 !important;
    }

    /* Sections scrollables */
    body {
        overflow-y: auto !important;
        height: auto !important;
    }

    #viewport {
        overflow: visible !important;
        height: auto !important;
    }

    /* Sections : réduire le padding haut */
    .section-slide {
        position: relative !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
        height: auto !important;
        min-height: 100svh;
        padding-top: 55px !important;
        padding-bottom: 60px !important;
        overflow-y: auto !important;
        display: flex;
        align-items: flex-start;
    }

    /* Hero compact */
    .hero-title {
        font-size: 1.6rem !important;
        margin-bottom: 10px !important;
    }

    .hero-desc {
        font-size: 0.85rem !important;
        margin-bottom: 15px !important;
    }

    /* Services en 2 colonnes en paysage */
    .services-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        margin-top: 10px !important;
    }

    /* Contact compact */
    .contact-box {
        padding: 20px !important;
    }

    .contact-title {
        font-size: 1.4rem !important;
    }

    /* Cacher le badge bar fixe en paysage (trop encombrant) */
    #badge-bar {
        display: none !important;
    }

    .footer-fixed {
        display: none !important;
    }

    /* Masquer la nav normale, afficher le hamburger */
    .nav-right {
        display: none !important;
    }

    #hamburger-btn {
        display: flex !important;
    }
}

/* Style du menu déroulant paysage (indépendant de la media query) */
.landscape-nav-item {
    display: block;
    padding: 10px 15px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-blue);
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

.landscape-nav-item:hover {
    background: rgba(0, 173, 181, 0.1);
    color: var(--accent-cyan);
}