/* =========================================================
   FDL Systèmes — Style global
   ========================================================= */

   html, body {
    height: 100%;
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: #333;
    background: #fafafa;
  }
  
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  
  /* =========================================================
     HEADER
     ========================================================= */
  
  header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 40px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
  }
  
  /* Nouvelle règle pour le lien du logo: supprime le soulignement */
  header a {
    text-decoration: none; 
    cursor: pointer;
  }

  header h1 {
    font-size: 1.5em;
    margin: 0;
    color: #007bff;
  }
  
  /* Nouvelle règle pour le logo dans le header */
  header h1 img {
    height: 65px; /* Taille standard pour le logo */
    width: auto;
    display: block;
  }

  header.scrolled {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
  }
  
  /* =========================================================
     MAIN CONTENT
     ========================================================= */
  
  main {
    text-align: center;
    padding: 80px 20px 40px; /* Espace compensant le header */
    flex: 1 0 auto;
    max-width: 900px;
    margin: 0 auto;
    transition: opacity 0.5s ease;
    box-sizing: border-box;
  }
  
  #view {
    opacity: 1;
    transition: opacity 0.5s ease;
  }
  
  #view.fade-out {
    opacity: 0;
  }
  
  /* =========================================================
     FOOTER
     ========================================================= */
  
  footer {
    position: fixed;           /* ✅ Fixe le footer */
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    padding: 15px 40px;
    background: #f0f0f0;
    color: #555;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1); /* léger effet de surélévation */
  }
  
  footer a {
    color: #007bff;
    text-decoration: none;
  }
  
  footer a:hover {
    text-decoration: underline;
  }
  
  /* =========================================================
     BUTTONS
     ========================================================= */
  
  /* Suppression de l'ancien bouton qui n'est plus utilisé */
  #login-btn {
      display: none; 
  }
  
/* ------------------ Dropdown Menu ------------------ */

.dropdown-container {
  position: relative;
  display: inline-block;
}

/* Style du bouton/icône de déclenchement (trigger) */
.auth-trigger {
  background: #007bff; /* Couleur de fond bleue */
  color: white; /* Couleur du texte/icône (au cas où) */
  border: none;
  cursor: pointer;
  padding: 0 15px; /* Ajout d'un padding horizontal pour élargir */
  min-width: 50px; /* Taille minimale pour s'assurer qu'il est assez large */
  height: 40px; /* Réduit la hauteur pour une forme rectangulaire */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px; /* Bords légèrement arrondis pour un look moderne */
  transition: background 0.2s ease;
}

.auth-trigger:hover, 
/* La classe 'active' devra être ajoutée par JS lors de l'ouverture */
.auth-trigger.active {
  background: #0056b3; /* Bleu plus foncé au survol/actif */
}

/* Le SVG (l'icône) prend sa couleur #007bff du 'fill' dans le HTML */
.auth-trigger svg {
  width: 24px;
  height: 24px;
}


/* Contenu du menu déroulant */
.dropdown-content {
  display: none; /* CACHÉ par défaut. Le JS devra ajouter la classe .open sur .dropdown-container pour l'afficher */
  position: absolute;
  background-color: #fff;
  min-width: 250px; 
  box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
  z-index: 1001; 
  top: 100%; 
  right: 0; 
  border-radius: 6px;
  overflow: hidden; 
  margin-top: 10px;
}

/* Classe à ajouter via JS pour afficher le menu */
.dropdown-container.open .dropdown-content {
  display: block;
}

.dropdown-item {
  color: #333;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: #f5f5f5;
  color: #007bff;
}

/* Styles du placeholder de l'icône de profil dans le bouton */
.profile-icon-placeholder {
  display: none; /* Caché par défaut */
  width: 40px; 
  height: 40px;
  border-radius: 50%; /* Rendre le conteneur circulaire */
  background-color: #f0f0f0; /* Couleur de fond de repli (si image indisponible) */
  overflow: hidden;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1em;
  color: white; /* Initiales en blanc sur fond bleu */
}

/* Style de l'image de profil dans le bouton */
.profile-icon-placeholder img.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Gestion des États Connecté / Déconnecté (géré par classe JS) --- */
/* ------------------------------------------- */
/* --- CONNECTED STATE on the Auth Button --- */
/* ------------------------------------------- */

