* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background: linear-gradient(135deg, #1f2937, #4b5563);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  color: #e0e7ff;
  user-select: none;
}

.wrapper {
  display: flex;
  gap: 3rem;
  background: #111827;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  padding: 3rem 2rem;
  max-width: 900px;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
}

.container {
  background: #1e293b;
  padding: 2rem 2.5rem;
  border-radius: 10px;
  width: 380px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  transition: transform 0.3s ease;
}

.container:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.7);
}

h2 {
  margin-top: 0;
  font-weight: 700;
  font-size: 1.8rem;
  color: #a5b4fc;
  text-align: center;
  margin-bottom: 1.8rem;
  letter-spacing: 1px;
  user-select: text;
}

form {
  display: flex;
  flex-direction: column;
}

label {
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: #c7d2fe;
  text-align: left;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: none;
  background: #374151;
  color: #e0e7ff;
  font-size: 1rem;
  margin-bottom: 1.3rem;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  outline-offset: 2px;
}

input::placeholder,
textarea::placeholder {
  color: #9ca3af;
}

input:focus,
select:focus,
textarea:focus {
  background: #4f46e5;
  box-shadow: 0 0 8px #4f46e5;
  outline: none;
  color: white;
}

button {
  background: #6366f1;
  border: none;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 6px 15px rgba(99, 102, 241, 0.6);
  margin: 20px auto; /* centrage */
}

button:hover {
  background: #4f46e5;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.8);
}

button:active {
  transform: scale(0.98);
}

.forgot-password {
  font-size: 0.85rem;
  color: #818cf8;
  text-align: right;
  text-decoration: none;
  margin-top: -1rem;
  margin-bottom: 1.7rem;
  transition: color 0.3s ease;
  user-select: text;
}

.forgot-password:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

/* Validation message */
.error-message {
  color: #f87171;
  font-size: 0.9rem;
  margin-top: -1rem;
  margin-bottom: 1rem;
  font-weight: 600;
  user-select: text;
}

@media (max-width: 820px) {
  .wrapper {
    flex-direction: column;
    align-items: center;
  }

  .container {
    width: 100%;
    max-width: 400px;
  }
}

/* Light mode pour le formulaire */
body.light-mode {
  background: var(--light-bg, #f1f5f9);
  color: var(--light-text, #1e293b);
}

body.light-mode .wrapper {
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.light-mode .container {
  background: #f3f4f6;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body.light-mode h2 {
  color: #1e3a8a;
}

body.light-mode label {
  color: #1f2937;
}

body.light-mode input[type="text"],
body.light-mode input[type="email"],
body.light-mode input[type="password"],
body.light-mode select,
body.light-mode textarea {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #cbd5e1;
}

body.light-mode input:focus,
body.light-mode select:focus,
body.light-mode textarea:focus {
  background: #e0f2fe;
  box-shadow: 0 0 8px #3b82f6;
  color: #1e293b;
}

body.light-mode button {
  background: #3b82f6;
  box-shadow: 0 6px 15px rgba(59, 130, 246, 0.5);
}

body.light-mode button:hover {
  background: #2563eb;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.7);
}

body.light-mode .forgot-password {
  color: #2563eb;
}

body.light-mode .forgot-password:hover {
  color: #1e40af;
}

body.light-mode .error-message {
  color: #dc2626;
}
