/* Réinitialisation et configuration de base */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 100%; /* Base pour les REMs, généralement 16px */
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif; /* Police uniforme */
  background-color: #f0f2f5; /* Fond légèrement différent pour un look moderne */
  color: #333;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Assure que le footer reste en bas */
}

.main-container {
  width: 100%;
  max-width: 1200px; /* Largeur maximale pour les grands écrans */
  margin: 0 auto;
  padding: 0 1rem; /* Espacement sur les côtés pour petits écrans */
  flex-grow: 1; /* Permet au contenu principal de pousser le footer en bas */
}

/* En-tête */
header {
  padding: 1.5rem 0;
  /* La bordure et la marge du bas sont supprimées pour unifier avec le formulaire */
}

.logo-container {
  text-align: center;
}

.logo {
  /* Style par défaut (Mobile First) : logo réduit */
  max-width: 120px; /* Taille réduite pour mobile. */
  height: auto;
  display: inline-block;
}

/* Nouvelle règle pour la carte qui contient le logo et le formulaire */
.content-card {
  background-color: #ffffff; /* Le fond blanc unifié */
  border-radius: 8px; /* Les coins arrondis pour l'ensemble */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* L'ombre pour l'ensemble */
  margin-bottom: 2rem; /* La marge qui était sur le form-section */
}

/* Section Formulaire */
.form-section {
  /* Les styles de fond, bordure et ombre sont maintenant sur .content-card */
  /* On ajuste le padding pour enlever l'espace en haut */
  padding: 0 2rem 2rem 2rem;
}

.form-section h2 {
  font-size: 1.5rem;
  color: #1a237e;
  margin-bottom: 0.75rem;
  text-align: center;
}

.form-section p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Groupe de formulaire */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 0.35rem;
}

/* Champs de saisie et textarea */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
  font-size: 1rem;
  color: #2b2b2b;
  background-color: #fff;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  direction: ltr;
  text-align: left;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3949ab;
  box-shadow: 0 0 0 0.2rem rgba(57, 73, 171, 0.25);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Messages d'erreur */
.error-message {
  color: #d93025;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  min-height: 1em;
  display: none;
}

.error-active {
  display: block;
}

/* Bouton d'envoi */
button[type="submit"] {
  display: block;
  width: 100%;
  max-width: 250px;
  margin: 1.5rem auto 0;
  background-color: #3949ab;
  color: #ffffff;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

button[type="submit"]:hover {
  background-color: #283593;
}

button[type="submit"]:active {
  transform: translateY(1px);
}

/* Pied de page */
footer {
  background-color: #2b2b2b;
  color: #f0f2f5;
  padding: 1.5rem 1rem;
  text-align: center;
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links img {
  width: 24px;
  height: 24px;
  filter: grayscale(100%) invert(100%);
  transition: filter 0.2s ease-in-out;
}

.social-links a:hover img {
  filter: grayscale(0%) invert(0%);
}

/* --- Réactivité --- */

@media (min-width: 600px) {
  .form-section {
    /* On restaure le padding pour les écrans plus grands si besoin */
    padding: 0 2.5rem 2.5rem 2.5rem;
  }

  .form-section h2 {
    font-size: 1.75rem;
  }

  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (min-width: 768px) {
  /* Styles pour PC / grands écrans */
  .content-card {
    /* Le formulaire hérite de cette largeur via son parent */
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }

  button[type="submit"] {
    width: auto;
  }

  .logo {
    /* Sur PC, on donne au logo une taille plus grande mais contrôlée */
    max-width: 250px; /* Ajustez cette valeur selon vos préférences */
  }
}