/* Lorsque connecté, le bouton lui-même devient un cercle */
.dropdown-container.is-connected .auth-trigger {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0; 
  border-radius: 50%;
  background: transparent; /* Retirer le fond bleu du bouton, il sera sur le placeholder */
}

/* Cacher l'icône par défaut (SVG) quand connecté */
.dropdown-container.is-connected .auth-trigger .disconnected-icon {
display: none;
}

/* Afficher le placeholder de l'icône de profil quand connecté */
.dropdown-container.is-connected .auth-trigger .profile-icon-placeholder {
display: flex; /* Afficher le conteneur */
}

/* Par défaut (sans la classe is-connected sur le conteneur) : afficher le contenu déconnecté */
.dropdown-container:not(.is-connected) .connected-content {
  display: none;
}
.dropdown-container:not(.is-connected) .disconnected-content {
  display: block;
}

/* Lorsque l'utilisateur est connecté (classe is-connected sur le conteneur) : afficher le contenu connecté */
.dropdown-container.is-connected .disconnected-content {
  display: none;
}
.dropdown-container.is-connected .connected-content {
  display: block;
}


/* --- Styles spécifiques à l'état connecté (Profile Block) --- */

.profile-info-block {
  display: flex;
  align-items: center;
  padding: 15px 16px;
  border-bottom: 1px solid #eee;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #007bff; 
  margin-right: 15px;
  display: flex; 
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.1em;
  flex-shrink: 0; /* Empêche l'avatar d'être compressé */
  overflow: hidden; /* <--- IMPORTANT : Masque tout débordement de l'image */
}

/* Nouveau style pour l'image de profil */
.profile-avatar img.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Assure que l'image couvre l'intégralité du cercle sans être déformée */
}

.profile-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0; 
}

