/* ================================
   Base
   ================================ */
   *,
   *::before,
   *::after {
     box-sizing: border-box;
     margin: 0;
     padding: 0;
   }
   html {
     font-size: 100%;
   }
   body {
     font-family: 'Segoe UI', sans-serif;
     line-height: 1.5;
     background: #f8fafc;
     color: #1e293b;
     overflow-x: hidden;
   }
    /*ATTENTION NE PAS SUPPRIMER SINON NE CACHE PAS LA LISTE*/
   .hidden {
      display: none !important;
    }
   /* ================================
      Liens
      ================================ */
   a {
     color: #f9a825;
     text-decoration: none;
   }
   a:hover {
     text-decoration: underline;
   }
   
   /* ================================
      Header & Nav
      ================================ */
      header {
        background-color: #f9a825;
        color: 1e293b;
        padding: 1rem 1.5rem;
      }
      
      header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 1rem;
      }
      
      @media (max-width: 768px) {
        header .container {
          gap: 0.5rem;
        }
      }
      header .logo {
        height: 80px;
        width: auto;
      }
      
  nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
  }
  
  nav a:hover {
    text-decoration: underline;
  }
   /* ================================
      Hero
      ================================ */
      .hero {
        position: relative;
        height: auto;
        min-height: 500px;
        text-align: center;
        color: white;
        overflow: hidden;
        padding: 4rem 1rem 6rem 1rem; /* ✅ padding-bottom augmenté */
      }
    
    .hero::before {
      content: "";
      position: absolute;
      inset: 0;
      background: url('/img/header/banniere1.jpg') center/cover no-repeat fixed;
      z-index: -1;
    }

    .hero-content {
      background: rgba(0, 0, 0, 0.5);
      display: inline-block;
      padding: 2rem;
      border-radius: 10px;
      max-width: 800px;
      margin: 3rem auto 0 auto; /* ✅ 3rem en haut, auto horizontal, 0 en bas */
      color: white;
      margin-bottom: 2rem;
    }

   .hero-content h1 {
     font-size: 2.5rem;
     margin-bottom: 1rem;
   }
   .hero-content p {
     max-width: 800px;
     margin: 0 auto;
   }
   
   /* ================================
      Section Titles
      ================================ */
   section h2 {
    margin-top: 40px; /* ou plus selon besoin */
     font-size: 1.75rem;
     margin-bottom: 1.5rem;
     text-align: center;
     color: #1e293b;
   }
   h2 i,
  .section-title i {
    margin: 0.5rem;         /* ✅ marge sur les 4 côtés */
    vertical-align: middle;
  }

   section h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #1e293b;
  }
   /* ================================
      Service Cards
      ================================ */
    .service-cards {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 1.5rem;
      max-width: 1000px;
      margin: 2rem auto;
      padding: 1rem 1.5rem;
    }
      
   .card {
    background: #fff;
    border-radius: 12px;
    width: 240px;
    height: 200px;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
   }
   .card i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: #f9a825; 
   }
   .card h3, .card h4 {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0 0 0.5rem;
   }
   .card p {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.4;
    margin: 0;
  }
   .card:hover {
     transform: translateY(-5px);
     box-shadow: 0 6px 16px rgba(0,0,0,0.1);
   }
   
   .a-propos {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    margin-top: 2rem;
    /* Supprime text-align ici */
  }
  
  /* ✅ Ajoute ceci pour les paragraphes */
  .a-propos p {
    text-align: left;
    margin-bottom: 1rem;
  }

  footer {
    padding: 1rem 0;
    background: transparent;
  }
  
  footer .copyright {
    text-align: center;
    font-size: 0.9rem;
    color: #888;
    margin: 2rem 0 0;
  }

   /* ================================
      Formulaires & Boutons
      ================================ */
   input[type="text"],
   input[type="email"],
   textarea,
   select {
     width: 100%;
     padding: .75rem;
     margin-bottom: 1rem;
     border: 1px solid #ccc;
     border-radius: 6px;
     font-size: .9rem;
   }
   
   button,
   input[type="submit"] {
     background: #f9a825;
     color: white;
     border: none;
     padding: .75rem 1rem;
     border-radius: 6px;
     font-size: 1rem;
     font-weight: bold;
     cursor: pointer;
   }
   button:hover,
   input[type="submit"]:hover {
     background: #f57f17;
   }
   

  /* Boutons dynamiques ➕ 🗑️ */
  .add-line,
  .remove-line,
  .add-sub-line {
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0em;
    line-height: 1;
  }

/* Hover sur les boutons dynamiques */
.add-line:hover,
.remove-line:hover,
.add-sub-line:hover {
  color: #e2e8f0;
  transform: scale(1.1);
}

/* Hover sur bouton de validation classique */
.add-line:hover,
.remove-line:hover,
.add-sub-line:hover {
  background: none !important; /* <-- force la suppression du fond */
  color: #e2e8f0;
  transform: scale(1.1);
}

