/* =============================================
   STYLE.CSS — SITE VITRINE
   =============================================
   Organisation :
   1. Variables CSS (couleurs, polices)
   2. Reset & base
   3. Navigation
   4. Composants (boutons, cartes, formulaire)
   5. Sections (hero, services, footer)
   6. Responsive (mobile)
   ============================================= */

/* ===== 1. VARIABLES CSS ===== */
/* Les variables CSS = constantes réutilisables, comme en Python */
:root {
  --couleur-principale: #1a56db;   /* Bleu principal */
  --couleur-accent: #f59e0b;       /* Jaune/orange pour l'accent */
  --couleur-texte: #1f2937;        /* Texte principal */
  --couleur-texte-clair: #6b7280;  /* Texte secondaire */
  --couleur-fond: #ffffff;
  --couleur-fond-gris: #f9fafb;
  --rayon: 10px;                   /* Border-radius global */
  --ombre: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
  --transition: all 0.2s ease;
}

/* ===== 2. RESET & BASE ===== */
/* Supprime les marges/paddings par défaut du navigateur */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--couleur-texte);
  background: var(--couleur-fond);
}

/* Conteneur centré — max 1100px */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Conteneur étroit pour les formulaires et articles */
.container-etroit {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; line-height: 1.2; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
a  { color: var(--couleur-principale); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* Couleur accent (le point après le logo) */
.accent { color: var(--couleur-accent); }

/* ===== 3. NAVIGATION ===== */
.header {
  position: sticky;       /* Reste en haut lors du scroll */
  top: 0;
  z-index: 100;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--couleur-texte);
  text-decoration: none;
}

.nav-liens {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-liens a {
  color: var(--couleur-texte-clair);
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}

.nav-liens a:hover,
.nav-liens a.actif {
  color: var(--couleur-principale);
}

/* Bouton CTA dans la nav */
.btn-nav {
  background: var(--couleur-principale);
  color: white !important;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.btn-nav:hover {
  background: #1440b0;
  text-decoration: none !important;
}

/* ===== 4. COMPOSANTS ===== */

/* --- Boutons --- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--rayon);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-principal {
  background: var(--couleur-principale);
  color: white;
}
.btn-principal:hover { background: #1440b0; transform: translateY(-1px); text-decoration: none; }

.btn-secondaire {
  background: transparent;
  color: var(--couleur-principale);
  border: 2px solid var(--couleur-principale);
}
.btn-secondaire:hover { background: #eff6ff; text-decoration: none; }

/* --- Cartes --- */
.carte {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px 24px;
  transition: var(--transition);
}
.carte:hover { box-shadow: var(--ombre); transform: translateY(-2px); }

.carte-icone { font-size: 2.5rem; margin-bottom: 1rem; }
.carte h3 { margin-bottom: 0.5rem; }
.carte p { color: var(--couleur-texte-clair); margin-bottom: 1rem; }
.carte-prix { font-weight: 700; color: var(--couleur-principale); }

/* --- Grilles --- */
.grille-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 2.5rem;
}

/* --- Projets --- */
.carte-projet {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.carte-projet-img {
  height: 160px;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
}
.carte-projet-info { padding: 16px; }
.carte-projet-info h4 { margin-bottom: 8px; }
.tag {
  display: inline-block;
  background: #eff6ff;
  color: var(--couleur-principale);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* --- Formulaire --- */
.formulaire { display: flex; flex-direction: column; gap: 20px; }

.champ { display: flex; flex-direction: column; gap: 6px; }

.champ label {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--couleur-texte);
}

.obligatoire { color: #ef4444; }

/* Styles pour tous les inputs du formulaire Django */
.form-input,
input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--couleur-principale);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.erreur-champ {
  color: #ef4444;
  font-size: 0.85rem;
}

/* --- Messages flash Django --- */
.messages-container { padding: 0 20px; margin-top: 12px; }
.message {
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 500;
  max-width: 1100px;
  margin: 0 auto 8px;
}
.message-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.message-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ===== 5. SECTIONS ===== */

.section { padding: 80px 0; }
.section-gris { background: var(--couleur-fond-gris); }
.section-titre { text-align: center; }
.section-sous-titre { text-align: center; color: var(--couleur-texte-clair); margin-top: 0.5rem; }

/* --- Hero --- */
.hero {
  padding: 100px 0;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
}
.hero-tag {
  display: inline-block;
  background: #dbeafe;
  color: var(--couleur-principale);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}
.hero-sous-titre {
  font-size: 1.15rem;
  color: var(--couleur-texte-clair);
  margin: 1rem 0 2rem;
  max-width: 560px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* --- CTA section --- */
.cta-section { background: var(--couleur-principale); color: white; }
.cta-section h2 { color: white; }
.cta-section p { color: rgba(255,255,255,0.85); margin: 1rem 0 2rem; }
.cta-section .btn-principal { background: white; color: var(--couleur-principale); }

/* --- Footer --- */
.footer {
  background: var(--couleur-texte);
  color: rgba(255,255,255,0.8);
  padding: 60px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}
.footer h3, .footer h4 { color: white; margin-bottom: 12px; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 8px; }
.footer a { color: rgba(255,255,255,0.7); text-decoration: none; }
.footer a:hover { color: white; }
.footer p { margin-bottom: 8px; font-size: 0.95rem; }
.footer-bas {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* ===== 6. RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero { padding: 60px 0; }
  .section { padding: 50px 0; }

  /* Masque les liens nav sur mobile */
  .nav-liens { display: none; }

  .grille-3 { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { text-align: center; }
}

/* ===== BURGER MENU MOBILE ===== */
.burger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--couleur-texte);
  margin-left: auto;
}

@media (max-width: 768px) {
  .burger { display: block; }

  .nav-liens {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    flex-direction: column;
    padding: 12px 20px;
    gap: 0;
    z-index: 200;
  }
  .nav-liens.open { display: flex; }
  .nav-liens li { border-bottom: 1px solid #f3f4f6; }
  .nav-liens a { padding: 12px 0; display: block; }
  .btn-nav { margin: 8px 0; text-align: center; }
}
