/* ===============================================
   PAGE REGISTER - Style unifié avec login
=============================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.container {
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 440px;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  text-align: center;
  color: #333;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  font-weight: 600;
}

/* Messages d'erreur */
.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 0.9rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  border: 1px solid #f5c6cb;
  font-size: 0.9rem;
}

/* Labels */
label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: #555;
  font-size: 0.9rem;
}

/* Inputs */
input[type="text"],
input[type="tel"],
input[type="password"] {
  width: 100%;
  padding: 0.85rem;
  margin-bottom: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="text"]::placeholder,
input[type="tel"]::placeholder,
input[type="password"]::placeholder {
  color: #aaa;
}

/* Indication input invalide */
input:invalid:not(:placeholder-shown) {
  border-color: #dc3545;
}

input:valid:not(:placeholder-shown) {
  border-color: #28a745;
}

/* Bouton submit */
button[type="submit"] {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  margin-top: 0.5rem;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* Lien "Déjà un compte" */
p {
  text-align: center;
  margin-top: 1.5rem;
  color: #666;
  font-size: 0.95rem;
}

p a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

p a:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* ===============================================
   TOGGLE MOT DE PASSE
=============================================== */

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 2.8rem;
}

.toggle-password {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  width: auto;
  margin: 0;
}

.toggle-password:hover {
  color: #667eea;
}

/* ===============================================
   VALIDATION MOT DE PASSE
=============================================== */

.password-requirements {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 0.85rem;
}

.password-requirements .req {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  color: #666;
  transition: color 0.2s ease;
}

.password-requirements .req .icon {
  font-weight: bold;
  width: 1.2rem;
  text-align: center;
}

.password-requirements .req.valid {
  color: #28a745;
}

.password-requirements .req.valid .icon {
  color: #28a745;
}

.password-requirements .req.invalid {
  color: #dc3545;
}

.password-requirements .req.invalid .icon {
  color: #dc3545;
}

.password-match {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  padding: 0.25rem 0;
}

.password-match.valid {
  color: #28a745;
}

.password-match.invalid {
  color: #dc3545;
}

/* Responsive mobile */
@media (max-width: 480px) {
  .container {
    padding: 1.8rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  input,
  button {
    font-size: 0.95rem;
  }

  .password-requirements {
    font-size: 0.8rem;
  }
}