.profile-name {
  font-weight: bold;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.profile-email {
  color: #777;
  font-size: 0.8em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Style de l'élément de Déconnexion */
.logout-item {
  border-top: 1px solid #eee;
  color: #dc3545; /* Rouge pour Déconnexion */
}

.logout-item:hover {
  background-color: #fce8e8;
  color: #dc3545;
}



  /* =========================================================
     MODAL (Authentik)
     ========================================================= */
  
  #auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }
  
  /* =========================================================
     CONTENU LÉGAL
     ========================================================= */
  
  #legal-content {
    text-align: left;
  }
  
  #legal-content h2,
  #legal-content h3 {
    color: #007bff;
    margin-top: 30px;
    margin-bottom: 10px;
  }
  
  #legal-content p {
    text-align: justify;
    margin-bottom: 10px;
    line-height: 1.5;
  }
  
  #legal-content a {
    color: #007bff;
    text-decoration: none;
  }
  
  #legal-content a:hover {
    text-decoration: underline;
  }
  
  /* =========================================================
     SLOGAN (Animation trinaire)
     ========================================================= */
  
  .slogan {
    margin-top: 40px;
    font-size: 1.6em;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #007bff;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  
  .slogan span {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.8s ease forwards;
  }
  
  .slogan span:nth-child(1) {
    animation-delay: 0.2s;
  }
  
  .slogan span:nth-child(2) {
    animation-delay: 0.5s;
  }
  
  .slogan span:nth-child(3) {
    animation-delay: 0.8s;
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* =========================================================
     PAGE ACCUEIL — STRUCTURE EN TROIS TIERS
     ========================================================= */
  
  #home-content {
    text-align: center;
    padding: 40px 20px 60px;
    max-width: 900px;
    margin: 0 auto;
  }
  
  /* Bloc 1 — WHY + HOW */
  .home-intro {
    margin-bottom: 60px;
  }
  
  .intro-title {
    font-size: 1.9em;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 0.8em;
  }
  
  .intro-text,
  .how-text {
    font-size: 1.05em;
    color: #333;
    line-height: 1.7;
    text-align: justify;
    margin-bottom: 1.2em;
  }
  
  .how-text {
    font-style: italic;
    color: #444;
  }
  
  /* Bloc 2 — Carte produit */
  .product-card {
    background: linear-gradient(145deg, #ffffff, #f5f8ff);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.35s ease;
    cursor: pointer;
    padding: 35px 25px;
    max-width: 600px;
    margin: 0 auto 60px;
  }
  
  .product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.12);
    background: linear-gradient(145deg, #f8fbff, #ffffff);
  }
  
  .product-card h3 {
    color: #0056b3;
    font-size: 1.4em;
    margin-bottom: 0.6em;
  }
  
  .product-card p {
    color: #555;
    line-height: 1.6;
    font-size: 1.05em;
  }
  
  /* Bloc 3 — Slogan CTA */
  .slogan {
    margin-top: 40px;
    font-size: 1.6em;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #007bff;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  
  /* =========================================================
     PAGE — SERIAL DATA SYSTEM
     ========================================================= */
  
  #sds-content {
    text-align: left;
  }
  
  #sds-content h2 {
    color: #007bff;
    font-size: 1.8em;
    margin-bottom: 0.3em;
  }
  
  #sds-content h3 {
    color: #0056b3;
    font-size: 1.3em;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
  }
  
  #sds-content p {
    text-align: justify;
    margin-bottom: 1em;
    line-height: 1.6;
  }
  
  #sds-content ul {
    margin: 0.8em 0 1.5em 1.5em;
  }
  
  #sds-content li {
    margin-bottom: 0.5em;
  }
  
  #sds-content .highlight {
    background: #f5f9ff;
    border-left: 4px solid #007bff;
    padding: 10px 15px;
    border-radius: 5px;
    margin: 1.2em 0;
  }
  
  /* =========================================================
     PAGE SDS — CARTE CTA FINALE
     ========================================================= */
  
  .sds-cta-card {
    background: linear-gradient(145deg, #ffffff, #f6f9ff);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.35s ease;
    cursor: pointer;
    padding: 35px 25px;
    max-width: 600px;
    margin: 60px auto 100px;
    text-align: center;
  }
  
  .sds-cta-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.12);
    background: linear-gradient(145deg, #f8fbff, #ffffff);
  }
  
  .sds-cta-card h3 {
    color: #0056b3;
    font-size: 1.4em;
    margin-bottom: 0.6em;
  }
  
  .sds-cta-card p {
    color: #555;
    line-height: 1.6;
    font-size: 1.05em;
    margin: 0;
  }
  
  /* =========================================================
     RESPONSIVE
     ========================================================= */
  
  @media (max-width: 600px) {
    header, footer {
      padding: 12px 20px;
    }
  
    main {
      padding: 120px 15px 90px;
    }
  
    /* Ajustement de la taille du logo pour les mobiles */
    header h1 img {
      height: 30px; 
    }

    .slogan {
      font-size: 1.2em;
      flex-direction: column;
    }
  
    .product-card {
      padding: 25px 20px;
    }
  
    footer {
      flex-direction: column;
      align-items: center;
    }
  
    /* =========================================================
       OPTIMISATION MOBILE — LISIBILITÉ ET ESPACEMENT
       ========================================================= */
  
    .intro-text,
    .how-text,
    #sds-content p {
      font-size: 0.95em;
      line-height: 1.5;
    }
  
    .home-intro {
      margin-bottom: 30px;
    }
  
    #home-content,
    #sds-content {
      padding: 100px 15px 120px;
    }
  
    .product-card,
    .sds-cta-card {
      margin: 20px auto 50px;
      padding: 25px 20px;
    }
  
    .intro-title {
      font-size: 1.4em;
      line-height: 1.3;
    }
  
    main {
      padding-bottom: 120px !important;
    }

    /* Ajustement de la taille du bouton/icône pour mobile */
    .auth-trigger {
      width: 40px; 
      height: 35px;
      padding: 0 10px;
    }
    .auth-trigger svg {
      width: 20px;
      height: 20px;
    }
    
    .dropdown-container.is-connected .auth-trigger {
      width: 35px;
      min-width: 35px;
      height: 35px;
      padding: 0;
    }
    .dropdown-container.is-connected .auth-trigger .profile-icon-placeholder {
      width: 35px;
      height: 35px;
    }
  }
  