/* Reset y estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.6;
}

.contenedor {
  width: 100%;
  max-width: 450px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.recovery-form,
.password-reset-form {
  text-align: center;
}

h2 {
  color: #333;
  margin-bottom: 30px;
  font-size: 28px;
  font-weight: 600;
}

/* Estilos de formulario */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 15px;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: #fff;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.form-group input:valid {
  border-color: #28a745;
}

.form-group input:invalid:not(:placeholder-shown) {
  border-color: #dc3545;
}

/* Contenedor de contraseña con botón de mostrar/ocultar */
.password-container {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #666;
  padding: 5px;
  border-radius: 4px;
  transition: color 0.3s ease;
}

.password-toggle:hover {
  color: #333;
  background-color: rgba(0, 0, 0, 0.05);
}

/* Indicadores de fortaleza de contraseña */
.password-strength {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
}

.strength-weak {
  color: #dc3545;
}

.strength-medium {
  color: #ffc107;
}

.strength-strong {
  color: #28a745;
}

/* Requisitos de contraseña */
.requirements {
  margin-top: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.requirements strong {
  color: #495057;
  font-size: 13px;
}

.requirements ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.requirements li {
  font-size: 12px;
  margin: 4px 0;
  transition: color 0.3s ease;
}

.requirements .valid {
  color: #28a745;
  font-weight: 500;
}

.requirements .invalid {
  color: #dc3545;
}

/* Botones */
.btn-primary,
.boton_rec,
.boton_cam {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover,
.boton_rec:hover,
.boton_cam:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:active,
.boton_rec:active,
.boton_cam:active {
  transform: translateY(0);
}

.btn-primary:disabled,
.boton_rec:disabled,
.boton_cam:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary::before,
.boton_rec::before,
.boton_cam::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before,
.boton_rec:hover::before,
.boton_cam:hover::before {
  left: 100%;
}

.loading {
  display: none;
}

.btn-primary:disabled .loading {
  display: inline;
}

.btn-primary:disabled .btn-text {
  display: none;
}

/* Mensajes de estado */
.error {
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #f5c6cb;
  margin: 15px 0;
  font-size: 14px;
}

.success {
  background: #d4edda;
  color: #155724;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #c3e6cb;
  margin: 15px 0;
  font-size: 14px;
}

/* Enlaces */
a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

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

/* Estilos antiguos para compatibilidad */
.form_cam {
  width: 100%;
}

.pass_cam {
  width: 100%;
  padding: 15px;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  font-size: 16px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.pass_cam:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Mensajes de validación */
.validation-message {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 500;
}

.validation-message.valid {
  color: #28a745;
}

.validation-message.invalid {
  color: #dc3545;
}

/* Responsive */
@media (max-width: 480px) {
  .contenedor {
    padding: 30px 20px;
    margin: 10px;
  }

  h2 {
    font-size: 24px;
  }

  .form-group input,
  .pass_cam {
    padding: 12px;
    font-size: 14px;
  }

  .btn-primary,
  .boton_rec,
  .boton_cam {
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.contenedor {
  animation: fadeIn 0.5s ease;
}

/* Indicadores de validación en tiempo real */
.form-group input:valid:not(:placeholder-shown) {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94.94 4.08-4.08-.94-.94-3.14 3.14-1.14-1.14-.94.94z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px 16px;
  padding-right: 45px;
}

.form-group input:invalid:not(:placeholder-shown) {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.5 5.5 1 1m0 0 1 1m-1-1 1-1m-1 1-1 1'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px 16px;
  padding-right: 45px;
}
