/* RESET ET BASES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: #f8f8fc;
  color: #222;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
}

body.dark-mode {
  background-color: #2e2e2e;
  color: #f8f8fc;
}

/* ANIMATIONS */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(127, 72, 198, 0.7); }
  70% { box-shadow: 0 0 15px 7px rgba(127, 72, 198, 0); }
  100% { box-shadow: 0 0 0 0 rgba(127, 72, 198, 0); }
}

@keyframes shine {
  to { background-position: 200% center; }
}

/* STRUCTURE PRINCIPALE */
.container {
  max-width: 1200px;
  margin: 100px auto 50px;
  padding: 0 2rem;
  perspective: 1000px;
}

.form-section {
  display: flex;
  flex-wrap: wrap;
  gap: 4rem;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 180px);
  position: relative;
}

/* TEXTE INTRODUCTIF */
.form-text {
  flex: 1;
  min-width: 400px;
  padding: 2rem 0;
  animation: fadeIn 1s ease-out;
  margin-bottom: 400px;
}

.form-text h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #000000;
  text-align: center;
  position: relative;
}

.form-text h1 span {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  background: linear-gradient(90deg, #7f48c6, #ff6b6b, #7f48c6);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shine 3s linear infinite;
}

.form-text p {
  margin-bottom: 2rem;
  font-size: 1.2rem;
  color: #666;
  line-height: 1.6;
}

body.dark-mode .form-text p {
  color: #bbb;
}

/* CARTE DE FORMULAIRE */
.form-box {
  flex: 1;
  min-width: 450px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
  transition: all 0.5s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

body.dark-mode .form-box {
  background: rgba(46, 46, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(127, 72, 198, 0.1),
    rgba(255, 107, 107, 0.1)
  );
  transform: rotate(30deg);
  z-index: -1;
}

.form-box h2 {
  color: #7f48c6;
  margin-bottom: 2rem;
  font-size: 1.8rem;
  font-weight: 600;
  text-align: center;
  position: relative;
}

.form-box h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: #ff6b6b;
}

/* CHAMPS DE FORMULAIRE */
.input-group {
  position: relative;
  margin-bottom: 2rem;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 1rem 1.2rem;
  border: none;
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

body.dark-mode .input-group input,
body.dark-mode .input-group select {
  background: rgba(60, 60, 60, 0.9);
  color: #f8f8fc;
}

.input-group input:focus,
.input-group select:focus {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(127, 72, 198, 0.2);
}

.input-group label {
  position: absolute;
  top: -0.8rem;
  left: 1rem;
  background: #f8f8fc;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #7f48c6;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

body.dark-mode .input-group label {
  background: #2e2e2e;
  color: #bbb;
}

/* BOUTON PRINCIPAL */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, #7f48c6 0%, #5d2e9a 100%);
  color: white;
  border: none;
  padding: 1.2rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.5s ease;
  width: 100%;
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(127, 72, 198, 0.4);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  z-index: 1;
}

.btn-primary:hover {
  letter-spacing: 2px;
  transform: translateY(-5px);
  animation: pulse-glow 1.5s infinite;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #5d2e9a 0%, #7f48c6 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.btn-primary:hover::before {
  opacity: 1;
}

/* IMAGE HERO */
.hero-img-container {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  transition: all 0.5s ease;
}

.hero-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.8s ease;
}

.hero-img-container:hover .hero-img {
  transform: scale(1.05);
}

.hero-img-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, rgba(127, 72, 198, 0.3), transparent);
  mix-blend-mode: multiply;
  z-index: 1;
}

/* EFFET FADE-IN */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-in.appear {
  opacity: 1;
  transform: translateY(0);
}

/* RESPONSIVE DESIGN */
@media (max-width: 1200px) {
  .form-text h1 {
    font-size: 2.5rem;
  }
  html, body{
    overflow-x: hidden;
  }
}

@media (max-width: 992px) {
  .form-section {
    flex-direction: column;
    gap: 3rem;
  }
  
  .form-text, .form-box {
    width: 100%;
    min-width: auto;
  }
  
  .form-text {
    text-align: center;
    padding-top: 0;
    margin-bottom: 0;
  }
  
  .form-box {
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  .container {
    margin: 80px auto 30px;
    padding: 0 1.5rem;
  }
  
  .form-text h1 {
    font-size: 2.2rem;
  }
  
  .form-box {
    padding: 2rem;
  }
  
  .btn-primary {
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 1rem;
  }
  
  .form-text h1 {
    font-size: 2rem;
  }
  
  .form-text p {
    font-size: 1rem;
  }
  
  .form-box {
    padding: 1.5rem;
    min-width: 100%;
  }
  
  .input-group input,
  .input-group select {
    padding: 0.9rem;
  }
  
  .btn-primary {
    font-size: 0.95rem;
  }
}