/* ================================
   Popups / Modales
   ================================ */
  .popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }

  /* Active la popup */
  .popup.active {
    display: flex;
  }

  .popup-content {
    position: relative;
    background: #fff;
    border-radius: 10px;
    /* on réduit un peu le padding-right pour laisser le close coller le bord */
    padding: 2rem 1rem 2rem 2rem;  
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;       
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }

  .popup-content .close {
    position: sticky;
    top: 12px;
    /* on colle encore plus à droite : */
    right: 8px;     /* plutôt que 12px, ou même 4px si vous voulez vraiment coller */
    margin-left: auto;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    z-index: 10;
  }


  /* Sections internes si nécessaires */
  .popup-body {
    padding: 1rem 0;
  }

  /* Desktop (écrans ≥768px) → un peu plus large */
  @media (min-width: 768px) {
    .popup-content {
      max-width: 900px;
    }
  }
  .popup-content .card {
    all: unset;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
  }



  .popup-footer {
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
  }

  /* =================================
    Responsive : mobile
    ================================= */
  @media (max-width: 600px) {
    .popup {
      align-items: flex-start;
    }

    .popup-content {
      border-radius: 0;
      margin-top: 1rem;
      padding: 1rem;
      max-height: calc(100vh - 2rem);
      width: 100%;
    }
  }

   /* ================================
      À propos
      ================================ */
   .a-propos {
     background: #fff;
     padding: 2rem;
     border-radius: 10px;
     box-shadow: 0 2px 6px rgba(0,0,0,0.05);
     margin-top: 2rem;
     text-align: center;
   }
   .a-propos p {
     margin-bottom: 1rem;
   }
   
   /* ================================
      Floating Action Buttons (FAB)
      ================================ */
   #fab {
     position: fixed;
     bottom: 16px;
     right: 16px;
     display: flex;
     flex-direction: column;
     gap: 10px;
     z-index: 2000;
   }
   .fab-btn {
     width: 56px;
     height: 56px;
     border-radius: 50%;
     background: #f9a825;
     color: #fff;
     font-size: 28px;
     display: flex;
     align-items: center;
     justify-content: center;
     box-shadow: 0 4px 8px rgba(0, 0, 0, .3);
     transition: background 0.2s;
   }
   .fab-btn:hover {
     background: #f57f17;
   }
   
   /* ================================
      Animations
      ================================ */
   .fade-in {
     opacity: 0;
     transform: translateY(20px);
     transition: opacity .6s ease, transform .6s ease;
   }
   .fade-in.appear {
     opacity: 1;
     transform: translateY(0);
   }
   
   /* ================================
      Responsive
      ================================ */
   @media (max-width: 600px) {
     .hero-content h1 {
       font-size: 2rem;
     }
     .popup-content {
       width: 100%;
       height: 100%;
       border-radius: 0;
     }
     .fab-btn {
       width: 48px;
       height: 48px;
       font-size: 24px;
     }
   }
   

    /* ---------- Styles pour les miniatures ---------- */
    #preview-zone {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-top: 0.5rem;
    }
    /* Chaque miniature s’affiche dans un cadre de 100×100px (ajustez si besoin) */
    #preview-zone .thumb {
      position: relative;
      width: 100px;
      height: 100px;
      border: 1px solid #ccc;
      border-radius: 4px;
      overflow: hidden;
      background: #f9f9f9;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    #preview-zone .thumb img {
      max-width: 100%;
      max-height: 100%;
      object-fit: cover;
    }
    
    /* Petit bouton “×” pour supprimer une miniature sélectionnée avant upload */
    #preview-zone .thumb .remove-btn {
      background: transparent;   /* plus de fond rouge */
      color: inherit;            /* reprendre la couleur du texte parent */
      border: none;              /* pas de bordure */
      border-radius: 0;          /* plus d’arrondi */
      width: auto;               /* dimensions personnalisées si besoin */
      height: auto;
      font-size: 1rem;           /* taille du « × » si vous voulez */
      padding: 0;                /* n’importe quel espacement */
      top: 4px;                  /* repositionnement si besoin */
      right: 4px;
    }
    
/* mise en page creation et  edition devis

/* 1) On annule toute marge verticale par défaut */
.poste .detail {
  display: block;      /* chaque détail sur sa ligne */
  margin: 0 !important;/* _aucune_ marge */
  padding: 0.25em 0;   /* juste un peu de padding pour respirer */
}

/* 2) On décale vers la droite toutes les lignes à l’intérieur d’un bloc .poste */
.poste .detail {
  padding-left: 1.5em; /* indent global */
}

/* 3) Mais on remet sans indent le premier <div class="detail piece-info"> 
   (les champs superficie / hauteur) */
.poste > .detail.piece-info {
  padding-left: 0 !important;
}

/* mise en page creation et  edition devis mais pour tel */

@media (max-width: 600px) {
  /* transforme chaque label en block */
  .poste .detail label {
    display: block !important;
    margin: 0.25em 0;  /* un peu d’espace entre chaque case */
  }

  /* masque les hidden inputs */
  .poste .detail input[type="hidden"] {
    display: none;
  }
}


/* On cache seulement les templates */
.dynamic-line.template,
.multi-instance.template,
.multi-choix-instance.template {
  display: none !important;
}
