/* Variables globales */
:root { 
  --primary-color: #4641A9;
  --secondary-color: #333;
  --text-color: #1A1F2C;
  --background-color: #f4f4f4;
  --white: #FFFFFF;
  --border-radius: 10px;
  --transition-speed: 0.3s;
  --box-shadow: 1px 1px 4px #6b696933;
}

/* Reset et styles de base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  font-size: 16px;
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Container principal */
.container {
  width: 90%;
  max-width: 1600px;
  margin: 1rem;
}

/* Carte principale */
.carre-noirblanc {
  display: flex;
  width: 100%;
  height: 20rem;
  min-height: 900px;
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
}

/* Section de bienvenue */
.carre1 {
  background: var(--primary-color);
  padding: 3rem;
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.welcome-text {
  color: var(--white);
}

#hesite-pas {
  font-size: clamp(2rem, 5vw, 3.625rem);
  margin-bottom: 1rem;
  font-weight: bold;
}

.name {
  font-size: clamp(1.5rem, 3vw, 1.7rem);
  font-weight: 500;
}

/* Section formulaire */
.carre2 {
  width: 50%;
  padding: 3rem;
  position: relative;
  background: var(--white);
}

/* Bouton fermer */
.fermer {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--primary-color);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-speed);
  box-shadow: var(--box-shadow);
}

.fermer:hover {
  transform: scale(1.1);
}

.croix {
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  right: 1.2rem;
}

.branche1, .branche2 {
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: var(--white);
  top: 50%;
}

.branche1 {
  transform: rotate(45deg);
}

.branche2 {
  transform: rotate(-45deg);
}

/* From Uiverse.io by gharsh11032000 */ 
/* The switch - the box around the slider */
.switch {
  font-size: 17px;
  position: relative;
  display: inline-block;
  width: 3.7em;
  height: 2em;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #E5E5FF;
  border-radius: 50px;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.4em;
  width: 1.4em;
  left: 0.3em;
  bottom: 0.3em;
  background-color: black;
  border-radius: 50px;
  box-shadow: 0 0px 20px #00000066;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.switch input:checked + .slider:before {
  transform: translateX(1.6em);
  width: 1.4em;
  height: 1.4em;

}
#password{
  margin-bottom: 3rem;
}
/* Titre du formulaire */
.contacte-moi {
  font-size: 2rem;
  margin: 4rem 0 4rem 0;
  color: var(--text-color);
}

/* Styles du formulaire */
.form-group {
  margin-bottom: 2rem;
}

label {
display: block;
margin: 1rem 0 1rem;
font-weight: 500;
color: var(--text-color);
font-size: 15px;
}

input,
textarea {
width: 100%;
height: 2.5rem;
border: 2px solid var(--secondary-color);
border-radius: var(--border-radius);
border: #cccC 3px solid;
font-size: 1.2rem;
transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

input:focus,
textarea:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 2px #4641a933;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.btn-submit {
  width: 100%;
  padding: 0.75rem;
  background-color: black;
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 500;
  transition: background-color var(--transition-speed);
}

.btn-submit:hover {
  background-color: var(--primary-color);
}

@media (max-width: 982px) {
  
  .carre1,
  .carre2 {
    padding: 1.5rem;
  }
  #hesite-pas {
    font-size: 2rem;
  }
  
  .name {
    font-size: 1.5rem;
  }
  
  .contacte-moi {
    font-size: 2rem;
    color: black;
  }
}

/* Amélioration de l'accessibilité */
@media (max-width: 768px) {
  .carre-noirblanc {
      flex-direction: column;
  }
  .carre1,
  .carre2 {
      width: 100%;
  }
  .carre1 {
      padding: 2rem;
  }
  .contacte-moi {
      margin: 2rem;
      text-align: center;
  }
  .fermer {
      top: 1rem;
      right: 1rem;
  }
  input{
    margin-bottom: 1rem;
  }
  .switch{
    margin: 1rem 0 0 1rem;
  }
}
@media (max-width: 480px) {
  .container {
      width: 100%;
  }
  .carre-noirblanc {
      border-radius: 0;
  }
  input,
  textarea,
  .btn-submit {
      font-size: 16px; /* Prevent zoom on mobile */
  }
  textarea{
    margin-bottom: 2rem;
  }

}

/* Pour les écrans en mode paysage sur mobile */
@media (max-height: 600px) and (orientation: landscape) {
  .carre-noirblanc {
      min-height: 100vh;
  }
  .form-group {
      margin-bottom: 1rem;
  }
  .contacte-moi {
      margin: var(--spacing-md) 0;
  }
}
/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
  * {
      animation: none !important;
      transition: none !important;
  }
}