@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/* Box-sizing global */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background-color: #f5e5d7;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

/* Logo */
.logo {
  width: 150px;
  height: auto;
  display: block;
  margin: 0 auto 35px; /* centrado y separación inferior */
}

/* Contenedor centrado */
.form-container {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

/* Título */
h2 {
  color: #4f0452;
  margin-bottom: 20px;
  font-size: 42px;
}

/* Formulario */
form {
  text-align: left;
}

label {
  font-weight: 600;
  display: block;
  margin-top: 15px;
  color: #444;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 15px;
  background-color: #fdfdfd;
  box-sizing: border-box;
  height: 44px;
}

button[type="submit"] {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 25px;
  border: none;
  border-radius: 12px;
  background-color: #f27c41;
  color: white;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button[type="submit"]:hover {
  background-color: #e2692d;
}

/* Enlace a login */
p {
  margin-top: 20px;
  color: #070200;
  font-size: 16px;
}

p a {
  color: #4f0452;
  text-decoration: none;
  font-weight: 600;
}

p a:hover {
  text-decoration: underline;
  color: #e0531b;
}

.password-info {
  margin-top: 10px;
}

#generatePassword {
  margin-top: 5px;
  background-color: #e67e22;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}

#generatedPassword {
  margin-top: 5px;
  font-weight: bold;
  color: #2c3e50;
  word-break: break-all;
}

/* Mensajes de estado */
.message {
  padding: 14px 16px;
  margin: 20px 0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  display: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Contenedor para campo de contraseña con íconos */
.password-container {
  position: relative;
  width: 100%;
}

.input-wrapper {
  position: relative;
  width: 100%;
  height: 44px;
}

.password-container input {
  padding-right: 80px; /* espacio para ojo + llave */
}

/* Ícono del ojo */
.eye-icon {
  position: absolute;
  top: 52%;
  right: 10px;
  transform: translateY(-10%);
  height: 20px;
  width: 20px;
  cursor: pointer;
  color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.eye-icon:hover {
  opacity: 1;
}

/* Ícono de la llave */
.key-icon {
  position: absolute;
  top: 52%;
  right: 40px;
  transform: translateY(-10%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: #444;
  font-size: 18px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.key-icon:hover {
  opacity: 1;
}

/* Fondo animado */
.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  z-index: -2;
  animation: zoomIn 0.6s ease-out forwards;
}

/* Animación fondo */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animación formulario */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-container {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
  animation-delay: 0.8s;
}

/* Responsive para móviles */
@media (max-width: 400px) {
  .form-container {
    padding: 0 10px;
  }

  h2 {
    font-size: 20px;
  }

  button {
    font-size: 14px;
  }

  input {
    font-size: 14px;
  }
}
