/* ==========================================================================
   NetExpress v2 – Base UI (VERSION CORRIGÉE)
   ========================================================================== */

:root {
  /* --- Palette --- */
  --brand: #0f6d4e;
  --brand-700: #0c5b41;
  --brand-900: #0a3c28;
  --ink: #101418;
  --muted: #5c6b64;
  --surface: #f5f7f5;
  --card: #ffffff;
  --ring: rgba(15, 109, 78, .25);

  /* --- Dimensions --- */
  --radius: 16px;
  --container-width: 1200px; /* Largeur max du site */

  /* --- Ombres --- */
  --shadow-1: 0 10px 25px rgba(16, 20, 24, .06);
  --shadow-2: 0 20px 50px rgba(16, 20, 24, .10);
}

/* 1. RESET & IMAGES (Le fix pour vos images "ouffs") */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden; /* Empêche le scroll horizontal */
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
}

/* Empêche TOUTES les images de dépasser de leur boîte */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 2. CONTENEUR (Le fix pour le padding et la largeur) */
.container {
  width: 100%;
  max-width: var(--container-width); /* Bloque la largeur à 1200px */
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;  /* Espace de sécurité à gauche */
  padding-right: 20px; /* Espace de sécurité à droite */
}

.content {
  padding: 40px 0 80px;
  min-height: 60vh;
}

/* 3. HEADER & NAV */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, var(--brand), var(--brand-700));
  color: #fff; box-shadow: var(--shadow-1);
}

.header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}

.brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; font-weight: 800; }
.brand .logo { width: 40px; height: 40px; border-radius: 8px; background: #fff; }
.nav { display: flex; gap: 1rem; }
.nav-link { color: #eef9f3; text-decoration: none; padding: .5rem .75rem; border-radius: 8px; transition: .2s; }
.nav-link:hover { background: rgba(255,255,255,.15); }

/* CTA dans la barre de navigation */
.nav-link.cta {
  background: #ffffff;
  color: var(--brand);
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  box-shadow: var(--shadow-1);
  margin-left: 0.5rem;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.nav-link.cta:hover {
  background: var(--brand);
  color: #ffffff;
  transform: translateY(-2px);
}

/* Style pour l'icône de la marque dans la navbar */
.brand-icon {
  font-size: 1.5rem;
  margin-right: 0.25rem;
}

/* Bordure animée de luxe.
   Utilise un pseudo‑élément pour dessiner un dégradé en déplacement autour du contenu.
   Appliquez la classe .animated-border sur un conteneur pour obtenir l’effet premium. */
.animated-border {
  position: relative;
  z-index: 0;
}
.animated-border::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: var(--radius);
  background: linear-gradient(45deg, var(--brand), #ffffff, var(--brand-700), #ffffff, var(--brand));
  background-size: 400% 400%;
  animation: border-shine 10s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  z-index: -1;
}
@keyframes border-shine {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Lightbox général pour la page réalisations */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: var(--shadow-2);
}
.lightbox-overlay .caption {
  color: #fff;
  margin-top: 1rem;
  text-align: center;
  font-size: 1.2rem;
}

/* Menu Mobile */
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.8rem; cursor: pointer; }
@media(max-width: 800px) {
  .nav-toggle { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; background: rgba(0,0,0,0.1); padding: 10px; margin-top: 10px; border-radius: 8px; }
  .nav.open { display: flex; }
  .header-row { flex-wrap: wrap; }
  .nav-link { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.1); padding: 10px 0; }
}

/* 4. FORMULAIRES (Le fix pour qu'ils ne soient pas étirés) */
form, .form-card {
  width: 100%;
  max-width: 800px; /* Force le formulaire à ne pas dépasser 800px */
  margin: 0 auto;   /* Centre le formulaire */
}

label {
  display: block; font-weight: 600; margin-bottom: 8px; color: var(--brand-900);
}

.input, .textarea, select, input[type="text"], input[type="email"], input[type="tel"], input[type="date"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.textarea {
  min-height: 120px; /* Hauteur min pour le message */
  resize: vertical;
}

/* Focus vert sur les champs */
.input:focus, .textarea:focus, select:focus, input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
}

.btn {
  display: inline-block; padding: 12px 24px; border-radius: 12px;
  background: var(--brand); color: #fff; font-weight: 700; text-align: center;
  border: none; cursor: pointer; text-decoration: none;
  transition: transform 0.2s;
}
.btn:hover { background: var(--brand-700); transform: translateY(-2px); }

/* Sections génériques */
.section {
  padding: 4rem 0;
}

/* Disposition en grille pour les formulaires et sections
   Les classes .row et .row-2 permettent de répartir les champs sur
   plusieurs colonnes.  Sur les petits écrans la grille redevient à
   une seule colonne. */
.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.row.row-2 {
  grid-template-columns: repeat(2, 1fr);
}

.col-span-2 { grid-column: span 2; }
.slider-row { display: flex; align-items: center; gap: 1rem; }
.btn-block { width: 100%; margin-top: 1rem; }
.h1 { margin-top: 0; }

/* Petites utilitaires */
.mt-1 { margin-top: 1rem; }
@media (max-width: 600px) {
  .row.row-2 {
    grid-template-columns: 1fr;
  }
}

/* Texte secondaire légèrement atténué */
.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Valeur mise en avant, par exemple pour le slider de surface */
.highlight-val {
  font-weight: 600;
  color: var(--brand);
}

/* Messages Django */
.messages-wrap { margin-top: 1rem; }
.alert {
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  padding: 10px 16px;
  border-radius: 12px;
  color: #256029;
  margin-bottom: 8px;
}

/* 5. FOOTER */
.site-footer {
  background: var(--brand-900); color: #e5e7eb;
  padding: 40px 0; text-align: center; margin-top: auto;
}

/* Galerie Réalisations */
.gallery-head { text-align: center; margin-bottom: 2rem; }
.gallery-filters { margin-top: 1rem; display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.gallery-item { cursor: pointer; position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow-1); }
.gallery-item img { width: 100%; height: 200px; object-fit: cover; display: block; }
.gallery-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%); display: flex; flex-direction: column; justify-content: flex-end; padding: 0.5rem; }
.gallery-cat { font-size: 0.8rem; color: #e0f2f1; text-transform: uppercase; letter-spacing: 1px; }
.gallery-overlay .title { margin: 0; color: #fff; font-size: 1.1rem; }
.lightbox-inner { text-align: center; }