/* ==========================================================================
   1. VARIABLES & REINITIALISATION (RESET)
   ========================================================================== */
:root {
    --primary-blue: #3b82f6;
    --primary-blue-hover: #2563eb;
    --dark-blue: #1e293b;
    --dark-blue-hover: #0f172a;
    --light-grey-bg: #f9fafb;
    --header-bg: rgba(255, 255, 255, 0.95);
    --text-color: #111827;
    --text-secondary: #6b7280;
    --max-width: 1100px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.5;
    background-image: url('background.png');
    background-repeat: repeat;
}

body.modal-open {
    overflow: hidden;
}

/* ==========================================================================
   2. BOUTONS & COMPOSANTS GENERIQUES
   ========================================================================== */
.btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    display: inline-block;
}

.btn:active {
    transform: scale(0.98);
}

.btn-order { 
    background-color: var(--primary-blue); 
    color: white; 
}

.btn-order:hover { 
    background-color: var(--primary-blue-hover); 
}

.btn-demo { 
    background-color: var(--dark-blue); 
    color: white; 
}

.btn-demo:hover { 
    background-color: var(--dark-blue-hover); 
}

.btn-app { 
    background-color: transparent; 
    color: var(--primary-blue); 
    border: 2px solid var(--primary-blue); 
}

.btn-app:hover { 
    background-color: rgba(59, 130, 246, 0.05); 
}

.btn-logout {
    color: #ef4444;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-logout:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

.btn-order-logged *, 
.btn-demo-logged *,
.trigger-order-modal *,
.trigger-demo-modal * {
    pointer-events: none;
}

/* ==========================================================================
   3. LAYOUT & BARRE DE NAVIGATION (HEADER)
   ========================================================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: var(--header-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-header {
    height: 32px;
    width: auto;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: 0.5px;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.guest-actions {
    display: flex;
    gap: 10px;
}

.user-profile-nav {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-left: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-blue);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ==========================================================================
   4. SECTIONS & PANNEAUX DE CONTENU
   ========================================================================== */
section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 90px 20px 40px 20px;
    scroll-snap-align: start;
}

.section-white { 
    background-color: rgba(255, 255, 255, 0.4); 
}

.section-grey { 
    background-color: rgba(249, 250, 251, 0.2); 
}

.main-container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    gap: 40px;
    align-items: center;
}

.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.logo-main {
    width: 220px;
    height: auto;
    margin-bottom: 20px;
}

.title-large {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    color: var(--text-color);
    margin-bottom: 20px;
}

.right-panel {
    flex: 1;
}

.description-block {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.description-block h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
}

.description-block p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.map-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ==========================================================================
   5. FENÊTRES MODALES (COMPORTEMENT STRUCTUREL EN COMMUN)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    padding: 40px 32px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover { 
    color: var(--text-color); 
}

.modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.modal-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-oauth {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-google {
    background-color: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.btn-google:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.btn-linkedin {
    background-color: #0077b5;
    color: white;
    border: none;
}

.btn-linkedin:hover {
    background-color: #005987;
}

.separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: #9ca3af;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
}

.separator::before, .separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.separator:not(:empty)::before { margin-right: .5em; }
.separator:not(:empty)::after { margin-left: .5em; }

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-submit {
    width: 100%;
    background-color: var(--text-color);
    color: white;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-submit:hover {
    background-color: #1f2937;
}

/* ==========================================================================
   6. ANIMATIONS & EFFETS VISUELS
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   7. BADGE DE STATUS DE LICENCE GLOBAL (UNIFIED SUBDOMAIN)
   ========================================================================== */
.license_badge.stacked_badge {
    display: flex;
    flex-direction: column; 
    align-items: flex-start; 
    gap: 4px;                
    background-color: #f8fafc;
    padding: 8px 14px;        
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.badge_identity_row {
    display: flex;
    align-items: center;       
    gap: 12px;                 
}

.company_badge_img {
    height: 36px !important;
    width: 36px !important;    
    object-fit: cover;         
    border-radius: 50% !important;
    border: 1px solid #cbd5e1; 
    background-color: #ffffff;
    flex-shrink: 0;            
}

.company_badge_img.default_svg_wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-sizing: border-box;
}

.company_badge_img.default_svg_wrapper svg {
    width: 100%;
    height: 100%;
}

.badge_text_column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    gap: 1px;                  
}

.profile_name_text {
    font-size: 14px;           
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
}

.license_days_text {
    font-size: 12px;           
    font-weight: 500;
    color: #64748b;            
    white-space: nowrap;
    line-height: 1.2;
}

/* ==========================================================================
   8. ADAPTATION RESPONSIVE (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 768px) {
    html {
        scroll-snap-type: none;
    }

    section {
        height: auto;
        min-height: 100vh;
        padding-top: 85px;
        scroll-snap-align: none;
    }

    header {
        padding: 10px;
        height: auto;
        min-height: 60px;
    }

    .logo-header { 
        display: none; 
    }
    
    .brand-name { 
        display: none;
    } 
    
    .header-buttons { 
        width: 100%; 
        display: flex;
        flex-direction: column-reverse; 
        gap: 16px; /* Augmenté de 12px à 16px pour aérer le bloc profil et le bloc boutons */
    }

    .guest-actions {
        width: 100%;
        display: flex;
        gap: 10px; /* Augmenté de 6px à 10px pour que les deux boutons ne soient pas trop collés horizontalement */
        justify-content: space-between;
    }

    .user-profile-nav {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
        padding-bottom: 8px;
        border-bottom: 1px dashed #e2e8f0;
    }

    .btn {
        padding: 14px 10px; /* Augmenté de 8px à 14px pour une hauteur tactile confortable (environ 48px au total) */
        font-size: 0.9rem;  /* Légèrement agrandi pour améliorer la lisibilité sur mobile */
        flex: 1;
        text-align: center;
    }

    .main-container {
        flex-direction: column;
        gap: 30px;
    }

    .left-panel { 
        order: 1; 
    }

    .right-panel { 
        order: 2; 
        width: 100%; 
    }

    .title-large { 
        font-size: 2.8rem; 
    }
    
    .logo-main { 
        width: 160px; 
    }
    
    .description-block { 
        padding: 24px; 
    }

    .modal-card { 
        padding: 32px 20px; 
        margin: 10px; 
    }
}

@media (max-width: 380px) {
    .btn { 
        padding: 8px 4px; 
        font-size: 0.75rem; 
    }
}